adskColor.h File Reference
Detailed Description
Color manipulation functions.
#include <shader.h>
#include "adskConstants.h"
#include "adskShaderSDKNamespaceBegin.h"
#include "adskShaderSDKNamespaceEnd.h"
|
Functions
|
bool |
MAYA_ISBLACK
(const miColor &c) |
|
Check whether a given color is black.
|
miScalar |
MAYA_LUMINANCE
(const miColor &c) |
|
Calculate the luminance of the given RGB
color.
|
miScalar |
MAYA_INTENSITY
(const miColor &c) |
|
Calculate the intensity of the given RGB
color.
|
miColor |
operator*
(const miColor &lhs, const miScalar &rhs) |
|
Multiplies a color by a scalar.
|
miColor |
operator*
(const miScalar &lhs, const miColor &rhs) |
|
Multiplies a color by a scalar.
|
miColor |
operator*
(const miColor &lhs, const miColor &rhs) |
|
Multiplies a color by a color.
|
miColor |
operator/
(const miColor &lhs, const miScalar &rhs) |
|
Divide a color by a scalar.
|
miColor |
operator/
(const miColor &lhs, const int &rhs) |
|
Divide a color by an integer.
|
miColor |
operator+
(const miColor &lhs, const miColor &rhs) |
|
Add two colors together.
|
miColor |
operator-
(const miColor &lhs, const miColor &rhs) |
|
Subtract two colors.
|
miColor |
opaqueColor
(const miColor &color) |
|
Return a color which is fully opaque.
|
Function Documentation
miScalar MAYA_INTENSITY |
( |
const miColor & |
c |
) |
[inline] |
Calculate the intensity of the given RGB color.
The intensity is calculated as the average of the RGB
components.
- Parameters:
-
- Returns:
- The intensity.
bool MAYA_ISBLACK |
( |
const miColor & |
c |
) |
[inline] |
Check whether a given color is black.
This function will check that the RGB components of the given
color are less than a given epsilon (MAYA_EPS
defined
in adskConstants.h
).
- Parameters:
-
[in] |
c |
The color to check. |
- Returns:
- Whether the color can be considered to be black.
miScalar MAYA_LUMINANCE |
( |
const miColor & |
c |
) |
[inline] |
Calculate the luminance of the given RGB color.
The luminance is a weighted sum of the response of the color
channels which weighs green, red, and blue in decreasing amounts.
This is to model human visual sensitivity.
- Parameters:
-
- Returns:
- The luminance.
miColor opaqueColor |
( |
const miColor & |
color |
) |
[inline] |
Return a color which is fully opaque.
This function converts a color to a fully opaque color, meaning
that it sets the alpha channel to 1.
- Parameters:
-
[in] |
color |
The color to be made opaque. |
- Returns:
- The opaque color.
miColor operator* |
( |
const miColor & |
lhs, |
|
|
const miColor & |
rhs |
|
|
) |
|
|
[inline] |
Multiplies a color by a color.
This returns a new color whose channels are the products of the
respective channels of the operands (including the alpha
component).
- Parameters:
-
[in] |
lhs |
The color to be multiplied. |
[in] |
rhs |
The other color to be multiplied. |
- Returns:
- The multiplied color.
miColor operator* |
( |
const miScalar & |
lhs, |
|
|
const miColor & |
rhs |
|
|
) |
|
|
[inline] |
Multiplies a color by a scalar.
The alpha channel is also multiplied by the scalar.
- Parameters:
-
[in] |
lhs |
The scalar to multiply by. |
[in] |
rhs |
The color to be multiplied. |
- Returns:
- The multiplied color.
miColor operator* |
( |
const miColor & |
lhs, |
|
|
const miScalar & |
rhs |
|
|
) |
|
|
[inline] |
Multiplies a color by a scalar.
The alpha channel is also multiplied by the scalar.
- Parameters:
-
[in] |
lhs |
The color to be multiplied. |
[in] |
rhs |
The scalar to multiply by. |
- Returns:
- The multiplied color.
miColor operator+ |
( |
const miColor & |
lhs, |
|
|
const miColor & |
rhs |
|
|
) |
|
|
[inline] |
Add two colors together.
This returns a color representing the sum of the two operands.
The alpha channel is also added.
- Parameters:
-
[in] |
lhs |
One of the colors to be added. |
[in] |
rhs |
The other color to be added. |
- Returns:
- The added color.
miColor operator- |
( |
const miColor & |
lhs, |
|
|
const miColor & |
rhs |
|
|
) |
|
|
[inline] |
Subtract two colors.
This returns a color representing the difference of the two
operands. The alpha channel is also included.
- Parameters:
-
[in] |
lhs |
The color to be subtracted from. |
[in] |
rhs |
The color to subtract. |
- Returns:
- The color difference.
miColor operator/ |
( |
const miColor & |
lhs, |
|
|
const int & |
rhs |
|
|
) |
|
|
[inline] |
Divide a color by an integer.
This returns a color whose components have each been divided by
an integer (including the alpha component).
- Parameters:
-
[in] |
lhs |
The color to be divided. |
[in] |
rhs |
The divisor. |
- Returns:
- The divided color.
miColor operator/ |
( |
const miColor & |
lhs, |
|
|
const miScalar & |
rhs |
|
|
) |
|
|
[inline] |
Divide a color by a scalar.
This returns a color whose components have each been divided by
a scalar (including the alpha component).
- Parameters:
-
[in] |
lhs |
The color to be divided. |
[in] |
rhs |
The divisor. |
- Returns:
- The divided color.