SceneColorConverter Class Reference

#include <lib_scene_color_converter.h>

Detailed Description

Class to convert color spaces in and between scenes.

Note
Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Public Types

enum class  CONVERSION_FLAGS {
  NONE ,
  ADD_UNDO
}
 

Public Member Functions

enum SceneColorConverter::CONVERSION_FLAGS MAXON_ENUM_FLAGS_CLASS (CONVERSION_FLAGS)
 
maxon::Result< void > Init (BaseDocument *doc, const maxon::CString &inputColorSpaceLowName, const maxon::CString &inputColorSpaceHighName, const maxon::CString &renderColorSpaceName, CONVERSION_FLAGS flags=CONVERSION_FLAGS::ADD_UNDO)
 
maxon::Result< BoolConvertObject (BaseDocument *doc, BaseList2D *op, maxon::HashSet< BaseList2D * > &procesedObjects)
 
maxon::Result< BoolConvertObjects (BaseDocument *doc, maxon::Block< BaseList2D * > objects, maxon::HashSet< BaseList2D * > &procesedObjects)
 

Private Member Functions

 SceneColorConverter ()
 
 ~SceneColorConverter ()
 

Alloc/Free

static SceneColorConverterAlloc ()
 
static void Free (SceneColorConverter *&conv)
 

Member Enumeration Documentation

◆ CONVERSION_FLAGS

enum CONVERSION_FLAGS
strong

Conversion flags.

Enumerator
NONE 
ADD_UNDO 

Constructor & Destructor Documentation

◆ SceneColorConverter()

SceneColorConverter ( )
private

◆ ~SceneColorConverter()

~SceneColorConverter ( )
private

Member Function Documentation

◆ MAXON_ENUM_FLAGS_CLASS()

enum SceneColorConverter::CONVERSION_FLAGS MAXON_ENUM_FLAGS_CLASS ( CONVERSION_FLAGS  )

◆ Alloc()

static SceneColorConverter* Alloc ( )
static

Allocates a scene converter. Destroy the allocated scene converter with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Returns
The allocated scene converter, or nullptr if the allocation failed.

◆ Free()

static void Free ( SceneColorConverter *&  conv)
static

Destructs scene converter allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in,out]convThe scene converter to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ Init()

maxon::Result<void> Init ( BaseDocument doc,
const maxon::CString inputColorSpaceLowName,
const maxon::CString inputColorSpaceHighName,
const maxon::CString renderColorSpaceName,
CONVERSION_FLAGS  flags = CONVERSION_FLAGS::ADD_UNDO 
)

Initializes the color converter.

Parameters
[in]docThe document from which the color settings are taken.
[in]inputColorSpaceLowNameName of the new input color space.
[in]inputColorSpaceHighNameName of the new input color space.
[in]renderColorSpaceNameName of the new input color space.
[in]flagsConversion flags.

◆ ConvertObject()

maxon::Result<Bool> ConvertObject ( BaseDocument doc,
BaseList2D op,
maxon::HashSet< BaseList2D * > &  procesedObjects 
)

Converts the colors of a single object.

Parameters
[in]docThe document from which the color settings are taken. This must be the same that was used to initialize this class.
[in]opObject to convert.
[out]procesedObjectsA HashSet that will contain all the converted objects when the function returns.
Returns
true, if the object was converted, false otherwise.

◆ ConvertObjects()

maxon::Result<Bool> ConvertObjects ( BaseDocument doc,
maxon::Block< BaseList2D * >  objects,
maxon::HashSet< BaseList2D * > &  procesedObjects 
)

Converts the colors of multiple objects

Parameters
[in]docThe document from which the color settings are taken. This must be the same that was used to initialize this class.
[in]objectsObjects to convert.
[out]procesedObjectsA HashSet that will contain all the converted objects when the function returns.
Returns
true, if at least one object was converted, false otherwise.