Data Structures | Macros | Functions | Variables
Color Manager Nodes

Implementation of pluggable color manager nodes. More...

Data Structures

struct  AtColorManagerNodeMethods
 Color Manager Node methods structure. More...
 

Macros

#define AI_COLOR_MANAGER_NODE_EXPORT_METHODS(tag)
 Color manager node methods exporter. More...
 

Functions

 AtChannelLayout::AtChannelLayout (uint8_t ct, uint8_t t, size_t x, size_t y)
 

Variables

uint8_t AtChannelLayout::channel_type
 
uint8_t AtChannelLayout::type
 
size_t AtChannelLayout::x_stride
 
size_t AtChannelLayout::y_stride
 
bool(* AtColorManagerNodeMethods::ColorManagerTransform )(AtNode *, AtString, bool, bool, const AtBBox2 *, void *, const AtChannelLayout *, void *, const AtChannelLayout *)
 
void(* AtColorManagerNodeMethods::ColorManagerGetDefaults )(AtNode *, AtString &, AtString &)
 
bool(* AtColorManagerNodeMethods::ColorManagerGetChromaticities )(AtNode *, AtString, float *)
 
void(* AtColorManagerNodeMethods::ColorManagerGetCustomAttributes )(AtNode *, AtString, int &, const char **)
 
int(* AtColorManagerNodeMethods::ColorManagerGetNumColorSpaces )(AtNode *, AtString)
 
AtString(* AtColorManagerNodeMethods::ColorManagerGetColorSpaceNameByIndex )(AtNode *, int i, AtString)
 
int(* AtColorManagerNodeMethods::ColorManagerGetNumFamilies )(AtNode *)
 
AtString(* AtColorManagerNodeMethods::ColorManagerGetFamilyNameByIndex )(AtNode *, int)
 
bool(* AtColorManagerNodeMethods::ColorManagerColorSpaceIsLinear )(AtNode *, AtString)
 

Node Method Declarations

AI_API bool AiColorManagerTransform (AtNode *node, AtString name, bool is_output=true, bool dither=false, const AtBBox2 *roi=NULL, void *src=NULL, const AtChannelLayout *src_layout=NULL, void *dst=NULL, const AtChannelLayout *dst_layout=NULL)
 Transform to or from the specified color space. More...
 
AI_API void AiColorManagerGetDefaults (AtNode *node, AtString &sRGB, AtString &linear)
 Get the default linear color space used for rendering and for narrow image formats IO. More...
 
AI_API bool AiColorManagerGetChromaticities (AtNode *node, AtString space, float *chromaticities)
 Get the chromaticities for a color space. More...
 
AI_API void AiColorManagerGetCustomAttributes (AtNode *node, AtString space, int &num, const char **attributes)
 Get custom attributes to include in output file for the given color space, this includes ICC profile, etc... More...
 
AI_API int AiColorManagerGetNumColorSpaces (AtNode *node, AtString family=AtString())
 Get how many color spaces are available (for a "family" if specified) More...
 
AI_API AtString AiColorManagerGetColorSpaceNameByIndex (AtNode *node, int i, AtString family=AtString())
 Get the name of a color space by index (for a "family" if specified) More...
 
AI_API int AiColorManagerGetNumFamilies (AtNode *node)
 Get how many color space families are available. More...
 
AI_API AtString AiColorManagerGetFamilyNameByIndex (AtNode *node, int i)
 Get the name of a color space family by index. More...
 
AI_API bool AiColorManagerColorSpaceIsLinear (AtNode *node, AtString cs)
 Return if a given color space is linear according to the color manager. More...
 
#define color_manager_transform
 Color Manager's color_manager_transform method declaration. More...
 
#define color_manager_get_defaults   static void ColorManagerGetDefaults(AtNode* node, AtString &sRGB, AtString &linear)
 Color Manager's color_manager_get_defaults method declaration. More...
 
#define color_manager_get_chromaticities   static bool ColorManagerGetChromaticities(AtNode* node, AtString space, float *chromaticities)
 Color Manager's color_manager_get_chromaticities method declaration. More...
 
#define color_manager_get_custom_attributes   static void ColorManagerGetCustomAttributes(AtNode* node, AtString space, int &num, const char **attributes)
 Color Manager's color_manager_get_custom_attributes method declaration.
 
#define color_manager_get_num_color_spaces   static int ColorManagerGetNumColorSpaces(AtNode *node, AtString family)
 Color Manager's color_manager_get_num_color_spaces method declaration. More...
 
#define color_manager_get_color_space_name_by_index   static AtString ColorManagerGetColorSpaceNameByIndex(AtNode *node, int i, AtString family)
 Color Manager's color_manager_get_color_space_name_by_index method declaration. More...
 
#define color_manager_get_num_families
 Color Manager's color_manager_get_num_families method declaration. More...
 
