ImagePixelStorageInterface Class Reference

#include <gfx_image_storage.h>

Inheritance diagram for ImagePixelStorageInterface:

详细描述

Object that can store pixel data in a special layout (e.g. compact, plain, or tiles).

公共成员函数

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)

私有成员函数

  MAXON_INTERFACE ( ImagePixelStorageInterface , MAXON_REFERENCE_COPY_ON_WRITE , "net.maxon.image.interface.imagepixelstorage")

成员函数文档编制

◆  MAXON_INTERFACE()

MAXON_INTERFACE ( ImagePixelStorageInterface   ,
MAXON_REFERENCE_COPY_ON_WRITE   ,
"net.maxon.image.interface.imagepixelstorage"   
)
private

◆  Init()

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.
返回
OK on success.

◆  GetWidth()

MAXON_METHOD Int GetWidth ( ) const

Returns the width of the pixel storage.

◆  GetHeight()

MAXON_METHOD Int GetHeight ( ) const

Returns the height of the pixel storage.

◆  GetChannelCount()

MAXON_METHOD Int GetChannelCount ( ) const

Returns the total number of channels of the pixel storage.

◆  GetPixelFormat()

MAXON_METHOD PixelFormat GetPixelFormat ( ) const

Returns the pixel format connected to this pixel storage.

◆  GetPixelHandler()

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.
返回
A valid GetPixelHandlerStruct struct if successful.

◆  SetPixelHandler()

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.
返回
A valid SetPixelHandlerStruct struct if successful.

◆  GetComponent()

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.
返回
OK on success.

◆  SetComponent()

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.
返回
OK on success.