BitmapLoaderData Class Reference

abstract

#include <c4d_filterdata.h>

Inheritance diagram for BitmapLoaderData:
Inheritance graph
[ legend ]

详细描述

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)
-  Public Member Functions inherited from BaseData
  BaseData ()
virtual  ~BaseData (void)
void  Destructor (void)

成员函数文档编制

◆  Identify()

virtual Bool Identify ( const Filename name ,
UChar probe ,
Int32   size  
)
pure virtual

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()

virtual IMAGERESULT Load ( const Filename name ,
BaseBitmap bm ,
Int32   frame  
)
pure virtual

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()

virtual Bool GetInformation ( const Filename name ,
Int32 frames ,
Float fps  
)
virtual

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()

virtual IMAGERESULT LoadAnimated ( BitmapLoaderAnimatedData bd ,
BITMAPLOADERACTION   action ,
BaseBitmap bm ,
Int32   frame  
)
virtual

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;
IMAGERESULT result = LoadAnimated (&data, BITMAPLOADERACTION::INIT , nullptr , 0); if (result== IMAGERESULT::OK ) err = LoadAnimated (&data, BITMAPLOADERACTION::LOAD , bm, frame); LoadAnimated (&data, BITMAPLOADERACTION::FREE , nullptr , 0); return err; }
参数
[in] bd The bitmap loader animated data. Cinema 4D owns the pointed data.
[in] action The bitmap loader action: BITMAPLOADERACTION
[out] bm To be filled with the frame bitmap in BITMAPLOADERACTION::LOAD action call. Cinema 4D owns the pointed bitmap.
[in] frame The frame to put into bitmap bm .
返回
The result of loading the animated file: IMAGERESULT

◆  ExtractSound()

virtual IMAGERESULT ExtractSound ( BitmapLoaderAnimatedData bd ,
BaseSound snd  
)
virtual

Called to extract the sound of animated bitmaps.

参数
[in] bd The bitmap loader animated data. Cinema 4D owns the pointed data.
[in] snd The extracted sound. Cinema 4D owns the pointed sound.
返回
The result of extracting the sound: IMAGERESULT

◆  HasSound()

virtual IMAGERESULT HasSound ( BitmapLoaderAnimatedData bd )
virtual

Called by the 图片查看器 to determine whether a movie has sound or not.

参数
[in] bd The bitmap loader animated data. Cinema 4D owns the pointed data.
返回
The result: IMAGERESULT
BitmapLoaderAnimatedData::moviename
Filename moviename
The file name of the movie.
定义: c4d_filterdata.h:50
IMAGERESULT::OK
@ OK
Image loaded/created.
BITMAPLOADERACTION::LOAD
@ LOAD
Load.
BITMAPLOADERACTION::FREE
@ FREE
Free.
Filename
Manages file and path names.
定义: c4d_file.h:93
BitmapLoaderAnimatedData
Data structure for loading a movie in a bitmap loader.
定义: c4d_filterdata.h:39
BITMAPLOADERACTION::INIT
@ INIT
Initialize.
Int32
maxon::Int32 Int32
定义: ge_sys_math.h:58
BaseBitmap
定义: c4d_basebitmap.h:410
IMAGERESULT
IMAGERESULT
定义: ge_prepass.h:3659
BitmapLoaderData::LoadAnimated
virtual IMAGERESULT LoadAnimated(BitmapLoaderAnimatedData *bd, BITMAPLOADERACTION action, BaseBitmap *bm, Int32 frame)