Render Class Reference

#include <c4d_tools.h>

Public Member Functions

Bool AllocateBuffer (Int32 id, Int32 subid, Int32 bitdepth, Bool visible)
 
Int32 AllocateBufferFX (Int32 id, const maxon::String &name, Int32 bitdepth, Bool visible)
 
VPBufferGetBuffer (Int32 id, Int32 subid) const
 
BaseContainer GetRenderData () const
 
BaseDrawGetBaseDraw () const
 
void SetRenderData (const BaseContainer &bc)
 
VolumeDataGetInitialVolumeData (Int32 cpu) const
 
Bool SetRenderProperty (Int32 id, const GeData &dat)
 
void IccConvert (void *data, Int32 xcnt, Int32 components, Bool inverse)
 

Private Member Functions

 Render ()
 
 ~Render ()
 

Constructor & Destructor Documentation

◆ Render()

Render ( )
private

◆ ~Render()

~Render ( )
private

Member Function Documentation

◆ AllocateBuffer()

Bool AllocateBuffer ( Int32  id,
Int32  subid,
Int32  bitdepth,
Bool  visible 
)

Allocates a videopost buffer.

Warning
Must be called only within VideoPostData::AllocateBuffers()
Parameters
[in]idThe type of buffer: VPBUFFER
[in]subidThe sub-ID for the buffer type, such as the VPBUFFER_OBJECTBUFFER Group ID. (See Rendering in the Cinema 4D manual.)
[in]bitdepthThe bit depth:
[in]visibletrue if the buffer shall be visible to the user in the Picture Viewer.
Returns
true if successful, otherwise false.

◆ AllocateBufferFX()

Int32 AllocateBufferFX ( Int32  id,
const maxon::String name,
Int32  bitdepth,
Bool  visible 
)

Allocates a special effect buffer of type id.
For example, PyroCluster does the following:

pfx_mulid = render->AllocateBufferFX(VPBUFFER_POSTEFFECT_MUL, GeLoadString(IDS_GLOW_NAME2), 8, true); // mul requested before normal buffer
pfx_id = render->AllocateBufferFX(VPBUFFER_POSTEFFECT, GeLoadString(IDS_GLOW_NAME), 8, true);
const String & GeLoadString(Int32 id)
#define VPBUFFER_POSTEFFECT
Post effect channel.
Definition: c4d_videopostdata.h:142
#define VPBUFFER_POSTEFFECT_MUL
Post effect (multiply) channel.
Definition: c4d_videopostdata.h:143
Warning
Must be called only within VideoPostData::AllocateBuffers()
Parameters
[in]idThe type of effect buffer: VPBUFFER_POSTEFFECT or VPBUFFER_POSTEFFECT_MUL.
[in]nameThe buffer name.
[in]bitdepthThe buffer bit depth.
[in]visibletrue if the buffer shall be visible to the user in the Picture Viewer.
Returns
The special effect buffer ID.
The ID returned needs to be passed later on to Render::GetBuffer(), which can return nullptr either if the buffer could not be allocated or if the user did not add the Post-effect Multipass.

◆ GetBuffer()

VPBuffer* GetBuffer ( Int32  id,
Int32  subid 
) const

Gets a videopost buffer.

Parameters
[in]idThe type of buffer: VPBUFFER
[in]subidThe sub-ID for the buffer.
Some buffers share the same ID (Object buffers for instance. Sub-IDs are used to discern between buffers then).
Returns
The videopost buffer. Cinema 4D owns the pointed videopost buffer.

◆ GetRenderData()

BaseContainer GetRenderData ( ) const

Gets the render data. This is a container with the same values as used in the RenderData class.

Note
Some flags are only set in this container, for example when rendering using the "Render Only Active Object" button.
Returns
The render settings.

◆ GetBaseDraw()

BaseDraw* GetBaseDraw ( ) const

Gets the BaseDraw associated with this rendering.

Returns
The class or nullptr in case of an error.

◆ SetRenderData()

void SetRenderData ( const BaseContainer bc)

Sets the render data.

Parameters
[in]bcThe render settings.

◆ GetInitialVolumeData()

VolumeData* GetInitialVolumeData ( Int32  cpu) const

Retrieves a VolumeData structure for every CPU processor. Needed when multiprocessing in a videopost plugin.

Warning
The returned volume data is only valid in VIDEOPOSTCALL::INNER.
Parameters
[in]cpuThe CPU index.
Returns
The volume data for processor cpu. Cinema 4D owns the pointed volume data.

◆ SetRenderProperty()

Bool SetRenderProperty ( Int32  id,
const GeData dat 
)

Sets render properties.

Parameters
[in]idThe property to set: RENDERPROPERTY
[in]datThe render property value.
Returns
true if successful, otherwise false.

◆ IccConvert()

void IccConvert ( void *  data,
Int32  xcnt,
Int32  components,
Bool  inverse 
)

Converts a number of pixels from render color space to output color space or the other way around.

Parameters
[out]dataThe pixel buffer. The caller owns the pointed buffer.
[in]xcntThe number of pixels.
[in]componentsThe number of pixel components (3 for RGB, 4 for RGBA, etc.)
[in]inversetrue for conversion from render to output color space, or false to convert from output to render color space.