#include <gfx_image_storage.h>
Object that can store pixel data in a special layout (e.g. compact, plain, or tiles).
Public Member Functions | |
MAXON_METHOD Result< void > | Init (Int width, Int height, const PixelFormat &format, const Block< Pix > *defaultColor) |
MAXON_METHOD Int | GetWidth () const |
MAXON_METHOD Int | GetHeight () const |
MAXON_METHOD Int | GetChannelCount () const |
MAXON_METHOD PixelFormat | GetPixelFormat () const |
MAXON_METHOD Result< GetPixelHandlerStruct > | GetPixelHandler (const PixelFormat &dstFormat, const ChannelOffsets &channelOffsets, const ColorProfile &srcColorProfile, const ColorProfile &dstColorProfile, GETPIXELHANDLERFLAGS flags) const |
MAXON_METHOD Result< SetPixelHandlerStruct > | SetPixelHandler (const PixelFormat &srcFormat, const ChannelOffsets &channelOffsets, const ColorProfile &srcColorProfile, const ColorProfile &dstColorProfile, SETPIXELHANDLERFLAGS flags, const Delegate< void(const UpdateRegion &)> &updateRegionNotification) |
MAXON_METHOD Result< void > | GetComponent (Int component, const ImagePos &pos, Pix *data, Int inc, GETPIXELFLAGS flags) const |
MAXON_METHOD Result< void > | SetComponent (Int component, const ImagePos &pos, const Pix *data, Int inc, SETPIXELFLAGS flags) |
Private Member Functions | |
MAXON_INTERFACE (ImagePixelStorageInterface, MAXON_REFERENCE_COPY_ON_WRITE, "net.maxon.image.interface.imagepixelstorage") | |
|
private |
MAXON_METHOD Result<void> Init | ( | Int | width, |
Int | height, | ||
const PixelFormat & | format, | ||
const Block< Pix > * | defaultColor | ||
) |
Initializes the pixel storage.
[in] | width | Width of the image data. |
[in] | height | Height of the image data. |
[in] | format | Pixel format of the pixel storage, e.g. ImagePixelStorageClasses::Normal. |
[in] | defaultColor | Optional default color to return if no image data is present. Must be in the given PixelFormat. Can be nullptr. |
MAXON_METHOD Int GetWidth | ( | ) | const |
Returns the width of the pixel storage.
MAXON_METHOD Int GetHeight | ( | ) | const |
Returns the height of the pixel storage.
MAXON_METHOD Int GetChannelCount | ( | ) | const |
Returns the total number of channels of the pixel storage.
MAXON_METHOD PixelFormat GetPixelFormat | ( | ) | const |
Returns the pixel format connected to this pixel storage.
MAXON_METHOD Result<GetPixelHandlerStruct> GetPixelHandler | ( | const PixelFormat & | dstFormat, |
const ChannelOffsets & | channelOffsets, | ||
const ColorProfile & | srcColorProfile, | ||
const ColorProfile & | dstColorProfile, | ||
GETPIXELHANDLERFLAGS | flags | ||
) | const |
To access pixel data a GetPixelHandlerStruct is needed. This optimizes the access to the pixel data see GetPixelHandlerStruct.
[in] | dstFormat | Destination pixel format that should be read with this pixel handler. |
[in] | channelOffsets | Destination channel offset in bits. |
[in] | srcColorProfile | Optional parameter which is only necessary if the color spaces of the given pixel formats doesn't match. In that case the conversion will be performed using the correct color conversion. |
[in] | dstColorProfile | Optional parameter which is only necessary if the color spaces of the given pixel formats doesn't match. In that case the conversion will be performed using the correct color conversion. |
[in] | flags | Flags for the GetPixel operation. |
MAXON_METHOD Result<SetPixelHandlerStruct> SetPixelHandler | ( | const PixelFormat & | srcFormat, |
const ChannelOffsets & | channelOffsets, | ||
const ColorProfile & | srcColorProfile, | ||
const ColorProfile & | dstColorProfile, | ||
SETPIXELHANDLERFLAGS | flags, | ||
const Delegate< void(const UpdateRegion &)> & | updateRegionNotification | ||
) |
To access pixel data a SetPixelHandlerStruct is needed. This optimizes the access to the pixel data see SetPixelHandlerStruct.
[in] | srcFormat | Source pixel format that should be written with this pixel handler. |
[in] | channelOffsets | Source channel offsets in bits. |
[in] | srcColorProfile | Optional parameter which is only necessary if the color spaces of the given pixel formats doesn't match. In that case the conversion will be performed using the correct color conversion. |
[in] | dstColorProfile | Optional parameter which is only necessary if the color spaces of the given pixel formats doesn't match. In that case the conversion will be performed using the correct color conversion. |
[in] | flags | Flags for the SetPixel operation. |
MAXON_METHOD Result<void> GetComponent | ( | Int | component, |
const ImagePos & | pos, | ||
Pix * | data, | ||
Int | inc, | ||
GETPIXELFLAGS | flags | ||
) | const |
Access single components of the image.
[in] | component | Index of the component. |
[in] | pos | ImagePos of the data to read. |
[in] | data | Destination buffer. |
[in] | inc | Distance between 2 pixels in the destination buffer. |
[in] | flags | Flags to control the read operation. |
MAXON_METHOD Result<void> SetComponent | ( | Int | component, |
const ImagePos & | pos, | ||
const Pix * | data, | ||
Int | inc, | ||
SETPIXELFLAGS | flags | ||
) |
Access single components of the image.
[in] | component | Index of the component. |
[in] | pos | ImagePos of the data to write. |
[in] | data | Source buffer. |
[in] | inc | Distance between 2 pixels in the source buffer. |
[in] | flags | Flags to control the write operation. |