iDRS™ SDK 16
Loading...
Searching...
No Matches
CImagePixels_interface.h File Reference

Interface for CImagePixels wrapper. More...

Go to the source code of this file.

Functions

void CImagePixels_SetPixelColor (CImagePixels argCImagePixels, IDRS_UINT32 const uiCol, IDRS_UINT32 const uiRow, const IDRS_COLOR *color, idrs_exception *pargException)
 Sets the color of the pixel at the given coordinates.
 
IDRS_COLOR CImagePixels_GetPixelColor (const CImagePixels argCImagePixels, IDRS_UINT32 const uiCol, IDRS_UINT32 const uiRow, idrs_exception *pargException)
 Gets the color of the pixel at the given coordinates.
 
void CImagePixels_FillBitmap (CImagePixels argCImagePixels, const IDRS_COLOR *color, idrs_exception *pargException)
 FillBitmap fills the image with the given color.
 
IDRS_PVOID CImagePixels_GetPixels (const CImagePixels argCImagePixels, idrs_exception *pargException)
 
void CImagePixels_SetPixelsBuffer (CImagePixels argCImagePixels, IDRS_PBYTE const xbPixelsBuffer, IDRS_UINT32 const uiBufferSize, idrs_exception *pargException)
 Sets the image pixels from an external buffer.
 
IDRS_UINT32 CImagePixels_GetPixelsBufferSize (const CImagePixels argCImagePixels, idrs_exception *pargException)
 Gets the size of the buffer allocated to store the image pixels.
 
void CImagePixels_GetPixelsBuffer (const CImagePixels argCImagePixels, IDRS_PBYTE xbPixelsBuffer, IDRS_UINT32 const uiBufferSize, idrs_exception *pargException)
 Gets the image pixels to a preallocated buffer.
 
IDRS_UINT32 CImagePixels_GetWidth (const CImagePixels argCImagePixels, idrs_exception *pargException)
 Gets the image width, in pixels.
 
IDRS_UINT32 CImagePixels_GetHeight (const CImagePixels argCImagePixels, idrs_exception *pargException)
 Gets the image width, in pixels.
 
IDRS_UINT32 CImagePixels_GetByteWidth (const CImagePixels argCImagePixels, idrs_exception *pargException)
 Gets the image byte width.
 
enum ColorMode CImagePixels_GetColorMode (const CImagePixels argCImagePixels, idrs_exception *pargException)
 
IDRS_UINT32 CImagePixels_GetImageSize (IDRS_UINT32 const uiWidth, IDRS_UINT32 const uiHeight, enum ColorMode const cmColorMode, idrs_exception *pargException)
 Gets the image size image with the provided properties.
 
IDRS_UINT32 CImagePixels_GetByteWidth2 (IDRS_UINT32 const uiWidth, enum ColorMode const cmColorMode, idrs_exception *pargException)
 Gets the width in bytes of an image with the provided properties.
 
void CImagePixels_Destroy (CImagePixels argCImagePixels, idrs_exception *pargException)
 Destroys a CImagePixels handle.
 

Detailed Description

Interface for CImagePixels wrapper.

Function Documentation

◆ CImagePixels_Destroy()

void CImagePixels_Destroy ( CImagePixels  argCImagePixels,
idrs_exception *  pargException 
)

Destroys a CImagePixels handle.

Parameters
argCImagePixelsCImagePixels handle to destroy
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CImagePixels_FillBitmap()

void CImagePixels_FillBitmap ( CImagePixels  argCImagePixels,
const IDRS_COLOR color,
idrs_exception *  pargException 
)

FillBitmap fills the image with the given color.

Parameters
argCImagePixelsCImagePixels handle
colorThe color.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Note
For a black and white image, the valid colors have blue == green == red ==0xFF or blue == green == red ==0x00
For a greyscale image, the valid colors have blue == green == red.

◆ CImagePixels_GetByteWidth()

IDRS_UINT32 CImagePixels_GetByteWidth ( const CImagePixels  argCImagePixels,
idrs_exception *  pargException 
)

Gets the image byte width.

Note
iDRS black and white images are one bit per pixel, aligned on 32 bits.
iDRS greyscale images are 8 bits per pixel with no alignment. This means that byte width equals the pixel width.
iDRS color images are 24 bits per pixel with no alignment. This means that byte width is equal to 3 times the pixel width.
Returns
The width in bytes of the image
Parameters
argCImagePixelsCImagePixels handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CImagePixels_GetByteWidth2()

IDRS_UINT32 CImagePixels_GetByteWidth2 ( IDRS_UINT32 const  uiWidth,
enum ColorMode const  cmColorMode,
idrs_exception *  pargException 
)

Gets the width in bytes of an image with the provided properties.

