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)
 

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...
 
#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...
 

Detailed Description

Implementation of pluggable color manager nodes.

Macro Definition Documentation

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

Color manager node methods exporter.

#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)
This represents a node in Arnold.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
2D axis-aligned bounding box (uses integers)
Definition: ai_bbox.h:177
Definition: ai_color_managers.h:19

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
#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

#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
#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)
#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)
#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)
This represents a node in Arnold.

Color Manager's color_manager_get_num_families method declaration.

Returns
number of available color space families
#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)
This represents a node in Arnold.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46

Color Manager's color_manager_get_family_name_by_index method declaration.

Returns
name of color space family at the given index

Function Documentation

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.
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
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
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>"
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.
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.
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.
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.

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