Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | List of all members
ColorIOConverter Class Reference

Public Types

enum  GlslVersion
 GLSL version used for generating the OCIO shader code.
 

Public Member Functions

 ColorIOConverter ()
 
 ~ColorIOConverter ()
 
bool configure (const CoreString &input_color_space, const CoreString &output_color_space)
 
bool configure_for_display (const CoreString &input_color_space, const CoreString &output_display, const CoreString &output_view)
 
bool configure_for_display (CoreBasicString input_color_space, CoreBasicString output_display_view)
 
bool configure_CDL (const CoreString &input_CDL, const CoreString &output_CDL)
 
bool is_configured () const
 
bool is_enabled () const
 
bool convert_buffers (float *r_buffer, float *g_buffer, float *b_buffer, float *a_buffer, unsigned int width, unsigned int height) const
 
bool convert_buffer (float *buffer, unsigned int width, unsigned int height, unsigned int channel_count) const
 
bool convert_pixel (GMathVec4f &pixel) const
 
bool get_gpu_shader_data (CoreString &shader_func_text, CoreArray< float > &lut_3d, GlslVersion glsl_version=GlslVersion::V_1_0) const
 
unsigned int get_lut_3d_edge_size () const
 
CoreString get_color_space (const CoreString &input_color_space) const
 
size_t get_memory_size () const
 

Constructor & Destructor Documentation

ColorIOConverter::ColorIOConverter ( )

Constructor.

ColorIOConverter::~ColorIOConverter ( )

Destructor.

Member Function Documentation

bool ColorIOConverter::configure ( const CoreString input_color_space,
const CoreString output_color_space 
)

Configure the converter to convert colors from input_color_space to output_color_space.

bool ColorIOConverter::configure_CDL ( const CoreString input_cdl,
const CoreString output_cdl 
)

Configure the converter to convert CDL from input_cdl to output_cdl.

bool ColorIOConverter::configure_for_display ( const CoreString input_color_space,
const CoreString output_display,
const CoreString output_view 
)

Configure the converter to convert colors from input_color_space to output_display and output_view.

bool ColorIOConverter::configure_for_display ( CoreBasicString  input_color_space,
CoreBasicString  output_display_view 
)

Configure the converter to convert colors from input_color_space to output_display_view.

bool ColorIOConverter::convert_buffer ( float *  buffer,
unsigned int  width,
unsigned int  height,
unsigned int  channel_count 
) const

Convert an packed color buffer (rgbargba...) in place, using the current conversion configuration.

Parameters
bufferA color buffer containing width x height x channel_count values.
widthBuffer width.
heightBuffer height.
channel_countBuffer channel count. Must be equal or greater than 3. 4th channel is assumed to be alpha. Additional channels are ignored.
Returns
True if conversion succeeded.
bool ColorIOConverter::convert_buffers ( float *  r_buffer,
float *  g_buffer,
float *  b_buffer,
float *  a_buffer,
unsigned int  width,
unsigned int  height 
) const

Convert separate RGBA buffers in place, using the current conversion configuration.

All buffers' size must be equal to width x height, except alpha which can be null.

Parameters
r_bufferRed buffer.
g_bufferGreen buffer.
b_bufferBlue buffer.
a_bufferAlpha buffer. Can be null.
widthBuffer width.
heightBuffer height
Returns
True if conversion succeeded.
bool ColorIOConverter::convert_pixel ( GMathVec4f &  pixel) const

Convert a pixel in place, using the current conversion configuration.

Parameters
pixelPixel to be converted, in place.
Returns
True if conversion succeeded.
bool ColorIOConverter::get_gpu_shader_data ( CoreString shader_source_code,
CoreArray< float > &  lut_3d,
GlslVersion  glsl_version = GlslVersion::V_1_0 
) const

Get the GPU shader source code for current configuration and for the given 3D LUT.

Parameters
shader_source_codeOutput GPU shader source code.
lut_3d3D LUT to use.
Returns
True on success.
unsigned int ColorIOConverter::get_lut_3d_edge_size ( ) const

Get the 3D LUT edge size.

Returns
Size of the 3D LUT edge.
size_t ColorIOConverter::get_memory_size ( ) const

Get the memory size of the converter instance.

bool ColorIOConverter::is_configured ( ) const

Query if the converter configuration is valid.

bool ColorIOConverter::is_enabled ( ) const

Query if the converter configuration is valid and if conversion is needed.

In other words, if this method returns true, the conversion can and must be applied. Otherwise, conversion isn't needed (input == output) or can't be applied (invalid configuration).

Returns
True if the configuration is valid and if conversion is needed.