#define color_manager_get_family_name_by_index
 Color Manager's color_manager_get_family_name_by_index method declaration. More...
 
#define color_manager_color_space_is_linear
 Color Manager's color_manager_color_space_is_linear method declaration. More...
 

Detailed Description

Implementation of pluggable color manager nodes.

Macro Definition Documentation

◆ AI_COLOR_MANAGER_NODE_EXPORT_METHODS

#define AI_COLOR_MANAGER_NODE_EXPORT_METHODS (   tag)
Value:
color_manager_get_defaults; \
color_manager_get_chromaticities; \
color_manager_get_custom_attributes; \
color_manager_get_num_color_spaces; \
color_manager_get_color_space_name_by_index; \
static AtColorManagerNodeMethods ai_color_manager_mtds = { \
ColorManagerTransform, \
ColorManagerGetDefaults, \
ColorManagerGetChromaticities, \
ColorManagerGetCustomAttributes, \
ColorManagerGetNumColorSpaces, \
ColorManagerGetColorSpaceNameByIndex, \
NULL, \
NULL, \
NULL, \
}; \
static AtNodeMethods ai_node_mtds = { \
&ai_common_mtds, \
&ai_color_manager_mtds \
}; \
const AtNodeMethods *tag = &ai_node_mtds;
#define color_manager_transform
Color Manager's color_manager_transform method declaration.
Definition: ai_color_managers.h:88
Color Manager Node methods structure.
Definition: ai_color_managers.h:35
Node methods.
Definition: ai_node_entry.h:86

Color manager node methods exporter.

◆ color_manager_transform

#define color_manager_transform
Value:
static bool ColorManagerTransform(AtNode* node, AtString color_space, \
bool is_output, bool dither, \
const AtBBox2* roi, \
void* src, const AtChannelLayout* src_layout, \
void* dst, const AtChannelLayout* dst_layout)
Arnold String allows for fast string comparisons.
Definition: ai_string.h:54
2D axis-aligned bounding box (uses integers)
Definition: ai_bbox.h:169
Definition: ai_color_managers.h:19
This represents a node in Arnold.

Color Manager's color_manager_transform method declaration.

Convert the specified count of RGB colors using the named color space for output or input.

Returns
true if the color manager was able to perform the operation

◆ color_manager_get_defaults

#define color_manager_get_defaults   static void ColorManagerGetDefaults(AtNode* node, AtString &sRGB, AtString &linear)

Color Manager's color_manager_get_defaults method declaration.

Optionally specify color spaces for 8 bit images (typically sRGB) and for the default linear color space

◆ color_manager_get_chromaticities

#define color_manager_get_chromaticities   static bool ColorManagerGetChromaticities(AtNode* node, AtString space, float *chromaticities)

Color Manager's color_manager_get_chromaticities method declaration.

Returns
true if the color space is linear

◆ color_manager_get_num_color_spaces

#define color_manager_get_num_color_spaces   static int ColorManagerGetNumColorSpaces(AtNode *node, AtString family)

Color Manager's color_manager_get_num_color_spaces method declaration.

Returns
number of color spaces available (for a given "family" if specified)

◆ color_manager_get_color_space_name_by_index

#define color_manager_get_color_space_name_by_index   static AtString ColorManagerGetColorSpaceNameByIndex(AtNode *node, int i, AtString family)

Color Manager's color_manager_get_color_space_name_by_index method declaration.

Returns
name of color space at the given index (for a given "family" if specified)

◆ color_manager_get_num_families

#define color_manager_get_num_families
Value:
static int ColorManagerGetNumFamilies(AtNode *node); \
AI_OPTIONAL_METHOD_INSTALL(ai_color_manager_mtds, ColorManagerGetNumFamilies) \
static int ColorManagerGetNumFamilies(AtNode *node)

Color Manager's color_manager_get_num_families method declaration.

Returns
number of available color space families

◆ color_manager_get_family_name_by_index

#define color_manager_get_family_name_by_index
Value:
static AtString ColorManagerGetFamilyNameByIndex(AtNode *node, int i); \
AI_OPTIONAL_METHOD_INSTALL(ai_color_manager_mtds, ColorManagerGetFamilyNameByIndex) \
static AtString ColorManagerGetFamilyNameByIndex(AtNode *node, int i)

Color Manager's color_manager_get_family_name_by_index method declaration.

Returns
name of color space family at the given index

◆ color_manager_color_space_is_linear

#define color_manager_color_space_is_linear
Value:
static bool ColorManagerColorSpaceIsLinear(AtNode *node, AtString cs); \
AI_OPTIONAL_METHOD_INSTALL(ai_color_manager_mtds, ColorManagerColorSpaceIsLinear) \
static bool ColorManagerColorSpaceIsLinear(AtNode *node, AtString cs)

Color Manager's color_manager_color_space_is_linear method declaration.

