RenderMan API
23.0
|
#include "RixShadingUtils.h"
Go to the source code of this file.
Macros | |
#define | F_LOGDOTFIVE (-0.30102999566f) |
#define | F_INVLOGDOTFIVE (-3.32192809489f) |
#define | IFLOOR(x) (((x) < 0.0f && (x) != (int)(x)) ? (int)x - 1 : (int)x) |
Enumerations | |
enum | RixColorSpace { k_sRGB = 0, k_Rec709, k_Rec2020, k_DCI_P3, k_Alexa_wide, k_ACEScg, k_CinemaGamut, k_NTSC, k_numColorSpaces } |
Functions | |
PRMAN_INLINE void | RixHsvToRgb (RtColorRGB const &hsv, RtColorRGB &rgb) |
PRMAN_INLINE void | RixRgbToHsv (RtColorRGB const &rgb, RtColorRGB &hsv) |
PRMAN_INLINE float | rixValue (float n1, float n2, float hue) |
PRMAN_INLINE void | RixHslToRgb (RtColorRGB const &hsl, RtColorRGB &rgb) |
PRMAN_INLINE void | RixRgbToHsl (RtColorRGB const &rgb, RtColorRGB &hsl) |
PRMAN_INLINE void | RixXyzToRgb (RtColorRGB const &xyz, RtColorRGB &rgb, RixColorSpace cs=k_sRGB) |
PRMAN_INLINE void | RixRgbToXyz (RtColorRGB const &rgb, RtColorRGB &xyz, RixColorSpace cs=k_sRGB) |
PRMAN_INLINE RtFloat | RixInputRange (const RtFloat &f, const RtFloat &min, const RtFloat &max) |
Remap [min, max] to [0.0 to 1.0]. More... | |
PRMAN_INLINE RtColorRGB | RixInputRange (const RtColorRGB &rgb, const RtFloat &min, const RtFloat &max) |
Remap [min, max] to [0.0 to 1.0]. More... | |
template<typename T > | |
PRMAN_INLINE RtColorRGB | RixInputRange (const RtColorRGB &rgb, const T &min, const T &max) |
Remap [min, max] to [0.0 to 1.0]. More... | |
PRMAN_INLINE RtFloat | RixOutputRange (const RtFloat &f, const RtFloat &min, const RtFloat &max) |
Remap a float from [0.0, 1.0] to [min, max]. More... | |
PRMAN_INLINE RtColorRGB | RixOutputRange (const RtColorRGB &rgb, const RtFloat &min, const RtFloat &max) |
Remap a color from [0.0, 1.0] to [min, max]. More... | |
template<typename T > | |
PRMAN_INLINE RtColorRGB | RixOutputRange (const RtColorRGB &rgb, const T &min, const T &max) |
Remap a color from [0.0, 1.0] to [min, max]. More... | |
PRMAN_INLINE RtFloat | RixExposure (RtFloat const &f, RtFloat const &e) |
Float exposure function. More... | |
PRMAN_INLINE RtColorRGB | RixExposure (const RtColorRGB &rgb, const RtFloat &e) |
Color exposure function. More... | |
template<typename T > | |
PRMAN_INLINE RtColorRGB | RixExposure (const RtColorRGB &rgb, const T &e) |
Color exposure function. More... | |
PRMAN_INLINE RtFloat | RixGamma (const RtFloat &f, const RtFloat &g) |
Float gamma correction. More... | |
PRMAN_INLINE RtColorRGB | RixGamma (const RtColorRGB &rgb, const RtFloat &g) |
Color gamma correction. More... | |
template<typename T > | |
PRMAN_INLINE RtColorRGB | RixGamma (const RtColorRGB &rgb, const T &g) |
Color gamma correction. More... | |
PRMAN_INLINE RtFloat | RixContrast (RtFloat f, RtFloat contrast, RtFloat pivot) |
Contrast float function. More... | |
template<typename T > | |
PRMAN_INLINE RtColorRGB | RixContrast (const RtColorRGB &rgb, const T &contrast, const T &pivot) |
Color contrast function. More... | |
PRMAN_INLINE RtColorRGB | RixHsvCorrect (const RtColorRGB &rgb, const RtFloat &hue, const RtFloat &sat, const RtFloat &val) |
HSV color correction. More... | |
template<typename T > | |
PRMAN_INLINE RtColorRGB | RixHsvCorrect (const RtColorRGB &rgb, const T &hsv) |
HSV color correction. Hue, saturation and value are packed in a RtFloat3 container. More... | |
template<typename T > | |
PRMAN_INLINE RtColorRGB | RixHslCorrect (const RtColorRGB &rgb, const T &hsl) |
HSL color correction. More... | |
template<typename T > | |
PRMAN_INLINE RtColorRGB | RixColorClamp (const RtColorRGB &rgb, const T &min, const T &max) |
Clamp color : this an extensions of RixClamp. More... | |
PRMAN_INLINE RtColorRGB | RixSaturation (const RtColorRGB &rgb, const float saturation) |
Return the saturation-adjusted color. More... | |
PRMAN_INLINE void | RixSaturation (RtColorRGB &rgb, const float saturation) |
Adjust the color saturation of the passed color. More... | |
#define F_INVLOGDOTFIVE (-3.32192809489f) |
Definition at line 44 of file RixColorUtils.h.
#define F_LOGDOTFIVE (-0.30102999566f) |
Definition at line 43 of file RixColorUtils.h.
#define IFLOOR | ( | x | ) | (((x) < 0.0f && (x) != (int)(x)) ? (int)x - 1 : (int)x) |
Definition at line 159 of file RixColorUtils.h.
enum RixColorSpace |
Enumerator | |
---|---|
k_sRGB | |
k_Rec709 | |
k_Rec2020 | |
k_DCI_P3 | |
k_Alexa_wide | |
k_ACEScg | |
k_CinemaGamut | |
k_NTSC | |
k_numColorSpaces |
Definition at line 46 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixColorClamp | ( | const RtColorRGB & | rgb, |
const T & | min, | ||
const T & | max | ||
) |
Clamp color : this an extensions of RixClamp.
[in] | rgb | The rgb input |
[in] | min | The minimum color |
[in] | max | The maximum color |
T | Any RtFloat3 container |
Definition at line 813 of file RixColorUtils.h.
PRMAN_INLINE RtFloat RixContrast | ( | RtFloat | f, |
RtFloat | contrast, | ||
RtFloat | pivot | ||
) |
Contrast float function.
[in] | f | input float value |
[in] | contrast | The amount of contrast, from -1 to 1. 0 is neutral. |
[in] | pivot | The pivot value of the contrast curve. |
Definition at line 683 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixContrast | ( | const RtColorRGB & | rgb, |
const T & | contrast, | ||
const T & | pivot | ||
) |
Color contrast function.
[in] | rgb | The rgb input |
[in] | contrast | The contrast value between -1 and +1 |
[in] | pivot | The pivot of the contrast curve. |
T | Any RtFloat3 container. |
Definition at line 722 of file RixColorUtils.h.
PRMAN_INLINE RtFloat RixExposure | ( | RtFloat const & | f, |
RtFloat const & | e | ||
) |
Float exposure function.
f | float input value |
e | exposure value. |
Definition at line 564 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixExposure | ( | const RtColorRGB & | rgb, |
const RtFloat & | e | ||
) |
Color exposure function.
[in] | rgb | The rgb input |
[in] | e | The float exposure value |
Definition at line 580 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixExposure | ( | const RtColorRGB & | rgb, |
const T & | e | ||
) |
Color exposure function.
[in] | rgb | The rgb input |
[in] | e | The T exposure value |
T | Any RtFloat3 container |
Definition at line 605 of file RixColorUtils.h.
PRMAN_INLINE RtFloat RixGamma | ( | const RtFloat & | f, |
const RtFloat & | g | ||
) |
Float gamma correction.
[in] | f | The float input value |
[in] | g | The float gamma value |
Definition at line 623 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixGamma | ( | const RtColorRGB & | rgb, |
const RtFloat & | g | ||
) |
Color gamma correction.
[in] | rgb | The rgb input |
[in] | g | The float gamma value |
Definition at line 639 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixGamma | ( | const RtColorRGB & | rgb, |
const T & | g | ||
) |
Color gamma correction.
[in] | rgb | The rgb input |
[in] | g | The T gamma value |
T | Any RtFloat3 container |
Definition at line 664 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixHslCorrect | ( | const RtColorRGB & | rgb, |
const T & | hsl | ||
) |
HSL color correction.
[in] | rgb | The rgb input |
[in] | hsl | The hsl values. |
T | Any RtFloat3 container |
Definition at line 789 of file RixColorUtils.h.
PRMAN_INLINE void RixHslToRgb | ( | RtColorRGB const & | hsl, |
RtColorRGB & | rgb | ||
) |
Definition at line 335 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixHsvCorrect | ( | const RtColorRGB & | rgb, |
const RtFloat & | hue, | ||
const RtFloat & | sat, | ||
const RtFloat & | val | ||
) |
HSV color correction.
[in] | rgb | The rgb input |
[in] | hue | The hue offset |
[in] | sat | The saturation multiplier |
[in] | val | The value multiplier |
Definition at line 741 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixHsvCorrect | ( | const RtColorRGB & | rgb, |
const T & | hsv | ||
) |
HSV color correction. Hue, saturation and value are packed in a RtFloat3 container.
[in] | rgb | The rgb input |
[in] | hsv | The hsv values in a RtFloat3 container. |
T | Can be any RtFloat3 container. |
Definition at line 766 of file RixColorUtils.h.
PRMAN_INLINE void RixHsvToRgb | ( | RtColorRGB const & | hsv, |
RtColorRGB & | rgb | ||
) |
Definition at line 162 of file RixColorUtils.h.
PRMAN_INLINE RtFloat RixInputRange | ( | const RtFloat & | f, |
const RtFloat & | min, | ||
const RtFloat & | max | ||
) |
Remap [min, max] to [0.0 to 1.0].
[in] | f | The input float value |
[in] | min | The float value that will be remapped to 0.0 |
[in] | max | The float value that will be remapped to 1.0 |
Definition at line 451 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixInputRange | ( | const RtColorRGB & | rgb, |
const RtFloat & | min, | ||
const RtFloat & | max | ||
) |
Remap [min, max] to [0.0 to 1.0].
[in] | rgb | The input color value |
[in] | min | The float value that will be remapped to 0.0 |
[in] | max | The float value that will be remapped to 1.0 |
Definition at line 470 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixInputRange | ( | const RtColorRGB & | rgb, |
const T & | min, | ||
const T & | max | ||
) |
Remap [min, max] to [0.0 to 1.0].
[in] | rgb | The input color value |
[in] | min | The T value that will be remapped to 0.0 |
[in] | max | The T value that will be remapped to 1.0 |
T | Any RtFloat3 container. |
Definition at line 491 of file RixColorUtils.h.
PRMAN_INLINE RtFloat RixOutputRange | ( | const RtFloat & | f, |
const RtFloat & | min, | ||
const RtFloat & | max | ||
) |
Remap a float from [0.0, 1.0] to [min, max].
[in] | f | The input float value |
[in] | min | The float value to which 0.0 will be remapped. |
[in] | max | The float value to which 1.0 will be remapped. |
Definition at line 509 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixOutputRange | ( | const RtColorRGB & | rgb, |
const RtFloat & | min, | ||
const RtFloat & | max | ||
) |
Remap a color from [0.0, 1.0] to [min, max].
[in] | rgb | The input rgb |
[in] | min | The float value to which 0.0 will be remapped. |
[in] | max | The float value to which 1.0 will be remapped. |
Definition at line 526 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixOutputRange | ( | const RtColorRGB & | rgb, |
const T & | min, | ||
const T & | max | ||
) |
Remap a color from [0.0, 1.0] to [min, max].
[in] | rgb | The input rgb |
[in] | min | The T value to which 0.0 will be remapped. |
[in] | max | The T value to which 1.0 will be remapped. |
T | Any RtFloat3 container. |
Definition at line 547 of file RixColorUtils.h.
PRMAN_INLINE void RixRgbToHsl | ( | RtColorRGB const & | rgb, |
RtColorRGB & | hsl | ||
) |
Definition at line 363 of file RixColorUtils.h.
PRMAN_INLINE void RixRgbToHsv | ( | RtColorRGB const & | rgb, |
RtColorRGB & | hsv | ||
) |
Definition at line 214 of file RixColorUtils.h.
PRMAN_INLINE void RixRgbToXyz | ( | RtColorRGB const & | rgb, |
RtColorRGB & | xyz, | ||
RixColorSpace | cs = k_sRGB |
||
) |
Definition at line 431 of file RixColorUtils.h.
PRMAN_INLINE RtColorRGB RixSaturation | ( | const RtColorRGB & | rgb, |
const float | saturation | ||
) |
Return the saturation-adjusted color.
[in] | rgb | The rgb input |
[in] | saturation | 0.0 is monochrome (fully desaturated), 1.0 is the original color, values > 1.0 increase color saturation. |
Definition at line 833 of file RixColorUtils.h.
PRMAN_INLINE void RixSaturation | ( | RtColorRGB & | rgb, |
const float | saturation | ||
) |
Adjust the color saturation of the passed color.
[in] | rgb | The rgb input |
[in] | saturation | 0.0 is monochrome (fully desaturated), 1.0 is the original color, values > 1.0 increase color saturation. |
Definition at line 856 of file RixColorUtils.h.
PRMAN_INLINE float rixValue | ( | float | n1, |
float | n2, | ||
float | hue | ||
) |
Definition at line 321 of file RixColorUtils.h.
PRMAN_INLINE void RixXyzToRgb | ( | RtColorRGB const & | xyz, |
RtColorRGB & | rgb, | ||
RixColorSpace | cs = k_sRGB |
||
) |
Definition at line 420 of file RixColorUtils.h.