|
3ds Max C++ API Reference
|
3ds Max can work in three different color management modes: More...
Classes | |
| class | ColorConverter< TSRC, TDST > |
| This is a fully header-implemented class wrapping IColorEngine for type-safe color conversions. More... | |
| class | IColorPipeline |
| Interface class that defines color conversions from source color space to target color space. More... | |
| class | IColorPipelineMgr |
| This is the central class for handling system-wide color management related data and tasks. More... | |
| class | ImageLayoutInfo |
| Helper template class for providing memory layout information for various pixel data types. More... | |
| class | QMaxSampleUnderlyingColorEvent |
| Qt event used by the color picker system to request sampling of an underlying color. More... | |
Enumerations | |
| enum | NotificationChangeMask : uint32_t { ModeChanged = 1 << 0 , GammaModeSettingsChanged = 1 << 1 , OCIOModeSettingsChanged = 1 << 2 , InputSettingsChanged = 1 << 3 , OutputSettingsChanged = 1 << 4 , RenderingSpaceChanged = 1 << 5 , DisplayViewChanged = 1 << 6 , ParameterSpaceChanged = 1 << 7 , ModeReInitialized = 1 << 8 , ModeLockStateChanged = 1 << 9 } |
| Change bit-mask that are passed with color management notification messages. More... | |
| enum class | ColorPipelineMode : uint8_t { kUNMANAGED , kGAMMA , kOCIO_DEFAULT , kOCIO_CUSTOM , kOCIO_ENVVAR , kNumColorPipelineModes } |
| Enum for color management modes. More... | |
| enum class | ModeStatus : uint8_t { kNORMAL , kFALLBACK_RAW , kINVALID } |
| Enum for color management modes. More... | |
| enum class | ConfigSource : uint8_t { kBUILT_IN , kENV_VARIABLE , kUSER_DEFINED } |
| Enum for source of the config file that's used in the mode. More... | |
| enum class | DisplayViewTarget : uint8_t { kGLOBAL , kVIEWPORT , kFRAME_BUFFER , kMTL_EDITOR , kCOLOR_PICKER , kCOLOR_SWATCH , kNumDisplayViewTargets } |
| Enum for identifying display/view pair targets. More... | |
| enum class | OutputFormatType : uint8_t { kGAMMA_ENCODED , kLINEAR , kNumOutputFormatTypes } |
| Enum for color management modes. More... | |
| enum class | OutputConversion : uint8_t { kNO_CONVERSION , kCOLOR_SPACE_CONVERSION , kDISPLAY_VIEWTRANSFORM } |
| Enum for Output Color conversion options. More... | |
| enum class | ColorSpaceFlags : uint32_t { kNONE = 0ul , kEXISTS = 1ul << 0 , kIS_DATA = 1ul << 1 , kHAS_FILETRANSFORM = 1ul << 2 , kIS_NAMEDTRANSFORM = 1ul << 3 } |
| Flags that provide some information on color spaces. More than one flags can be present. More... | |
| enum class | ListOptions : uint32_t { kNONE = 0ul , kUI_NAME = 1ul << 0 , kINCLUDE_ROLES = 1ul << 1 } |
| Flags that can be passed to functions operating on lists (such as GetNumFileIOColorSpaces() ) to control the list content. More... | |
| enum class | ColSpaceStatus { NotSet = 0 , Normal , ForcedDefault , Invalid } |
| Enum for color space assignment state. More... | |
| enum class | ColSpaceSource { NotSet = 0 , InputRules , User , SystemHeuristics } |
| Enum for indicating the source of the assigned color space. More... | |
3ds Max can work in three different color management modes:
OpenColorIO: There are two OCIO modes (ColorPipelineMode::kOCIO_DEFAULT and ColorPipelineMode::kOCIO_CUSTOM) which are the most powerful color management modes 3ds Max provides. In these modes the user can use textures and colors from different color spaces, can pick any linear color space (such as ACEScg) to perform renderings in, can work on monitors with different color gamuts and can save images in various color spaces with different view transforms applied. This mode uses OpenColorIO as the color management engine and the available color spaces, displays, transforms etc are defined in OCIO config files.
IColorPipelineMgr is the central hub for controlling and querying the active color management mode, available color spaces, displays, views and and accessing the other settings. IModeSettings class provides access to detailed settings of each mode. (see IColorPipelineMgr::Settings() )
If you need to convert colors from one color space to another, you'll need to create objects of class IColorPipeline. You can create IColorPipeline objects using various methods of the IColorPipelineMgr class. Although IColorPipeline defines the operations needed to transform colors, it can not do the computations by itself. The actual conversions are done by the ColorConverter class which is a template class and can perform operations in an optimized way for the specified input and output data types.
Here is an example showing how the classes relate to each other and how to use them in some simple scenarios.
| enum NotificationChangeMask : uint32_t |
Change bit-mask that are passed with color management notification messages.
This bit mask is passed in NotifyInfo::callParam with the NOTIFY_COLOR_MANAGEMENT_POST_CHANGE and NOTIFY_COLOR_MANAGEMENT_POST_CHANGE2 notification codes. In rare occasions it's possible to get those notifications with none of the bits set, this happens during the "load color
management settings" operation for example, where the loaded settings are the same as the previous ones.
| Enumerator | |
|---|---|
| ModeChanged | Color management mode has changed. |
| GammaModeSettingsChanged | Settings which are used in the ColorPipelineMode::kGAMMA mode have changed. |
| OCIOModeSettingsChanged | Settings which are used in the OCIO modes have changed. |
| InputSettingsChanged | Settings that affect the color management settings that are used in bitmap loading have changed. |
| OutputSettingsChanged | Settings that affect the color management settings that are used in bitmap saving have changed. |
| RenderingSpaceChanged | Rendering (working) color space has changed. |
| DisplayViewChanged | One or more of the display/view settings have changed. |
| ParameterSpaceChanged | The color space in which the color literals are stored has changed. |
| ModeReInitialized | Depending on the situation, re-initialization may change multiple things or may change nothing. Assume everything is changed. |
| ModeLockStateChanged | OCIO config path's lock state is changed in the ColorPipelineMode::kOCIO_CUSTOM mode. |
|
strong |
Enum for color management modes.
|
strong |
Enum for color space assignment state.
In a modern color management system, color holding entities (such as bitmaps) need to have valid color spaces assigned to them so that they can be converted to and from the working (rendering) color space. Unlike the floating point gamma value used in the simple de-gamma/re-gamma work flows, the assigned color space may not always be a valid value, therefore it's important to keep track of the assigned color space and validity of it all the time. This enum provides different states the color space assignment may be in.
| Enumerator | |
|---|---|
| NotSet | No color space is assigned yet. |
| Normal | A valid color space is assigned. Things are healthy. |
| ForcedDefault | System has force-assigned a color space probably because a previously assigned color space became unavailable. |
| Invalid | Assigned color space is invalid, things will not work properly.
|
|
strong |
Enum for color management modes.
|
strong |
Enum for source of the config file that's used in the mode.
|
strong |
Enum for identifying display/view pair targets.
|
strong |
Enum for color management modes.
| Enumerator | |
|---|---|
| kGAMMA_ENCODED | Image file formats that use gamma encoding (such as jpeg, png etc). |
| kLINEAR | Image file formats that use linear and log encoding (hdr, exr etc). |
| kNumOutputFormatTypes | |
|
strong |
Enum for Output Color conversion options.
|
strong |
Flags that provide some information on color spaces. More than one flags can be present.
|
strong |
Flags that can be passed to functions operating on lists (such as GetNumFileIOColorSpaces() ) to control the list content.
| Enumerator | |
|---|---|
| kNONE | |
| kUI_NAME | Instead of returning original names, return decorated UI names (which may not be valid names to pass to functions). |
| kINCLUDE_ROLES | Color space lists will include roles in them. |
|
strong |
Enum for indicating the source of the assigned color space.
In a modern color management system, color holding entities (such as bitmaps) need to have valid color spaces assigned to them so that they can be converted to and from the working (rendering) color space. This assignment can be done automatically based on the file name or type or can be done explicitly by the users. 3ds Max keeps track of the source of the color space assignment so that if for some reason color space becomes unavailable (see ColSpaceStatus), an informed decision can be made to re-assign one of the currently available color spaces. Knowing the source of the color space assignment will also make trouble shooting a color space related problems easier.
| Enumerator | |
|---|---|
| NotSet | No color space is assigned yet. |
| InputRules | Color space assigned automatically based on the file name (see GetColorSpaceFromImageFilePath). |
| User | User has assigned color space manually. |
| SystemHeuristics | System heuristics are used to assign most suitable color space. |