GetPixelHandlerStruct Struct Reference

#include <gfx_image_pixelhandler.h>

详细描述

Helper class returned by GetPixelHandler. This class provides/caches a fast the access to pixels. A lambda contains the most efficient code to access the pixel data. This object is only valid as long as the bitmap properties (pixel format, pixel storage layout, width, height) wont change.

Public Types

using  GetFunc = Delegate < Result < void >(const ImagePos &pos, const PixelMutableBuffer &buffer, GETPIXELFLAGS flags)>
using  FreeFunc = Delegate < void( GetPixelHandlerStruct &selfPtr)>

公共成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( GetPixelHandlerStruct )
  GetPixelHandlerStruct ()
  GetPixelHandlerStruct ( GetPixelHandlerStruct &&other)
template<typename GETFUNC , typename FREEFUNC >
  GetPixelHandlerStruct (GETFUNC &&getFunc, FREEFUNC &&freeFunc, const ColorProfile &destinationProfile)
MAXON_ATTRIBUTE_FORCE_INLINE   ~GetPixelHandlerStruct ()
  MAXON_OPERATOR_MOVE_ASSIGNMENT ( GetPixelHandlerStruct )
Bool   IsValid () const
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  GetPixel (const ImagePos &pos, const PixelMutableBuffer &buffer, GETPIXELFLAGS flags) const
const ColorProfile GetTargetColorProfile ()

Private Attributes

GetFunc   _getFunc
FreeFunc   _freeFunc
ColorProfile   _targetColorProfile

Member Typedef Documentation

◆  GetFunc

using GetFunc = Delegate < Result <void>(const ImagePos &pos, const PixelMutableBuffer &buffer, GETPIXELFLAGS flags)>

◆  FreeFunc

using FreeFunc = Delegate <void( GetPixelHandlerStruct & selfPtr)>

构造函数 & 析构函数文档编制

◆  GetPixelHandlerStruct() [1/3]

GetPixelHandlerStruct ( )

Default Constructor. Initializes everything with nullptr.

◆  GetPixelHandlerStruct() [2/3]

GetPixelHandlerStruct ( GetPixelHandlerStruct &&  other )

Move Constructor.

◆  GetPixelHandlerStruct() [3/3]

GetPixelHandlerStruct ( GETFUNC &&  getFunc ,
FREEFUNC &&  freeFunc ,
const ColorProfile destinationProfile  
)

Constructor to initialize the helper class.

参数
[in] getFunc Get pixel function callback.
[in] freeFunc Free pixel handler callback.
[in] destinationProfile TODO: (Tilo) please document

◆  ~GetPixelHandlerStruct()

MAXON_ATTRIBUTE_FORCE_INLINE ~ GetPixelHandlerStruct ( )

Destructor.

成员函数文档编制

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( GetPixelHandlerStruct   )

◆  MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( GetPixelHandlerStruct   )

◆  IsValid()

Bool IsValid ( ) const

Returns true if the structure is initialized correctly and a GetPixelHandler is set.

◆  GetPixel()

MAXON_ATTRIBUTE_FORCE_INLINE Result <void> GetPixel ( const ImagePos pos ,
const PixelMutableBuffer buffer ,
GETPIXELFLAGS   flags  
) const

Copies/Read the pixel data from the source to the given buffer.

参数
[in] pos ImagePos of the pixel data to read from.
[in] buffer Destination of the pixel data.
[in] flags Control the operation with the flags.
返回
OK on success.

◆  GetTargetColorProfile()

const ColorProfile & GetTargetColorProfile ( )

Returns the color profile for the pixel data delivered by this handler. This function is important the pixelhandler was requested without the GETPIXELHANDLERFLAGS::FORCECOLORPROFILECONVERSION flag! In that case the pixel handler will not process color profile conversions if the color space matches between the internal and requested pixel format. This speeds up the conversion and allows to pass the profile to the gpu or to the exporter. (e.g. a bitmap with a sRGB color profile will return the original data if the pixel handler requests a linear rgb profile).

返回
The color profile in which the pixel data will be delivered. If GETPIXELHANDLERFLAGS::FORCECOLORPROFILECONVERSION was set on request of the pixel handler the color profile is the same as the requested profile. If GETPIXELHANDLERFLAGS::FORCECOLORPROFILECONVERSION was NOT set on request of the pixel handler the color profile might be different if the color space matched.

Member Data Documentation

◆  _getFunc

GetFunc _getFunc
private

◆  _freeFunc

FreeFunc _freeFunc
private

◆  _targetColorProfile

ColorProfile _targetColorProfile
private