#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)> |
Public Member Functions | |
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 |
using SetFunc = Delegate<Result<void>(const ImagePos &pos, const PixelConstBuffer &buffer, SETPIXELFLAGS flags)> |
using FreeFunc = Delegate<void(SetPixelHandlerStruct& selfPtr)> |
Default Constructor. Initializes everything with nullptr.
SetPixelHandlerStruct | ( | SetPixelHandlerStruct && | other | ) |
Move Constructor.
SetPixelHandlerStruct | ( | SETFUNC && | setFunc, |
FREEFUNC && | freeFunc | ||
) |
Constructor to initialize the helper class.
[in] | setFunc | Set pixel function callback. |
[in] | freeFunc | Free pixel handler callback. |
Destructor.
MAXON_DISALLOW_COPY_AND_ASSIGN | ( | SetPixelHandlerStruct | ) |
Bool IsValid | ( | ) | const |
Returns true if the structure is initialized correctly and a SetPixelHandler is set.
MAXON_OPERATOR_MOVE_ASSIGNMENT | ( | SetPixelHandlerStruct | ) |
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. |
const Range<IntVector2d>& GetModifiedRegion | ( | ) | const |
Returns the modified region that was touched by all the SetPixel() calls of this handler.
|
private |
|
private |
|
mutableprivate |