BlendPixelHandlerStruct Struct Reference

#include <gfx_image_pixelblend.h>

Detailed Description

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)>
 

Public Member Functions

 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)>

Constructor & Destructor Documentation

◆ BlendPixelHandlerStruct() [1/3]

Default Constructor. Initializes everything with nullptr.

◆ BlendPixelHandlerStruct() [2/3]

Move Constructor.

◆ BlendPixelHandlerStruct() [3/3]

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

Constructor to initialize the helper class.

Parameters
[in]blendFuncBlend pixel function callback.
[in]freeFuncFree pixel handler callback.

◆ ~BlendPixelHandlerStruct()

Member Function Documentation

◆ 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.

Parameters
[in]backgroundBackground image data to process.
[in]foregroundForeground image data to process.
[in]pixelCntNumber of pixels to precess.
[in]flags(optional) flags for later extend.
Returns
OK on success.

Member Data Documentation

◆ _blendFunc

BlendFunc _blendFunc
private

◆ _freeFunc

FreeFunc _freeFunc
private