#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)> |
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 |
using BlendFunc = Delegate<Result<void>(const PixelMutableBuffer& result, const PixelConstBuffer& background, const PixelConstBuffer& foreground, Int pixelCnt, BLENDPIXELFLAGS flags)> |
using FreeFunc = Delegate<void(BlendPixelHandlerStruct& selfPtr)> |
Default Constructor. Initializes everything with nullptr.
BlendPixelHandlerStruct | ( | BlendPixelHandlerStruct && | other | ) |
Move Constructor.
BlendPixelHandlerStruct | ( | BLENDFUNC && | blendFunc, |
FREEFUNC && | freeFunc | ||
) |
Constructor to initialize the helper class.
[in] | blendFunc | Blend pixel function callback. |
[in] | freeFunc | Free pixel handler callback. |
Destructor.
MAXON_DISALLOW_COPY_AND_ASSIGN | ( | BlendPixelHandlerStruct | ) |
MAXON_OPERATOR_MOVE_ASSIGNMENT | ( | BlendPixelHandlerStruct | ) |
Bool IsValid | ( | ) | const |
Returns true if the structure is initialized correctly and a GetBlendPixelHandler is set.
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. |
|
private |
|
private |