MaxstARSDK  3.5.0
SurfaceThumbnail.cs
1 /*==============================================================================
2 Copyright 2017 Maxst, Inc. All Rights Reserved.
3 ==============================================================================*/
4 
5 using UnityEngine;
6 using System;
7 using System.Collections.Generic;
8 using System.Linq;
9 using System.Text;
10 using System.Runtime.InteropServices;
11 
12 namespace maxstAR
13 {
17  public class SurfaceThumbnail
18  {
19  private ulong cPtr;
20 
21  internal SurfaceThumbnail(ulong cPtr)
22  {
23  this.cPtr = cPtr;
24  }
25 
29  public int GetWidth()
30  {
31  if (Application.platform == RuntimePlatform.IPhonePlayer)
32  {
33  return NativeStaticAPI.SurfaceThumbnail_getWidth(cPtr);
34  }
35  else
36  {
37  return NativeSharedAPI.SurfaceThumbnail_getWidth(cPtr);
38  }
39  }
40 
44  public int GetHeight()
45  {
46  if (Application.platform == RuntimePlatform.IPhonePlayer)
47  {
48  return NativeStaticAPI.SurfaceThumbnail_getHeight(cPtr);
49  }
50  else
51  {
52  return NativeSharedAPI.SurfaceThumbnail_getHeight(cPtr);
53  }
54  }
55 
59  public int GetLength()
60  {
61  if (Application.platform == RuntimePlatform.IPhonePlayer)
62  {
63  return NativeStaticAPI.SurfaceThumbnail_getLength(cPtr);
64  }
65  else
66  {
67  return NativeSharedAPI.SurfaceThumbnail_getLength(cPtr);
68  }
69  }
70 
74  public byte [] GetData()
75  {
76  int length = GetLength();
77  byte[] data = new byte[length];
78  if (Application.platform == RuntimePlatform.IPhonePlayer)
79  {
80  NativeStaticAPI.SurfaceThumbnail_getData(cPtr, data, length);
81  }
82  else
83  {
84  NativeSharedAPI.SurfaceThumbnail_getData(cPtr, data, length);
85  }
86 
87  return data;
88  }
89  }
90 }
Contains surface thumbnail image information of first keyframe