Image is a wrapper for an Image object.
More...
Inherits IDisposable.
|
static Image | CreateFromBuffer (byte[] buffer, int width, int height) |
|
static Image | CreateFromBuffer (IntPtr buffer, int width, int height) |
|
static Image | CreateFromTexture (Texture2D texture) |
|
static Image | CreateFromTexture (Texture2D texture, ref byte[] byteBuffer) |
|
static Image | CreateFromTexture (WebCamTexture texture) |
|
static Image | CreateFromTexture (WebCamTexture texture, ref byte[] byteBuffer) |
|
Image is a wrapper for an Image object.
◆ Image()
Visometry.VisionLib.SDK.Core.API.Native.Image.Image |
( |
IntPtr |
handle, |
|
|
bool |
owner |
|
) |
| |
|
inline |
Internal constructor of the Image.
This constructor is used internally by the VisionLib.
- Parameters
-
handle | Handle to the native object. |
owner | true , if the Image is the owner of the native object; false , otherwise. |
◆ Clone()
Image Visometry.VisionLib.SDK.Core.API.Native.Image.Clone |
( |
| ) |
|
|
inline |
Creates a copy of this object and returns a Wrapper of it.
- Returns
- A wrapper of a copy of this object.
◆ CopyFromBuffer()
bool Visometry.VisionLib.SDK.Core.API.Native.Image.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 Visometry.VisionLib.SDK.Core.API.Native.Image.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. |
◆ Dispose()
void Visometry.VisionLib.SDK.Core.API.Native.Image.Dispose |
( |
| ) |
|
|
inline |
Explicitly releases references to unmanaged resources.
Call Dispose when you are finished using the Image. The Dispose method leaves the Image in an unusable state. After calling Dispose, you must release all references to the Image so the garbage collector can reclaim the memory that the Image was occupying.
◆ GetBytesPerPixel()
int Visometry.VisionLib.SDK.Core.API.Native.Image.GetBytesPerPixel |
( |
| ) |
|
|
inline |
Returns the number of bytes per pixel.
- Returns
- The number of bytes per pixel.
◆ GetFormat()
VLSDK.ImageFormat Visometry.VisionLib.SDK.Core.API.Native.Image.GetFormat |
( |
| ) |
|
|
inline |
Returns an enumeration with the internal type of the image.
- Returns
- VLSDK.ImageFormat enumeration with the internal type of the image.
◆ GetHeight()
int Visometry.VisionLib.SDK.Core.API.Native.Image.GetHeight |
( |
| ) |
|
|
inline |
Returns the height of the image.
- Returns
- The height in pixels.
◆ GetWidth()
int Visometry.VisionLib.SDK.Core.API.Native.Image.GetWidth |
( |
| ) |
|
|
inline |
Returns the width of the image.
- Returns
- The width in pixels.