-
首页
-
C4D R23.110 C++ SDK
MultipassBitmap Class Reference
#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:
-
Layer : A regular layer, with full range of functionality.
-
Folder : A collection of layers. This is a dummy element that has no image content, but other stuff like name, visibility etc.
-
Alpha : An alpha channel layer, with full range of functionality.
-
注意
-
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.
Additional Inherited Members
|
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
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()
成员函数文档编制
◆
Alloc()
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()
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()
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()
Gets the currently selected layer.
-
返回
-
The selected layer, or
nullptr
if the operation failed. The multipass bitmap owns the pointed layer.
◆
GetLayerNum()
Gets the layer at index
num
.
-
参数
-
-
返回
-
The retrieved layer, or
nullptr
if the operation failed. The multipass bitmap owns the pointed layer.
◆
GetAlphaLayerNum()
Gets the alpha layer at index
num
.
-
参数
-
-
返回
-
The retrieved alpha layer, or
nullptr
if the operation failed. The multipass bitmap owns the pointed alpha layer.
◆
GetHiddenLayerNum()
Gets the hidden layer at index
num
.
-
参数
-
-
返回
-
The retrieved hidden layer, or
nullptr
if the operation failed. The multipass bitmap owns the pointed alpha layer.
◆
AddLayer()
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()
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()
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()
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()
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]
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]
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()
Gets a layer parameter.
-
参数
-
[in]
|
id
|
The layer parameter ID:
MPBTYPE
|
-
返回
-
The retrieved layer parameter data.
◆
SetParameter()
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()
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()
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).
-
参数
-
◆
SetName()
Sets the name of the layer.
-
参数
-
◆
SetColorMode()
Sets the color mode for the layer.
-
参数
-
[in]
|
mode
|
The new color mode.
|
◆
SetDpi()
void SetDpi
|
(
|
Int32
|
dpi
|
)
|
|
Private
.
◆
SetTempColorProfile()
Private
.
◆
SetSave()
void SetSave
|
(
|
Bool
|
save
|
)
|
|
Private
.
◆
SetComponent()
void SetComponent
|
(
|
Int32
|
c
|
)
|
|
Private
.