ImageBaseInterface Class Reference Graphics

#include <gfx_image.h>

Inheritance diagram for ImageBaseInterface:

详细描述

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.

公共成员函数

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_OBSERVABLE (void, ObservableRegionChanged,(const ObserverObjectRef &owner, const UpdateRegion ®ion), ObservableCombinerRunAllComponent)

私有成员函数

  MAXON_INTERFACE ( ImageBaseInterface , MAXON_REFERENCE_NORMAL , "net.maxon.image.interface.imagebase")
-  Private Member Functions inherited from HierarchyObjectInterface< ImageHierarchy >
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 >  替换 (const typename HIERARCHY::template Sibling< Interface >::type &newObject)
MAXON_METHOD HierarchyObjectRef   移除 ()
MAXON_METHOD HIERARCHY::template Child< Interface >::type  RemoveChildren (const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD void  RemoveAllChildren ()
MAXON_METHOD Result < 数据 GetOwner () const
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 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_INTERFACE()

MAXON_INTERFACE ( ImageBaseInterface   ,
MAXON_REFERENCE_NORMAL   ,
"net.maxon.image.interface.imagebase"   
)
private

◆  InitBase()

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).
返回
OK on success.

◆  AddChildren()

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.
返回
OK on success.

◆  GetWidth()

MAXON_METHOD Int GetWidth ( ) const

Returns the width of the bitmap.

◆  GetHeight()

MAXON_METHOD Int GetHeight ( ) const

Returns the height of the bitmap.

◆  GetChannelCount()

MAXON_METHOD Int GetChannelCount ( ) const

Returns the channel count of the bitmap.

◆  GetPixelFormat()

MAXON_METHOD PixelFormat GetPixelFormat ( ) const

Returns the pixel format connected to this bitmap.

◆  GetPixelHandler()

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 可选 LayerSet or nullptr.
返回
A valid GetPixelHandlerStruct struct if successful.

◆  SetPixelHandler()

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.
返回
A valid SetPixelHandlerStruct struct if successful.

◆  GetComponent()

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.
返回
OK on success.

◆  SetComponent()

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.
返回
OK on success.

◆  CreateSubImagePart()

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.
返回
New Image as part of the given image.

◆  MAXON_OBSERVABLE()

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.