Returns
true if the color space is linear

Function Documentation

◆ AiColorManagerTransform()

AI_API bool AiColorManagerTransform ( AtNode node,
AtString  color_space,
bool  is_output,
bool  dither,
const AtBBox2 roi_,
void *  src_,
const AtChannelLayout src_layout_,
void *  dst_,
const AtChannelLayout dst_layout_ 
)

Transform to or from the specified color space.

The transformation will happen between color_space and the working linear color space. You can check if a color transform is available by omitting the values and count params.

Parameters
nodeThe color manager that will perform the transformation, typically the one specified in options->color_manager. If this is NULL, the default built-in color manager will be used, which only supports 'sRGB', 'Rec709' (both gamma) and 'linear'
color_spaceThe destination or source color space
is_outputIf true, RGB values will be converted TO color_space, otherwise they will be converted FROM color_space
ditherPerform dithering for 8 or 16 bit outputs.
roiRegion of Interest. By default only one RGB value will be transformed,
srcSource RGB buffer. If NULL the color manager will just check if the specified transform exists.
src_layoutDescription for input RGB buffer layout. If not specified, float RGB will be assumed.
dstDestination RGB buffer. If not specified transform will happen in place with the given src_layout.
dst_layoutDescription for output RGB buffer layout, if not specified src_layout will be used.
Returns
true for success, false for unknown transform or unsupported layout.

◆ AiColorManagerGetDefaults()

AI_API void AiColorManagerGetDefaults ( AtNode node,
AtString sRGB,
AtString linear 
)

Get the default linear color space used for rendering and for narrow image formats IO.

This returns the color manager's preferred color space for 8 or 16 bit formats, and the default linear color space.

Parameters
nodeThe color manager If this is NULL, the default built-in color manager will be used, which will use 'sRGB' and 'linear' spaces
[out]sRGBName for sRGB color space, used for 8-16 bit file output, typically sRGB
[out]linearName of linear rendering color space

◆ AiColorManagerGetChromaticities()

AI_API bool AiColorManagerGetChromaticities ( AtNode node,
AtString  color_space,
float *  chromaticities 
)

Get the chromaticities for a color space.

This returns the color manager's preferred color space for 8 or 16 bit formats, and the default linear color space.

Parameters
nodeThe color manager If this is NULL, the default built-in color manager will be used
color_spaceName of color space we are querying
[out]chromaticities8 float array for chromaticities and white point
Returns
true if chromaticities were available

◆ AiColorManagerGetCustomAttributes()

AI_API void AiColorManagerGetCustomAttributes ( AtNode node,
AtString  color_space,
int &  num,
const char **  attributes 
)

Get custom attributes to include in output file for the given color space, this includes ICC profile, etc...

Parameters
nodeThe color manager If this is NULL, the default built-in color manager will be used
color_spaceName of color space we are querying
[out]numNumber of custom attributes to output
[out]attributesArray of strings defining all custom attributes in OIIO format: "<type> <name> <value>"

◆ AiColorManagerGetNumColorSpaces()

AI_API int AiColorManagerGetNumColorSpaces ( AtNode node,
AtString  family 
)

Get how many color spaces are available (for a "family" if specified)

Parameters
nodeThe color manager If this is NULL, the default built-in color manager will be used
familyIf specified will only return the number of color spaces for that color space "family". The meaning of "family" is left to the color manager.
Returns
Number of available color spaces.

◆ AiColorManagerGetColorSpaceNameByIndex()

AI_API AtString AiColorManagerGetColorSpaceNameByIndex ( AtNode node,
int  i,
AtString  family 
)

Get the name of a color space by index (for a "family" if specified)

Parameters
nodeThe color manager If this is NULL, the default built-in color manager will be used
iIndex we are querying for
familyIf specified will return the color space at the given index for that "family". The meaning of "family" is left to the color manager.
Returns
Color Space Name.

◆ AiColorManagerGetNumFamilies()

AI_API int AiColorManagerGetNumFamilies ( AtNode node)

Get how many color space families are available.

Parameters
nodeThe color manager If this is NULL, the default built-in color manager will be used
Returns
Number of available color spaces families.

◆ AiColorManagerGetFamilyNameByIndex()

AI_API AtString AiColorManagerGetFamilyNameByIndex ( AtNode node,
int  i 
)

Get the name of a color space family by index.

Parameters
nodeThe color manager If this is NULL, the default built-in color manager will be used
iIndex we are querying for
Returns
Color Space Family Name.

◆ AiColorManagerColorSpaceIsLinear()

AI_API bool AiColorManagerColorSpaceIsLinear ( AtNode node,
AtString  cs 
)

Return if a given color space is linear according to the color manager.

Parameters
nodeThe color manager If this is NULL, the default built-in color manager will be used
csColor Space Name to check
Returns
true if the color space is known, valid and linear

© 2023 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com