#include <c4d_filterdata.h>
详细描述
A data class for creating bitmap loader plugins.
使用
RegisterBitmapLoaderPlugin()
to register a bitmap loader plugin.
公共成员函数
|
virtual
Bool
|
Identify
(const
Filename
&name,
UChar
*probe,
Int32
size)=0
|
virtual
IMAGERESULT
|
Load
(const
Filename
&name,
BaseBitmap
*bm,
Int32
frame)=0
|
virtual
Int32
|
GetSaver
(void)
|
virtual
Bool
|
GetInformation
(const
Filename
&name,
Int32
*frames,
Float
*fps)
|
virtual
IMAGERESULT
|
LoadAnimated
(
BitmapLoaderAnimatedData
*bd,
BITMAPLOADERACTION
action,
BaseBitmap
*bm,
Int32
frame)
|
virtual
IMAGERESULT
|
ExtractSound
(
BitmapLoaderAnimatedData
*bd,
BaseSound
*snd)
|
virtual
IMAGERESULT
|
HasSound
(
BitmapLoaderAnimatedData
*bd)
|
|
BaseData
()
|
virtual
|
~BaseData
(void)
|
void
|
Destructor
(void)
|
成员函数文档编制
◆
Identify()
Called to identify a file type as one that can be loaded using the bitmap loader.
If possible, the file should not be identified through its suffix, but through the
probe
data.
-
参数
-
[in]
|
name
|
The filename of the file.
|
[in]
|
probe
|
The start of a small chunk of data from the start of the file to identify the file type.
Cinema 4D
owns the pointed array.
|
[in]
|
size
|
The size of the
probe
chunk, usually
1024
bytes.
|
-
返回
-
true
if the bitmap loader recognizes the file type, otherwise
false
.
◆
Load()
Called to load an image file into a bitmap.
-
参数
-
[in]
|
name
|
The name of the file to load.
|
[in]
|
bm
|
The bitmap to load the image file into.
Cinema 4D
owns the pointed bitmap.
|
[in]
|
frame
|
The frame number for formats containing multiple images in a file such as
QuickTime
or
AVI
.
|
-
返回
-
The result of loading the file:
IMAGERESULT
◆
GetSaver()
virtual
Int32
GetSaver
|
(
|
void
|
|
)
|
|
|
virtual
|
Called to get the plugin ID of the corresponding
BitmapSaverData
, if there is one.
-
返回
-
The plugin ID of the corresponding bitmap saver, or
nullptr
if there is none.
◆
GetInformation()
Called to get information on the loading of movies.
-
参数
-
[in]
|
name
|
The name of the file to check.
|
[out]
|
frames
|
Set this to the number of frames.
|
[out]
|
fps
|
Set this to the number of frames-per-second.
|
-
返回
-
true
if the information could be retrieved, otherwise
false
.
◆
LoadAnimated()
Called to accelerate the loading of animated bitmaps.
-
注意
-
当
LoadAnimated()
is called with
BITMAPLOADERACTION::INIT
action
(
bm
is
nullptr
and
frame
is
0
) the loader can open the movie file
bd
->
moviename
and store data in the buffer field
bd
->
moviedata
[16]
.
For every call of
BITMAPLOADERACTION::INIT
, there is a
BITMAPLOADERACTION::FREE
(
bm
is
nullptr
and
frame
is 0) in which the image loader closes the movie file.
In between
BITMAPLOADERACTION::LOAD
is called with a valid
bm
and
frame
.
Loaders that overload
LoadAnimated
do not need to implement code twice,
Load
should in that case just look like this:
IMAGERESULT
MyLoader::Load(
const
Filename
&name,
BaseBitmap
*bm,
Int32
frame)
{
BitmapLoaderAnimatedData
data;
data.
moviename
= name;
Called to extract the sound of animated bitmaps.