documentation

ImageWrapper

Functions for managing ImageWrapper objects. More...

Functions

VL_SDK_API vlImageWrapper_t *VL_CALLINGCONVENTION vlNew_ImageWrapper (vlImageFormat imageFormat)
 Creates a new Image object and returns a pointer to it. More...
 
VL_SDK_API void VL_CALLINGCONVENTION vlDelete_ImageWrapper (vlImageWrapper_t *imageWrapper)
 Deletes an ImageWrapper object. More...
 
VL_SDK_API unsigned int VL_CALLINGCONVENTION vlImageWrapper_GetFormat (vlImageWrapper_t *imageWrapper)
 Returns the internal type of the image. More...
 
VL_SDK_API unsigned int VL_CALLINGCONVENTION vlImageWrapper_GetBytesPerPixel (vlImageWrapper_t *imageWrapper)
 Returns the number of bytes per pixel. More...
 
VL_SDK_API unsigned int VL_CALLINGCONVENTION vlImageWrapper_GetWidth (vlImageWrapper_t *imageWrapper)
 Returns the width of the image. More...
 
VL_SDK_API unsigned int VL_CALLINGCONVENTION vlImageWrapper_GetHeight (vlImageWrapper_t *imageWrapper)
 Returns the height of the image. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlImageWrapper_CopyToBuffer (vlImageWrapper_t *imageWrapper, unsigned char buffer[], unsigned int bufferSize)
 Copies the VisionLib image into the given buffer. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlImageWrapper_CopyFromBuffer (vlImageWrapper_t *imageWrapper, const unsigned char buffer[], unsigned int width, unsigned int height)
 Copies the given buffer into the VisionLib image. More...
 
VL_SDK_API bool VL_CALLINGCONVENTION vlImageWrapper_CopyFromBufferWithFormat (vlImageWrapper_t *imageWrapper, const unsigned char buffer[], unsigned int width, unsigned int height, vlImageFormat imageFormat)
 Copies the given an formated buffer into the VisionLib image. More...
 

Detailed Description

Functions for managing ImageWrapper objects.

The ImageWrapper is a wrapper for an Image object.

Function Documentation

◆ vlDelete_ImageWrapper()

VL_SDK_API void VL_CALLINGCONVENTION vlDelete_ImageWrapper ( vlImageWrapper_t imageWrapper)

Deletes an ImageWrapper object.

Call this function if you used the ::vlDataSetWrapper_GetImage function to acquire the object and you are now done using it.

Parameters
imageWrapperPointer to an ImageWrapper object.

◆ vlImageWrapper_CopyFromBuffer()

VL_SDK_API bool VL_CALLINGCONVENTION vlImageWrapper_CopyFromBuffer ( vlImageWrapper_t imageWrapper,
const unsigned char  buffer[],
unsigned int  width,
unsigned int  height 
)

Copies the given buffer 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 buffer has the same format as the image. The image format can be acquired using the vlImageWrapper_GetFormat function.

Parameters
imageWrapperPointer to an ImageWrapper object.
bufferBuffer with the raw image data.
widthNew width of the image.
heightNew height of the image.
Returns
true, on success; false otherwise.

◆ vlImageWrapper_CopyFromBufferWithFormat()

VL_SDK_API bool VL_CALLINGCONVENTION vlImageWrapper_CopyFromBufferWithFormat ( vlImageWrapper_t imageWrapper,
const unsigned char  buffer[],
unsigned int  width,
unsigned int  height,
vlImageFormat  imageFormat 
)

Copies the given an formated buffer into the VisionLib image.

The VisionLib image will be resized according to the width and height and format parameter.

The image will be converted into internally into a RGBA format.

Parameters
imageWrapperPointer to an ImageWrapper object.
bufferBuffer with the raw image data.
widthNew width of the image.
heightNew height of the image.
imageFormatThe format of the image.
Returns
true, on success; false otherwise.

◆ vlImageWrapper_CopyToBuffer()

VL_SDK_API bool VL_CALLINGCONVENTION vlImageWrapper_CopyToBuffer ( vlImageWrapper_t imageWrapper,
unsigned char  buffer[],
unsigned int  bufferSize 
)

Copies the VisionLib image into the given buffer.

Please make sure, that the buffer is large enough for storing the whole image date (width * height * bytesPerPixel). The number of bytes per pixel an be acquired using the vlImageWrapper_GetBytesPerPixel function.

Parameters
imageWrapperPointer to an ImageWrapper object.
bufferBuffer with width * height * bytesPerPixel bytes of memory.
bufferSizeSize of the buffer.
Returns
true, on success; false otherwise.

◆ vlImageWrapper_GetBytesPerPixel()

VL_SDK_API unsigned int VL_CALLINGCONVENTION vlImageWrapper_GetBytesPerPixel ( vlImageWrapper_t imageWrapper)

Returns the number of bytes per pixel.

Parameters
imageWrapperPointer to an ImageWrapper object.
Returns
The number of bytes per pixel.

◆ vlImageWrapper_GetFormat()

VL_SDK_API unsigned int VL_CALLINGCONVENTION vlImageWrapper_GetFormat ( vlImageWrapper_t imageWrapper)

Returns the internal type of the image.

Parameters
imageWrapperPointer to an ImageWrapper object.
Returns
Internal type of the image. The value can be cast into a vlImageFormat enumeration.

◆ vlImageWrapper_GetHeight()

VL_SDK_API unsigned int VL_CALLINGCONVENTION vlImageWrapper_GetHeight ( vlImageWrapper_t imageWrapper)

Returns the height of the image.

Parameters
imageWrapperPointer to an ImageWrapper object.
Returns
The height in pixels.

◆ vlImageWrapper_GetWidth()

VL_SDK_API unsigned int VL_CALLINGCONVENTION vlImageWrapper_GetWidth ( vlImageWrapper_t imageWrapper)

Returns the width of the image.

Parameters
imageWrapperPointer to an ImageWrapper object.
Returns
The width in pixels.

◆ vlNew_ImageWrapper()

VL_SDK_API vlImageWrapper_t* VL_CALLINGCONVENTION vlNew_ImageWrapper ( vlImageFormat  imageFormat)

Creates a new Image object and returns a pointer to it.

This pointer must be released using vlDelete_ImageWrapper.

Parameters
imageFormatThe format of the image to create.
Returns
A pointer to the new ImageData.