MultipassBitmap Class Reference

#include <c4d_basebitmap.h>

Inheritance diagram for MultipassBitmap:

详细描述

This is an extension of the BaseBitmap class that supports higher bit depths, floating point images and multiple layers.
The layers are stored hierarchically. There are three kinds of layers:

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.
This represents internally the same class as VPBuffer , so a VPBuffer can be cast to a MultipassBitmap and vice versa.

私有成员函数

  MultipassBitmap ()
  ~MultipassBitmap ()

Alloc/Free

static MultipassBitmap Alloc ( Int32 bx, Int32 by, COLORMODE mode)
static MultipassBitmap AllocWrapper ( BaseBitmap *bmp)
static void  Free ( MultipassBitmap *&bm)

Int32   GetLayerCount () const
Int32   GetAlphaLayerCount () const
Int32   GetHiddenLayerCount () const
MultipassBitmap GetSelectedLayer ()
MultipassBitmap GetLayerNum ( Int32 num)
MultipassBitmap GetAlphaLayerNum ( Int32 num)
MultipassBitmap GetHiddenLayerNum ( Int32 num)
MultipassBitmap AddLayer ( MultipassBitmap *insertafter, COLORMODE colormode, Bool hidden=false)
MultipassBitmap AddFolder ( MultipassBitmap *insertafter, Bool hidden=false)
MultipassBitmap AddAlpha ( MultipassBitmap *insertafter, COLORMODE colormode)
Bool   DeleteLayer ( MultipassBitmap *&layer)
void  SetMasterAlpha ( BaseBitmap *master)
void  FreeHiddenLayers ()

Get Layers

Bool   GetLayers ( maxon::BaseArray < BaseBitmap * > &list, MPB_GETLAYERS flags= MPB_GETLAYERS::IMAGE | MPB_GETLAYERS::ALPHA )
Bool   GetLayers ( maxon::BaseArray < MultipassBitmap * > &list, MPB_GETLAYERS flags= MPB_GETLAYERS::IMAGE | MPB_GETLAYERS::ALPHA )

Get/Set Layers Parameter

GeData   GetParameter ( MPBTYPE id) const
Bool   SetParameter ( MPBTYPE id, const GeData &par)

杂项

void  ClearImageData (void)
MultipassBitmap FindUserID ( Int32 id, Int32 subid=0)
PaintBitmap GetPaintBitmap ()
Int32   GetUserID (void) const
void  SetUserID ( Int32 id)
void  SetUserSubID ( Int32 subid)
void  SetBlendMode ( Int32 mode)
void  SetName (const maxon::String &name)
void  SetColorMode ( COLORMODE mode)
void  SetDpi ( Int32 dpi)
Bool   SetTempColorProfile (const ColorProfile *profile, Bool dithering)
void  SetSave ( Bool save)
void  SetComponent ( Int32 c)

Additional Inherited Members

