Tanoda
ImageData.cs
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) Ultraleap, Inc. 2011-2020. *
3 * *
4 * Use subject to the terms of the Apache License 2.0 available at *
5 * http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
6 * between Ultraleap and you, your company or other organization. *
7 ******************************************************************************/
8
9namespace LeapInternal {
10 using System;
11 using Leap;
12
13 public class ImageData {
14 private LEAP_IMAGE_PROPERTIES _properties;
15 private object _object;
16
17 public Image.CameraType camera { get; protected set; }
18 public eLeapImageType type { get { return _properties.type; } }
19 public eLeapImageFormat format { get { return _properties.format; } }
20 public UInt32 bpp { get { return _properties.bpp; } }
21 public UInt32 width { get { return _properties.width; } }
22 public UInt32 height { get { return _properties.height; } }
23 public float RayScaleX { get { return _properties.x_scale; } }
24 public float RayScaleY { get { return _properties.y_scale; } }
25 public float RayOffsetX { get { return _properties.x_offset; } }
26 public float RayOffsetY { get { return _properties.y_offset; } }
27 public byte[] AsByteArray { get { return _object as byte[]; } }
28 public float[] AsFloatArray { get { return _object as float[]; } }
29 public UInt32 byteOffset { get; protected set; }
30
31 public int DistortionSize { get { return LeapC.DistortionSize; } }
32 public UInt64 DistortionMatrixKey { get; protected set; }
33 public DistortionData DistortionData { get; protected set; }
34
35 public ImageData(Image.CameraType camera, LEAP_IMAGE image, DistortionData distortionData) {
36 this.camera = camera;
37 this._properties = image.properties;
39 this.DistortionData = distortionData;
40 this._object = MemoryManager.GetPinnedObject(image.data);
41 this.byteOffset = image.offset;
42 }
43 }
44}
The DistortionData class contains the distortion map for correcting the lens distortion of an image.
The Image class represents a stereo image pair from the Leap Motion device.
Definition: Image.cs:20
CameraType
Definition: Image.cs:386
ImageData(Image.CameraType camera, LEAP_IMAGE image, DistortionData distortionData)
Definition: ImageData.cs:35
UInt64 DistortionMatrixKey
Definition: ImageData.cs:32
eLeapImageFormat format
Definition: ImageData.cs:19
eLeapImageType type
Definition: ImageData.cs:18
Image.CameraType camera
Definition: ImageData.cs:17
static int DistortionSize
Definition: LeapC.cs:792
eLeapImageType
Definition: LeapC.cs:152
eLeapImageFormat
Definition: LeapC.cs:164
LEAP_IMAGE_PROPERTIES properties
Definition: LeapC.cs:610