SetPixelHandlerStruct Struct Reference

#include <gfx_image_pixelhandler.h>

详细描述

Helper class returned by SetPixelHandler. 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. The SetPixelHandlerStruct must be accessed only from once thread. If you want to sett pixel in a multi threaded way you need to get a SetPixelHandlerStruct for each thread.

Public Types

using  SetFunc = Delegate < Result < void >(const ImagePos &pos, const PixelConstBuffer &buffer, SETPIXELFLAGS flags)>
using  FreeFunc = Delegate < void( SetPixelHandlerStruct &selfPtr)>

公共成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( SetPixelHandlerStruct )
  SetPixelHandlerStruct ()
  SetPixelHandlerStruct ( SetPixelHandlerStruct &&other)
Bool   IsValid () const
template<typename SETFUNC , typename FREEFUNC >
  SetPixelHandlerStruct (SETFUNC &&setFunc, FREEFUNC &&freeFunc)
MAXON_ATTRIBUTE_FORCE_INLINE   ~SetPixelHandlerStruct ()
  MAXON_OPERATOR_MOVE_ASSIGNMENT ( SetPixelHandlerStruct )
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  SetPixel (const ImagePos &pos, const PixelConstBuffer &buffer, SETPIXELFLAGS flags) const
const Range < IntVector2d > &  GetModifiedRegion () const

Private Attributes

SetFunc   _setFunc
FreeFunc   _freeFunc
Range < IntVector2d _region

Member Typedef Documentation

◆  SetFunc

using SetFunc = Delegate < Result <void>(const ImagePos &pos, const PixelConstBuffer &buffer, SETPIXELFLAGS flags)>

◆  FreeFunc

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

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

◆  SetPixelHandlerStruct() [1/3]

SetPixelHandlerStruct ( )

Default Constructor. Initializes everything with nullptr.

◆  SetPixelHandlerStruct() [2/3]

SetPixelHandlerStruct ( SetPixelHandlerStruct &&  other )

Move Constructor.

◆  SetPixelHandlerStruct() [3/3]

SetPixelHandlerStruct ( SETFUNC &&  setFunc ,
FREEFUNC &&  freeFunc  
)

Constructor to initialize the helper class.

参数
[in] setFunc Set pixel function callback.
[in] freeFunc Free pixel handler callback.

◆  ~SetPixelHandlerStruct()

MAXON_ATTRIBUTE_FORCE_INLINE ~ SetPixelHandlerStruct ( )

Destructor.

成员函数文档编制

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( SetPixelHandlerStruct   )

◆  IsValid()

Bool IsValid ( ) const

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

◆  MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( SetPixelHandlerStruct   )

◆  SetPixel()

MAXON_ATTRIBUTE_FORCE_INLINE Result <void> SetPixel ( const ImagePos pos ,
const PixelConstBuffer buffer ,
SETPIXELFLAGS   flags  
) const

Copies/Writes the pixel data from the buffer to the bitmap.

参数
[in] pos ImagePos of the pixel data to write into the bitmap.
[in] buffer Destination of the pixel data.
[in] flags Control the operation with the flags.
返回
True if the operation operates successful.

◆  GetModifiedRegion()

const Range < IntVector2d >& GetModifiedRegion ( ) const

Returns the modified region that was touched by all the SetPixel() calls of this handler.

Member Data Documentation

◆  _setFunc

SetFunc _setFunc
private

◆  _freeFunc

FreeFunc _freeFunc
private

◆  _region

Range < IntVector2d > _region
mutable private