#include <c4d_basebitmap.h>
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:
Private Member Functions | |
MultipassBitmap () | |
~MultipassBitmap () | |
Alloc/Free | |
static MultipassBitmap * | Alloc (Int32 bx, Int32 by, COLORMODE mode) |
static MultipassBitmap * | AllocWrapper (BaseBitmap *bmp) |
static void | Free (MultipassBitmap *&bm) |
Layers | |
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/Set Layers Parameter | |
GeData | GetParameter (MPBTYPE id) const |
Bool | SetParameter (MPBTYPE id, const GeData &par) |
Miscellaneous | |
void | ClearImageData () |
MultipassBitmap * | FindUserID (Int32 id, Int32 subid=0) |
PaintBitmap * | GetPaintBitmap () |
Int32 | GetUserID () 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) |
|
private |
|
private |
|
static |
Allocates a multipass bitmap of size [bx,by] and bit depth given by mode. The first RGBA layer is also created.
Use Free() to deallocate the bitmap.
[in] | bx | The width in pixels. |
[in] | by | The height in pixels. |
[in] | mode | The color mode: COLORMODE |
|
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. |
|
static |
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.
Int32 GetAlphaLayerCount | ( | ) | const |
Gets the number of alpha layers in the multipass bitmap.
Int32 GetHiddenLayerCount | ( | ) | const |
Gets the number of hidden layers in the multipass bitmap.
MultipassBitmap* GetSelectedLayer | ( | ) |
Gets the currently selected layer.
MultipassBitmap* GetLayerNum | ( | Int32 | num | ) |
Gets the layer at index num.
[in] | num | The layer index: 0 <= num < GetLayerCount(). |
MultipassBitmap* GetAlphaLayerNum | ( | Int32 | num | ) |
Gets the alpha layer at index num.
[in] | num | The alpha layer index: 0 <= num < GetAlphaLayerCount(). |
MultipassBitmap* GetHiddenLayerNum | ( | Int32 | num | ) |
Gets the hidden layer at index num.
[in] | num | The hidden layer index: 0 <= num < GetHiddenLayerCount(). |
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 | If true the layer is hidden. |
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 | If true the layer is hidden. |
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 |
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. |
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. |
void FreeHiddenLayers | ( | ) |
Free the hidden layers.
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 |
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 |
Gets a layer parameter.
[in] | id | The layer parameter ID: MPBTYPE |
Sets a layer parameter.
[in] | id | The layer parameter ID: MPBTYPE |
[in] | par | The new parameter data. |
void ClearImageData | ( | ) |
Clears the image data for all layers. The layers themselves are not removed or deleted.
MultipassBitmap* FindUserID | ( | Int32 | id, |
Int32 | subid = 0 |
||
) |
Finds a layer in the bitmap with its id.
[in] | id | The main layer ID. |
[in] | subid | The sub layer ID. |
PaintBitmap* GetPaintBitmap | ( | ) |
Gets a BodyPaint 3D paint bitmap for the multipass bitmap.
Int32 GetUserID | ( | ) | const |
Gets the user ID for the layer. In the renderer this is VPBUFFER_XXX.
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. |
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. |
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 parameter. |
void SetName | ( | const maxon::String & | name | ) |
Sets the name of the layer.
[in] | name | The new name. |
void SetColorMode | ( | COLORMODE | mode | ) |
Sets the color mode for the layer.
[in] | mode | The new color mode. |
void SetDpi | ( | Int32 | dpi | ) |
Private.
Bool SetTempColorProfile | ( | const ColorProfile * | profile, |
Bool | dithering | ||
) |
Private.
void SetSave | ( | Bool | save | ) |
Private.
void SetComponent | ( | Int32 | c | ) |
Private.