Parameters
uiWidthThe width in pixels of the image.
cmColorModeThe color mode for the image.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The width of the image (bytes)

◆ CImagePixels_GetColorMode()

enum ColorMode CImagePixels_GetColorMode ( const CImagePixels  argCImagePixels,
idrs_exception *  pargException 
)
Returns
The color mode of the image
Parameters
argCImagePixelsCImagePixels handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CImagePixels_GetHeight()

IDRS_UINT32 CImagePixels_GetHeight ( const CImagePixels  argCImagePixels,
idrs_exception *  pargException 
)

Gets the image width, in pixels.

Returns
The height in pixels of the image
Parameters
argCImagePixelsCImagePixels handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CImagePixels_GetImageSize()

IDRS_UINT32 CImagePixels_GetImageSize ( IDRS_UINT32 const  uiWidth,
IDRS_UINT32 const  uiHeight,
enum ColorMode const  cmColorMode,
idrs_exception *  pargException 
)

Gets the image size image with the provided properties.

Parameters
uiWidthThe width in pixels of the image.
uiHeightThe height in pixels of the image.
cmColorModeThe color mode for the image.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The size of the image (bytes)

◆ CImagePixels_GetPixelColor()

IDRS_COLOR CImagePixels_GetPixelColor ( const CImagePixels  argCImagePixels,
IDRS_UINT32 const  uiCol,
IDRS_UINT32 const  uiRow,
idrs_exception *  pargException 
)

Gets the color of the pixel at the given coordinates.

Parameters
argCImagePixelsCImagePixels handle
uiColThe 0 based index of the column.
uiRowThe 0 based index of the row.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Returns
The color of the pixel.

◆ CImagePixels_GetPixels()

IDRS_PVOID CImagePixels_GetPixels ( const CImagePixels  argCImagePixels,
idrs_exception *  pargException 
)
Returns
The buffer of pixels
Parameters
argCImagePixelsCImagePixels handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CImagePixels_GetPixelsBuffer()

void CImagePixels_GetPixelsBuffer ( const CImagePixels  argCImagePixels,
IDRS_PBYTE  xbPixelsBuffer,
IDRS_UINT32 const  uiBufferSize,
idrs_exception *  pargException 
)

Gets the image pixels to a preallocated buffer.

The buffer size provided needs to be at least the image size.

Parameters
argCImagePixelsCImagePixels handle
xbPixelsBufferBuffer where the pixels will be copied
uiBufferSizeThe size of the buffer provided, in bytes.
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CImagePixels_GetPixelsBufferSize()

IDRS_UINT32 CImagePixels_GetPixelsBufferSize ( const CImagePixels  argCImagePixels,
idrs_exception *  pargException 
)

Gets the size of the buffer allocated to store the image pixels.

This size is expressed in bytes.

Returns
The size of the buffer allocated to store the image pixels.
Remarks
The value returned by this method is identical to the value of GetSize ().uiImageSize
Parameters
argCImagePixelsCImagePixels handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CImagePixels_GetWidth()

IDRS_UINT32 CImagePixels_GetWidth ( const CImagePixels  argCImagePixels,
idrs_exception *  pargException 
)

Gets the image width, in pixels.

Returns
The width in pixels of the image
Parameters
argCImagePixelsCImagePixels handle
pargExceptionPointer to exception structure that will be filled if an exception occurs

◆ CImagePixels_SetPixelColor()

void CImagePixels_SetPixelColor ( CImagePixels  argCImagePixels,
IDRS_UINT32 const  uiCol,
IDRS_UINT32 const  uiRow,
const IDRS_COLOR color,
idrs_exception *  pargException 
)

Sets the color of the pixel at the given coordinates.

Parameters
argCImagePixelsCImagePixels handle
uiColThe 0 based index of the column.
uiRowThe 0 based index of the row.
colorThe color.
pargExceptionPointer to exception structure that will be filled if an exception occurs
Note
For a black and white image, the valid colors have blue == green == red ==0xFF or blue == green == red ==0x00
For a greyscale image, the valid colors have blue == green == red.

◆ CImagePixels_SetPixelsBuffer()

void CImagePixels_SetPixelsBuffer ( CImagePixels  argCImagePixels,
IDRS_PBYTE const  xbPixelsBuffer,
IDRS_UINT32 const  uiBufferSize,
idrs_exception *  pargException 
)

Sets the image pixels from an external buffer.

Parameters
argCImagePixelsCImagePixels handle
xbPixelsBufferBuffer containing the pixels
uiBufferSizeSize of the buffer, in bytes
pargExceptionPointer to exception structure that will be filled if an exception occurs
Attention
The buffer size provided needs to be exactly the same than the size required for this image.