BitmapSaverData Class Reference

#include <c4d_filterdata.h>

Inheritance diagram for BitmapSaverData:

Detailed Description

A data class for creating bitmap saver plugins.
Use RegisterBitmapSaverPlugin() to register a bitmap saver plugin.

Public Member Functions

virtual IMAGERESULT Save (const Filename &name, BaseBitmap *bm, BaseContainer *data, SAVEBIT savebits)
 
virtual Bool Edit (BaseContainer *data)
 
virtual Int32 GetMaxAlphas (BaseContainer *data)
 
virtual Int32 GetMaxResolution (Bool layers)
 
virtual void CorrectResolution (const BaseContainer *settings, Int32 videoWidth, Int32 videoHeight, Int32 &videoWidthPadded, Int32 &videoHeightPadded)
 
- Public Member Functions inherited from BaseData
 BaseData ()
 
virtual ~BaseData (void)
 
void Destructor (void)
 

Movie Saver

virtual IMAGERESULT Open (PluginMovieData *&md, const Filename &name, BaseBitmap *bm, BaseContainer *data, SAVEBIT savebits, Int32 fps)
 
virtual IMAGERESULT Write (PluginMovieData *md, BaseBitmap *bm)
 
virtual IMAGERESULT Close (PluginMovieData *&md)
 
virtual IMAGERESULT AddSound (PluginMovieData *md, BaseSound *snd)
 

Member Function Documentation

virtual IMAGERESULT Save ( const Filename name,
BaseBitmap bm,
BaseContainer data,
SAVEBIT  savebits 
)
virtual

Called to save a bitmap to a file.

Parameters
[in]nameThe name of the file to save.
[in]bmThe bitmap to save the image from. Cinema 4D owns the pointed bitmap.
[in]dataThe settings container for the bitmap saver. These are stored with the general preferences. Cinema 4D owns the pointed container.
[in]savebitsThe save bits flags: SAVEBIT
Returns
The result of saving the file: IMAGERESULT
virtual Bool Edit ( BaseContainer data)
virtual

Called to open the settings dialog for the bitmap loader/saver.

Parameters
[in]dataThe settings container for the bitmap saver. These are stored with the general preferences. Cinema 4D owns the pointed container.
Returns
true if the settings dialog opened successfully, otherwise false.
virtual Int32 GetMaxAlphas ( BaseContainer data)
virtual

Called to get the maximum number of alpha channels this format supports with the current settings.

Parameters
[in]dataThe settings container for the bitmap saver. These are stored with the general preferences. Cinema 4D owns the pointed container.
Returns
The number of alpha channels.
virtual Int32 GetMaxResolution ( Bool  layers)
virtual

Called to get the maximum resolution of the image format.

Parameters
[in]layerstrue if layers are to be saved, otherwise false.
Returns
The maximum resolution supported by the image format.
virtual void CorrectResolution ( const BaseContainer settings,
Int32  videoWidth,
Int32  videoHeight,
Int32 videoWidthPadded,
Int32 videoHeightPadded 
)
virtual

Corrects the given input size to the preferred saver size.

Since
R19
Parameters
[in]settingsOptional settings to use.
[in]videoWidthResolution width to check.
[in]videoHeightResolution height to check.
[out]videoWidthPaddedCorrected resolution width.
[out]videoHeightPaddedCorrected resolution height.
virtual IMAGERESULT Open ( PluginMovieData *&  md,
const Filename name,
BaseBitmap bm,
BaseContainer data,
SAVEBIT  savebits,
Int32  fps 
)
virtual

Called to open a movie for saving.
Here is some code from QuickTime saver:

IMAGERESULT QTMovieSaver::Open(PluginMovieData *&md, const Filename &name, BaseBitmap *bm, BaseContainer *data, SAVEBIT savebits, Int32 fps)
{
md = nullptr;
MacMovie* sa = nullptr;
sa = (MacMovie*)NewMemClear(sizeof(MacMovie));
if (!sa)
md = (PluginMovieData*)sa;
...
}
Parameters
[in,out]mdAn opaque pointer that can be used by the bitmap saver to store data in (by casting it to the dummy type PluginMovieData).
[in]nameThe name of the file to load.
[in]bmA typical frame of the movie, used for dimensions.
[in]dataThe settings container for the bitmap saver. These are stored with the general preferences. Cinema 4D owns the pointed container.
[in]savebitsThe save bits flags: SAVEBIT
[in]fpsThe frames per second.
Returns
The result of opening a movie: IMAGERESULT
virtual IMAGERESULT Write ( PluginMovieData *  md,
BaseBitmap bm 
)
virtual

Called to write a frame to a movie.

Parameters
[in]mdAn opaque pointer that can be set in Open and used here.
[in]bmThe bitmap frame to save to the movie. Cinema 4D owns the pointed bitmap.
Returns
The result of writing a frame to a movie: IMAGERESULT
virtual IMAGERESULT Close ( PluginMovieData *&  md)
virtual

Called to close a movie opened with Open.

Parameters
[in]mdThe opaque pointer that can be set in Open and that should be freed and set to nullptr.
Returns
The result: IMAGERESULT
Changed in R19. Previously returned void.
virtual IMAGERESULT AddSound ( PluginMovieData *  md,
BaseSound snd 
)
virtual

Adds sound to a movie.

Parameters
[in]mdAn opaque pointer that can be set in Open and used here.
[in]sndThe sound to add. Cinema 4D owns the pointed sound.
Returns
The result: IMAGERESULT