BlendPixelHandlerStruct Struct Reference Graphics

#include <gfx_image_pixelblend.h>

详细描述

Helper class returned by GetBlendPixelHandler. This class provides/caches a fast the access to blend 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  BlendFunc = Delegate < Result < void >(const PixelMutableBuffer &result, const PixelConstBuffer &background, const PixelConstBuffer &foreground, Int pixelCnt, BLENDPIXELFLAGS flags)>
using  FreeFunc = Delegate < void( BlendPixelHandlerStruct &selfPtr)>

公共成员函数

  MAXON_DISALLOW_COPY_AND_ASSIGN ( BlendPixelHandlerStruct )
  BlendPixelHandlerStruct ()
  BlendPixelHandlerStruct ( BlendPixelHandlerStruct &&other)
template<typename BLENDFUNC , typename FREEFUNC >
  BlendPixelHandlerStruct (BLENDFUNC &&blendFunc, FREEFUNC &&freeFunc)
MAXON_ATTRIBUTE_FORCE_INLINE   ~BlendPixelHandlerStruct ()
  MAXON_OPERATOR_MOVE_ASSIGNMENT ( BlendPixelHandlerStruct )
Bool   IsValid () const
MAXON_ATTRIBUTE_FORCE_INLINE Result < void >  BlendPixel (const PixelMutableBuffer &result, const PixelConstBuffer &background, const PixelConstBuffer &foreground, Int pixelCnt, BLENDPIXELFLAGS flags) const

Private Attributes

BlendFunc   _blendFunc
FreeFunc   _freeFunc

Member Typedef Documentation

◆  BlendFunc

using BlendFunc = Delegate < Result <void>(const PixelMutableBuffer & result, const PixelConstBuffer & background, const PixelConstBuffer & foreground, Int pixelCnt, BLENDPIXELFLAGS flags)>

◆  FreeFunc

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

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

◆  BlendPixelHandlerStruct() [1/3]

BlendPixelHandlerStruct ( )

Default Constructor. Initializes everything with nullptr.

◆  BlendPixelHandlerStruct() [2/3]

BlendPixelHandlerStruct ( BlendPixelHandlerStruct &&  other )

Move Constructor.

◆  BlendPixelHandlerStruct() [3/3]

BlendPixelHandlerStruct ( BLENDFUNC &&  blendFunc ,
FREEFUNC &&  freeFunc  
)

Constructor to initialize the helper class.

参数
[in] blendFunc Blend pixel function callback.
[in] freeFunc Free pixel handler callback.

◆  ~BlendPixelHandlerStruct()

MAXON_ATTRIBUTE_FORCE_INLINE ~ BlendPixelHandlerStruct ( )

Destructor.

成员函数文档编制

◆  MAXON_DISALLOW_COPY_AND_ASSIGN()

MAXON_DISALLOW_COPY_AND_ASSIGN ( BlendPixelHandlerStruct   )

◆  MAXON_OPERATOR_MOVE_ASSIGNMENT()

MAXON_OPERATOR_MOVE_ASSIGNMENT ( BlendPixelHandlerStruct   )

◆  IsValid()

Bool IsValid ( ) const

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

◆  BlendPixel()

MAXON_ATTRIBUTE_FORCE_INLINE Result <void> BlendPixel ( const PixelMutableBuffer result ,
const PixelConstBuffer background ,
const PixelConstBuffer foreground ,
Int   pixelCnt ,
BLENDPIXELFLAGS   flags  
) const

Blends the pixel data between background and foreground. The result will end up in background.

参数
[in] background Background image data to process.
[in] foreground Foreground image data to process.
[in] pixelCnt Number of pixels to precess.
[in] flags (optional) flags for later extend.
返回
OK on success.

Member Data Documentation

◆  _blendFunc

BlendFunc _blendFunc
private

◆  _freeFunc

FreeFunc _freeFunc
private