The VLImageWrapper is a wrapper for an Image object.
More...
Inherits IDisposable.
The VLImageWrapper is a wrapper for an Image object.
- See also
- VLDataSetWrapper.GetImage
◆ VLImageWrapper() [1/2]
VLImageWrapper.VLImageWrapper |
( |
IntPtr |
handle, |
|
|
bool |
owner |
|
) |
| |
|
inline |
Constructor of VLImageWrapper.
Don't call this constructor directly. Use the VLAbstractApplicationWrapper.GetDataSet and VLDataSetWrapper.GetImage methods instead.
- Parameters
-
handle | Handle to the native object. |
owner | true , if the VLImageWrapper is the owner of the native object; false , otherwise. |
◆ VLImageWrapper() [2/2]
VLImageWrapper.VLImageWrapper |
( |
byte [] |
vlImage, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
inline |
◆ Clone()
Creates a copy of this object and returns a Wrapper of it.
- Returns
- A wrapper of a copy of this object.
◆ CopyFromBuffer()
bool VLImageWrapper.CopyFromBuffer |
( |
byte [] |
buffer, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
inline |
Copies the given byte array into the VisionLib image.
The VisionLib image will be resized according to the width and height parameter.
Please make sure, that the data stored in the byte array has the same format as the image. The image format can be acquired using the GetFormat function.
- Returns
true
, if the data was copied into the image successfully; false
otherwise.
- Parameters
-
buffer | Byte array with the image data. |
width | New width of the image. |
height | New height of the image. |
◆ CopyToBuffer()
bool VLImageWrapper.CopyToBuffer |
( |
byte [] |
buffer | ) |
|
|
inline |
Copies the VisionLib image into the given byte array.
Please make sure, that the byte array is large enough for storing the whole image date (width * height * bytesPerPixel). The number of bytes per pixel an be acquired using the GetBytesPerPixel function.
- Returns
true
, if the data was copied to the byte array successfully; false
otherwise.
- Parameters
-
buffer | Byte array for storing the raw image data. |
◆ CreateFromTexture() [1/4]
static VLImageWrapper VLImageWrapper.CreateFromTexture |
( |
Texture2D |
texture, |
|
|
ref byte [] |
byteBuffer |
|
) |
| |
|
inlinestatic |
◆ CreateFromTexture() [2/4]
static VLImageWrapper VLImageWrapper.CreateFromTexture |
( |
Texture2D |
texture | ) |
|
|
inlinestatic |
◆ CreateFromTexture() [3/4]
static VLImageWrapper VLImageWrapper.CreateFromTexture |
( |
WebCamTexture |
texture, |
|
|
ref byte [] |
byteBuffer |
|
) |
| |
|
inlinestatic |
◆ CreateFromTexture() [4/4]
static VLImageWrapper VLImageWrapper.CreateFromTexture |
( |
WebCamTexture |
texture | ) |
|
|
inlinestatic |
◆ Dispose()
void VLImageWrapper.Dispose |
( |
| ) |
|
|
inline |
Explicitly releases references to unmanaged resources.
Call Dispose when you are finished using the VLImageWrapper. The Dispose method leaves the VLImageWrapper in an unusable state. After calling Dispose, you must release all references to the VLImageWrapper so the garbage collector can reclaim the memory that the VLImageWrapper was occupying.
◆ GetBytesPerPixel()
int VLImageWrapper.GetBytesPerPixel |
( |
| ) |
|
|
inline |
Returns the number of bytes per pixel.
- Returns
- The number of bytes per pixel.
◆ GetFormat()
VLUnitySdk.ImageFormat VLImageWrapper.GetFormat |
( |
| ) |
|
|
inline |
Returns an enumeration with the internal type of the image.
- Returns
- VLUnitySdk.ImageFormat enumeration with the internal type of the image.
◆ getHandle()
IntPtr VLImageWrapper.getHandle |
( |
| ) |
|
|
inline |
◆ GetHeight()
int VLImageWrapper.GetHeight |
( |
| ) |
|
|
inline |
Returns the height of the image.
- Returns
- The height in pixels.
◆ GetWidth()
int VLImageWrapper.GetWidth |
( |
| ) |
|
|
inline |
Returns the width of the image.
- Returns
- The width in pixels.