#include <gfx_image.h>
Base class of all image classes. E.g. ImageLayerInterface, ImageTextureInterface inherits all this functions. This base class is able to handle layers in hierarchical order.
Public Member Functions | |
MAXON_METHOD Result< void > | InitBase (Int width, Int height, const PixelFormat &pixelFormat, IMAGEPROPERTIES::ITYPE type) |
MAXON_METHOD Result< void > | AddChildren (IMAGEHIERARCHY hierarchy, const ImageBaseRef &newChildren, const ImageBaseRef &insertBefore) |
MAXON_METHOD Int | GetWidth () const |
MAXON_METHOD Int | GetHeight () const |
MAXON_METHOD Int | GetChannelCount () const |
MAXON_METHOD PixelFormat | GetPixelFormat () const |
MAXON_METHOD Result< GetPixelHandlerStruct > | GetPixelHandler (const PixelFormat &dstFormat, const ChannelOffsets &channelOffsets, const ColorProfile &dstColorProfile, GETPIXELHANDLERFLAGS flags, const LayerSetInterface *layerSet) const |
MAXON_METHOD Result< SetPixelHandlerStruct > | SetPixelHandler (const PixelFormat &srcFormat, const ChannelOffsets &channelOffsets, const ColorProfile &srcColorProfile, SETPIXELHANDLERFLAGS flags) |
MAXON_METHOD Result< void > | GetComponent (Int component, const ImagePos &pos, Pix *data, Int inc, GETPIXELFLAGS flags) const |
MAXON_METHOD Result< void > | SetComponent (Int component, const ImagePos &pos, const Pix *data, Int inc, SETPIXELFLAGS flags) |
MAXON_METHOD Result< ImageBaseRef > | CreateSubImagePart (const DrawRectInt &rect) const |
MAXON_METHOD Result< ImageBaseRef > | TransformColors (const ColorProfile &srcProfile, const ColorProfile &dstProfile, TRANSFORM_COLORS_FLAGS flags) |
MAXON_OBSERVABLE (void, ObservableRegionChanged,(const ObserverObjectRef &owner, const UpdateRegion ®ion), ObservableCombinerRunAllComponent) | |
Private Member Functions | |
MAXON_INTERFACE (ImageBaseInterface, MAXON_REFERENCE_NORMAL, "net.maxon.image.interface.imagebase", MAXON_IMPLEMENTATION_MODULE("net.maxon.image")) | |
![]() | |
MAXON_METHOD Result< void > | InsertBefore (const typename HIERARCHY::template Sibling< Interface >::type &nextSibling) |
MAXON_METHOD Result< void > | InsertAfter (const typename HIERARCHY::template Sibling< Interface >::type &prevSibling) |
MAXON_METHOD Result< void > | InsertAsFirstChildOf (const typename HIERARCHY::template Parent< Interface >::type &parent, const ConstDataPtr &branchId=ConstDataPtr()) |
MAXON_METHOD Result< void > | InsertAsLastChildOf (const typename HIERARCHY::template Parent< Interface >::type &parent, const ConstDataPtr &branchId=ConstDataPtr()) |
MAXON_METHOD Result< void > | InsertAsChildAt (const typename HIERARCHY::template Parent< Interface >::type &parent, Int position, const ConstDataPtr &branchId=ConstDataPtr()) |
MAXON_METHOD Result< void > | InsertChildAsFirst (const typename HIERARCHY::template Child< Interface >::type &child, const ConstDataPtr &branchId=ConstDataPtr()) |
MAXON_METHOD Result< void > | InsertChildAsLast (const typename HIERARCHY::template Child< Interface >::type &child, const ConstDataPtr &branchId=ConstDataPtr()) |
MAXON_METHOD Result< void > | InsertChildAt (const typename HIERARCHY::template Child< Interface >::type &child, Int position, const ConstDataPtr &branchId=ConstDataPtr()) |
MAXON_METHOD Result< void > | InsertChildrenAsFirst (const Block< const typename HIERARCHY::template Child< Interface >::type > &children, const ConstDataPtr &branchId=ConstDataPtr()) |
MAXON_METHOD Result< void > | InsertChildrenAsLast (const Block< const typename HIERARCHY::template Child< Interface >::type > &children, const ConstDataPtr &branchId=ConstDataPtr()) |
MAXON_METHOD Result< void > | InsertChildrenAt (const Block< const typename HIERARCHY::template Child< Interface >::type > &children, Int position, const ConstDataPtr &branchId=ConstDataPtr()) |
MAXON_METHOD Result< void > | Replace (const typename HIERARCHY::template Sibling< Interface >::type &newObject) |
MAXON_METHOD HierarchyObjectRef | Remove () |
MAXON_METHOD HIERARCHY::template Child< Interface >::type | RemoveChildren (const ConstDataPtr &branchId=ConstDataPtr()) |
MAXON_METHOD void | RemoveAllChildren () |
MAXON_METHOD HIERARCHY::template Child< Interface >::type | GetFirstChild (const ConstDataPtr &branchId=ConstDataPtr()) const |
MAXON_METHOD HIERARCHY::template Child< Interface >::type | GetLastChild (const ConstDataPtr &branchId=ConstDataPtr()) const |
MAXON_METHOD HIERARCHY::template Child< Interface >::type | GetChildAt (Int position, const ConstDataPtr &branchId=ConstDataPtr()) const |
MAXON_METHOD Result< BaseArray< typename HIERARCHY::template Child< Interface >::type > > | GetChildren (const ConstDataPtr &branchId=ConstDataPtr()) const |
MAXON_METHOD Result< BaseArray< ConstDataPtr > > | GetBranches () const |
MAXON_METHOD ConstDataPtr | GetBranchId () const |
MAXON_METHOD void | SetLocking (const Bool locking) |
MAXON_METHOD Bool | IsLocked () const |
MAXON_METHOD HIERARCHY::template Parent< Interface >::type | GetParent () const |
MAXON_METHOD std::add_pointer< HierarchyObjectInterface >::type | GetParentPtr () const |
MAXON_METHOD HIERARCHY::template Sibling< Interface >::type | GetNext () const |
MAXON_METHOD HIERARCHY::template Sibling< Interface >::type | GetPrev () const |
MAXON_METHOD HIERARCHY::template Sibling< Interface >::type | GetFirst () const |
MAXON_METHOD HIERARCHY::template Sibling< Interface >::type | GetLast () const |
MAXON_METHOD void | ParentChanged (Bool removed) |
MAXON_METHOD std::add_pointer< HierarchyObjectInterface >::type | FindNextLeaf (const HierarchyObjectInterface *stopAtParent) const |
MAXON_OBSERVABLE (Result< void >, ObservableHierarchyInsert,(const HierarchyObjectRef<> &sender, const HierarchyObjectRef<> &object, const ConstDataPtr &branchId), ObservableCombinerRunAllComponent) | |
MAXON_OBSERVABLE (Result< void >, ObservableHierarchyRemove,(const HierarchyObjectRef<> &sender, const HierarchyObjectRef<> &object, const ConstDataPtr &branchId), ObservableCombinerRunAllComponent) | |
MAXON_METHOD void | FlushBranches () |
|
private |
MAXON_METHOD Result<void> InitBase | ( | Int | width, |
Int | height, | ||
const PixelFormat & | pixelFormat, | ||
IMAGEPROPERTIES::ITYPE | type | ||
) |
Initializes the bitmap with a given size/height. The bitmap content is cleared with 0 bytes.
[in] | width | Image width. |
[in] | height | Image height. |
[in] | pixelFormat | Image PixelFormat. |
[in] | type | Image type set into IMAGEPROPERTIES::TYPE. You can query this with image.Get(IMAGEPROPERTIES::TYPE). |
MAXON_METHOD Result<void> AddChildren | ( | IMAGEHIERARCHY | hierarchy, |
const ImageBaseRef & | newChildren, | ||
const ImageBaseRef & | insertBefore | ||
) |
[in] | hierarchy | Defines the hierarchy to which the children belongs to. |
[in] | newChildren | New children to add under this object. |
[in] | insertBefore | Insert the children before this object. nullptr will append the object at the end. |
MAXON_METHOD Int GetWidth | ( | ) | const |
Returns the width of the bitmap.
MAXON_METHOD Int GetHeight | ( | ) | const |
Returns the height of the bitmap.
MAXON_METHOD Int GetChannelCount | ( | ) | const |
Returns the channel count of the bitmap.
MAXON_METHOD PixelFormat GetPixelFormat | ( | ) | const |
Returns the pixel format connected to this bitmap.
MAXON_METHOD Result<GetPixelHandlerStruct> GetPixelHandler | ( | const PixelFormat & | dstFormat, |
const ChannelOffsets & | channelOffsets, | ||
const ColorProfile & | dstColorProfile, | ||
GETPIXELHANDLERFLAGS | flags, | ||
const LayerSetInterface * | layerSet | ||
) | const |
To access pixel data a GetPixelHandlerStruct is needed. This optimizes the access to the pixel data see GetPixelHandlerStruct.
[in] | dstFormat | Destination pixel format that should be read with this pixel handler. |
[in] | channelOffsets | Destination channel offsets in bits. |
[in] | dstColorProfile | Optional parameter which is only necessary if the color spaces of the given pixel formats doesn't match. In that case the conversion will be performed using the correct color conversion. |
[in] | flags | Flags for the GetPixel operation. |
[in] | layerSet | Optional LayerSet or nullptr. |
MAXON_METHOD Result<SetPixelHandlerStruct> SetPixelHandler | ( | const PixelFormat & | srcFormat, |
const ChannelOffsets & | channelOffsets, | ||
const ColorProfile & | srcColorProfile, | ||
SETPIXELHANDLERFLAGS | flags | ||
) |
To access pixel data a SetPixelHandlerStruct is needed. This optimizes the access to the pixel data see SetPixelHandlerStruct.
[in] | srcFormat | Source pixel format that should be written with this pixel handler. |
[in] | channelOffsets | Source channel offsets in bits. |
[in] | srcColorProfile | Optional parameter which is only necessary if the color spaces of the given pixel formats doesn't match. In that case the conversion will be performed using the correct color conversion. |
[in] | flags | Flags for the SetPixel operation. |
MAXON_METHOD Result<void> GetComponent | ( | Int | component, |
const ImagePos & | pos, | ||
Pix * | data, | ||
Int | inc, | ||
GETPIXELFLAGS | flags | ||
) | const |
Access single components of the image.
[in] | component | Index of the component. |
[in] | pos | ImagePos of the data to read. |
[in] | data | Destination buffer. |
[in] | inc | Distance between 2 pixels in the destination buffer. |
[in] | flags | Flags to control the read operation. |
MAXON_METHOD Result<void> SetComponent | ( | Int | component, |
const ImagePos & | pos, | ||
const Pix * | data, | ||
Int | inc, | ||
SETPIXELFLAGS | flags | ||
) |
Access single components of the image.
[in] | component | Index of the component. |
[in] | pos | ImagePos of the data to write. |
[in] | data | Source buffer. |
[in] | inc | Distance between 2 pixels in the source buffer. |
[in] | flags | Flags to control the write operation. |
MAXON_METHOD Result<ImageBaseRef> CreateSubImagePart | ( | const DrawRectInt & | rect | ) | const |
Create a new ImageBaseRef as a sub image of the given image with the given rectangle. The image will not be copied! It generates only a reference to the original image with the rectangle set to the portion of the image.
[in] | rect | Part of the image. |
MAXON_METHOD Result<ImageBaseRef> TransformColors | ( | const ColorProfile & | srcProfile, |
const ColorProfile & | dstProfile, | ||
TRANSFORM_COLORS_FLAGS | flags | ||
) |
Transforms the colors of an image. It either creates a new image or
[in] | srcProfile | Source profile. If this is empty, the image profile will be used. |
[in] | dstProfile | Destination profile. Must not be empty. |
[in] | flags | Flags. |
MAXON_OBSERVABLE | ( | void | , |
ObservableRegionChanged | , | ||
(const ObserverObjectRef &owner, const UpdateRegion ®ion) | , | ||
ObservableCombinerRunAllComponent | |||
) |
Observable: This observable is fired as soon as anybody modifies the pixel data of this object.