C++ API Reference: MColorMixingSpaceHelper Class Reference
Introduced in 2023.0
More...
#include <MColorMixingSpaceHelper.h>
Introduced in 2023.0
- 2023.0:
- Introduced in this version.
Helper class for implementing correct color pickers that use widgets such as sliders and color wheels to mix colors
Create an instance and set the mixing color space to transform a color or evaluate sliders.
- Note
- All methods return the input color or the appropriate linear slider values when Maya color management is disabled.
Color transform direction.
Enumerator |
---|
kForward |
apply the color transform
|
kInverse |
invert the color transform
|
Re-initializes the color mixing helper, for example after a configuration change.
- Returns
- Status code.
Returns the list of available mixing spaces for the current color management configuration.
- Parameters
-
[out] | returnedStatus | Status code |
- Returns
- List of avaialble mixing spaces
Sets the mixing space to be used by MColorPickerUtilities::applyMixingTransform() and the slider methods.
- Parameters
-
- Returns
- kSuccess if mixing space name is valid, otherwise kInvalidParameter
Returns the list of available views for the current color management configuration.
- Parameters
-
[out] | returnedStatus | Status code |
- Returns
- List of avaialble views
Sets the view to be used by MColorPickerUtilities::applyMixingTransform() and the slider methods.
- Parameters
-
- Returns
- kSuccess if view name is valid, otherwise kInvalidParameter
Applies the mixing transform to an input color.
The mixing space must have been previously set.
- Parameters
-
[in] | inputColor | The input color to transform |
[in] | direction | The direction of the transform, |
[out] | returnedStatus | Status code. |
- Returns
- Returns the transformed color, or the input color if color management is turned off
float mixingToSlider |
( |
float |
mixingPosition, |
|
|
float |
minPos, |
|
|
float |
maxPos |
|
) |
| const |
Converts a mixing space component value to its normalized color slider position.
- Parameters
-
[in] | mixingPosition | The mixing color value to convert |
[in] | minPos | Left edge mixing value for the slider |
[in] | maxPos | Right edge mixing value for the slider |
- Returns
- The slider position to display
float sliderToMixing |
( |
float |
sliderPosition, |
|
|
float |
minPos, |
|
|
float |
maxPos |
|
) |
| const |
Converts normalized slider position to mixing space value.
- Parameters
-
[in] | sliderPosition | The position of the slider within minPos and maxPos |
[in] | minPos | Left edge mixing value for the slider |
[in] | maxPos | Right edge mixing value for the slider |
- Returns
- The color component value for the given slider position
The documentation for this class was generated from the following files:
- MColorMixingSpaceHelper.h
- MColorMixingSpaceHelper.cpp