-  Public Member Functions inherited from BaseBitmap
IMAGERESULT   Init (const Filename &name, Int32 frame=-1, Bool *ismovie=nullptr)
IMAGERESULT   Init ( Int32 x, Int32 y, Int32 depth=24, INITBITMAPFLAGS flags= INITBITMAPFLAGS::NONE )
void  FlushAll (void)
IMAGERESULT   Save (const Filename &name, Int32 format, BaseContainer *data, SAVEBIT savebits) const
BaseBitmap GetClone (void) const
BaseBitmap GetClonePart ( Int32 x, Int32 y, Int32 w, Int32 h) const
Bool   CopyTo ( BaseBitmap *dst) const
Bool   CopyPartTo ( BaseBitmap *dst, Int32 x, Int32 y, Int32 w, Int32 h) const
Int32   GetBw (void) const
Int32   GetBh (void) const
Int32   GetBt (void) const
Int32   GetBpz (void) const
COLORMODE   GetColorMode (void) const
void  ScaleIt ( BaseBitmap *dst, Int32 intens, Bool sample, Bool nprop) const
void  ScaleBicubic ( BaseBitmap *dst, Int32 src_xmin, Int32 src_ymin, Int32 src_xmax, Int32 src_ymax, Int32 dst_xmin, Int32 dst_ymin, Int32 dst_xmax, Int32 dst_ymax) const
void  SetPen ( Int32 r, Int32 g, Int32 b)
void  清零 ( Int32 r, Int32 g, Int32 b)
void  清零 ( Int32 x1, Int32 y1, Int32 x2, Int32 y2, Int32 r, Int32 g, Int32 b)
void  Line ( Int32 x1, Int32 y1, Int32 x2, Int32 y2)
void  Arc ( Int32 x, Int32 y, Float radius, Float angle_start, Float angle_end, Int32 subdiv=32)
void  GetPixel ( Int32 x, Int32 y, UInt16 *r, UInt16 *g, UInt16 *b) const
Vector32   GetPixelDirect ( Int32 x, Int32 y) const
Bool   SetPixel ( Int32 x, Int32 y, Int32 r, Int32 g, Int32 b)
void  GetAlphaPixel ( BaseBitmap *channel, Int32 x, Int32 y, UInt16 *val) const
Bool   SetAlphaPixel ( BaseBitmap *channel, Int32 x, Int32 y, Int32 val)
void  GetPixelCnt ( Int32 x, Int32 y, Int32 cnt, UChar *buffer, Int32 inc, COLORMODE dstmode, PIXELCNT flags, ColorProfileConvert *conversion=nullptr) const
Bool   SetPixelCnt ( Int32 x, Int32 y, Int32 cnt, UChar *buffer, Int32 inc, COLORMODE srcmode, PIXELCNT flags)
BaseBitmap AddChannel ( Bool internal, Bool straight)
void  RemoveChannel ( BaseBitmap *channel)
const BaseBitmap GetInternalChannel (void) const
BaseBitmap GetInternalChannel (void)
Int32   GetChannelCount (void) const
const BaseBitmap GetChannelNum ( Int32 num) const
BaseBitmap GetChannelNum ( Int32 num)
GeData   GetData ( Int32 id, const GeData &t_default) const
Bool   SetData ( Int32 id, const GeData &data)
UInt32   GetDirty () const
void  SetDirty ()
const BaseBitmap GetUpdateRegionBitmap () const
BaseBitmap GetUpdateRegionBitmap ()
void  GetUpdateRegion ( Int32 &xMin, Int32 &xMax, Int32 &yMin, Int32 &yMax, Bool reset)
Bool   SetColorProfile (const ColorProfile *profile)
const ColorProfile GetColorProfile () const
Int   GetMemoryInfo (void) const
Bool   IsMultipassBitmap (void) const
void  SetCMAP ( Int32 i, Int32 r, Int32 g, Int32 b)
Bool   GetImageRef ( SAVEBIT saveBit, Bool alpha, maxon::ImageRef &imageRef) const
-  Static Public Member Functions inherited from BaseBitmap
static BaseBitmap Alloc (void)
static void  Free ( BaseBitmap *&bm)
static IMAGERESULT   Init ( BaseBitmap *&res, const Filename &name, Int32 frame=-1, Bool *ismovie=nullptr, BitmapLoaderPlugin **loaderplugin=nullptr, const maxon::Delegate < void( Float progress)> &progressCallback=nullptr)

构造函数 & 析构函数文档编制

◆  MultipassBitmap()

MultipassBitmap () private

◆  ~MultipassBitmap()

~ MultipassBitmap () private

成员函数文档编制

◆  Alloc()

static MultipassBitmap * Alloc ( Int32   bx ,
Int32   by ,
COLORMODE   mode  
)
static

Allocates a multipass bitmap of size [ bx , by ] and bit depth given by mode . The first RGBA layer is also created.
使用 Free() to deallocate the bitmap.

参数
[in] bx The width in pixels.
[in] by The height in pixels.
[in] mode The color mode: COLORMODE
返回
The allocated multipass bitmap, or nullptr if the allocation failed.

◆  AllocWrapper()

static MultipassBitmap * AllocWrapper ( BaseBitmap bmp )
static

