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

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

◆ Save()

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

◆ Edit()

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.

◆ GetMaxAlphas()

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.

◆ GetMaxResolution()

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.

◆ CorrectResolution()

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.

◆ Open()

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;
...
}
const char const char * name
Definition: abstract.h:195
Definition: c4d_basebitmap.h:428
Definition: c4d_basecontainer.h:47
Manages file and path names.
Definition: c4d_file.h:94
#define NewMemClear(T, cnt)
Definition: defaultallocator.h:204
maxon::Int32 Int32
Definition: ge_sys_math.h:60
IMAGERESULT
Definition: ge_prepass.h:3914
@ OUTOFMEMORY
Not enough memory.
SAVEBIT
Definition: ge_prepass.h:276
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

◆ Write()

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

◆ Close()

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.

◆ AddSound()

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