Allocates a multipass wrapper for bmp .
The wrapped bitmap has to stay alive and not be freed until after the allocated wrapper has been freed.
The returned multipass wrapper can be modified freely.

参数
[in] bmp The bitmap to wrap. The caller owns the pointed bitmap.
返回
The allocated wrapper bitmap, or nullptr if the allocation failed.

◆  Free()

static void Free ( MultipassBitmap *&  bm )
static

Destructs multipass bitmaps allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in] bm The multipass bitmap to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  GetLayerCount()

Int32 GetLayerCount ( ) const

Gets the number of layers in the bitmap. This is the sum of the number of layers, folders and alphas that are direct children of the multipass bitmap.

返回
The layer count.

◆  GetAlphaLayerCount()

Int32 GetAlphaLayerCount ( ) const

Gets the number of alpha layers in the multipass bitmap.

返回
The alpha layer count.

◆  GetHiddenLayerCount()

Int32 GetHiddenLayerCount ( ) const

Gets the number of hidden layers in the multipass bitmap.

返回
The hidden layer count.

◆  GetSelectedLayer()

MultipassBitmap * GetSelectedLayer ( )

Gets the currently selected layer.

返回
The selected layer, or nullptr if the operation failed. The multipass bitmap owns the pointed layer.

◆  GetLayerNum()

MultipassBitmap * GetLayerNum ( Int32   num )

Gets the layer at index num .

参数
[in] num The layer index: 0 <= num < GetLayerCount() .
返回
The retrieved layer, or nullptr if the operation failed. The multipass bitmap owns the pointed layer.

◆  GetAlphaLayerNum()

MultipassBitmap * GetAlphaLayerNum ( Int32   num )

Gets the alpha layer at index num .

参数
[in] num The alpha layer index: 0 <= num < GetAlphaLayerCount() .
返回
The retrieved alpha layer, or nullptr if the operation failed. The multipass bitmap owns the pointed alpha layer.

◆  GetHiddenLayerNum()

MultipassBitmap * GetHiddenLayerNum ( Int32   num )

Gets the hidden layer at index num .

参数
[in] num The hidden layer index: 0 <= num < GetHiddenLayerCount() .
返回
The retrieved hidden layer, or nullptr if the operation failed. The multipass bitmap owns the pointed alpha layer.

◆  AddLayer()

MultipassBitmap * AddLayer ( MultipassBitmap insertafter ,
COLORMODE   colormode ,
Bool   hidden = false  
)

Adds a layer with mode colormode after insertafter in the multipass bitmap.

参数
[in] insertafter The layer to insert after. Pass nullptr to insert first or BMP_INSERTLAST to insert last.
[in] colormode The color mode of the new layer: COLORMODE
[in] hidden true the layer is hidden.
返回
The added layer, or nullptr if the operation failed. The multipass bitmap owns the pointed layer.

◆  AddFolder()

MultipassBitmap * AddFolder ( MultipassBitmap insertafter ,
Bool   hidden = false  
)

Adds a folder after insertafter in the bitmap.

参数
[in] insertafter The layer to insert after. Pass nullptr to insert first or BMP_INSERTLAST to insert last.
[in] hidden true the layer is hidden.
返回
The added folder, or nullptr if the operation failed. The multipass bitmap owns the pointed folder.

◆  AddAlpha()

MultipassBitmap * AddAlpha ( MultipassBitmap insertafter ,
COLORMODE   colormode  
)

Adds an alpha layer with mode colormode after insertafter in the bitmap.

参数
[in] insertafter The layer to insert after. Pass nullptr to insert first or BMP_INSERTLAST to insert last.
[in] colormode The color mode of the new alpha layer: COLORMODE
返回
The added alpha layer, or nullptr if the operation failed. The multipass bitmap owns the pointed alpha layer.

◆  DeleteLayer()

Bool DeleteLayer ( MultipassBitmap *&  layer )

Deletes layer from the bitmap, freeing its memory.

参数
[in] layer The layer to delete. The pointer will be set to nullptr if the operation is successful, since the layer does not exist afterwards.
返回
true if layer was successfully deleted, otherwise false .

◆  SetMasterAlpha()

void SetMasterAlpha ( BaseBitmap master )

Sets the master alpha layer. This just stores the pointer, it does not add a new layer.

参数
[in] master The new master alpha layer.

◆  FreeHiddenLayers()

void FreeHiddenLayers ( )

Free the hidden layers.

◆  GetLayers() [1/2]

Bool GetLayers ( maxon::BaseArray < BaseBitmap * > &  list ,
MPB_GETLAYERS   flags = MPB_GETLAYERS::IMAGE|MPB_GETLAYERS::ALPHA  
)

Fills the passed array with all the layers specified by flags .

参数
[in] list The array filled with the layers as BaseBitmap*.
[in] flags The flags: MPB_GETLAYERS
返回
true if the layers could be obtained, otherwise false .

◆  GetLayers() [2/2]

Bool GetLayers ( maxon::BaseArray < MultipassBitmap * > &  list ,
MPB_GETLAYERS   flags = MPB_GETLAYERS::IMAGE|MPB_GETLAYERS::ALPHA  
)

Fills the passed array with all the layers specified by flags .

参数
[in] list The array filled with the layers as MultipassBitmap*.
[in] flags The flags: MPB_GETLAYERS
返回
true if the layers could be obtained, otherwise false .

◆  GetParameter()

GeData GetParameter ( MPBTYPE   id ) const

Gets a layer parameter.

参数
[in] id The layer parameter ID: MPBTYPE
返回
The retrieved layer parameter data.

◆  SetParameter()

Bool SetParameter ( MPBTYPE   id ,
const GeData par  
)

Sets a layer parameter.

参数
[in] id The layer parameter ID: MPBTYPE
[in] par The new parameter data.
返回
true if the layer parameter was successfully set, otherwise false .

◆  ClearImageData()

void ClearImageData ( void  )

Clears the image data for all layers. The layers themselves are not removed or deleted.

◆  FindUserID()

MultipassBitmap * FindUserID ( Int32   id ,
Int32   subid = 0  
)

Finds a layer in the bitmap with its id .

参数
[in] id The main layer ID.
另请参阅
MPBTYPE::USERID .
参数
[in] subid The sub layer ID.
另请参阅
MPBTYPE::USERID .
返回
The found layer, or nullptr if the operation failed. The multipass bitmap owns the pointed layer.

◆  GetPaintBitmap()

PaintBitmap * GetPaintBitmap ( )

Gets a BodyPaint 3D paint bitmap for the multipass bitmap.

返回
The paint bitmap.

◆  GetUserID()

Int32 GetUserID ( void  ) const

Gets the user ID for the layer. In the renderer this is VPBUFFER_XXX .

返回
The user ID for the layer.

◆  SetUserID()

void SetUserID ( Int32   id )

Sets the user ID for the layer. In the renderer this is VPBUFFER_XXX .

参数
[in] id The new user ID for the layer.

◆  SetUserSubID()

void SetUserSubID ( Int32   subid )

Sets the user sub-id for the layer. In the renderer this is used for blend channels for instance.

参数
[in] subid The new user sub-ID for the layer.

◆  SetBlendMode()

void SetBlendMode ( Int32   mode )

Adjusts the blend mode of a layer. This also shows up in the description UI of a layer ( ID_PAINTLAYER_BLEND parameter).

参数
[in] mode The values are declared in bplayer.h under the ID_PAINTLAYER_BLEND 参数。

◆  SetName()

void SetName ( const maxon::String name )

Sets the name of the layer.

参数
[in] name The new name.

◆  SetColorMode()

void SetColorMode ( COLORMODE   mode )

Sets the color mode for the layer.

参数
[in] mode The new color mode.

◆  SetDpi()

void SetDpi ( Int32   dpi )

Private .

◆  SetTempColorProfile()

Bool SetTempColorProfile ( const ColorProfile profile ,
Bool   dithering  
)

Private .

◆  SetSave()

void SetSave ( Bool   save )

Private .

◆  SetComponent()

void SetComponent ( Int32   c )

Private .