# IRdColor Interface Reference

Inherits IRsDataObject.

List of all members.

## Public Member Functions
HRESULT | Clear (void)
HRESULT | GetRed ([out, retval] float *pVal)
HRESULT | SetRed ([in] float newVal)
HRESULT | GetGreen ([out, retval] float *pVal)
HRESULT | SetGreen ([in] float newVal)
HRESULT | GetBlue ([out, retval] float *pVal)
HRESULT | SetBlue ([in] float newVal)
HRESULT | GetAlpha ([out, retval] float *pVal)
HRESULT | SetAlpha ([in] float newVal)
HRESULT | GetRed8 ([out, retval] RtBYTE *pVal)
HRESULT | SetRed8 ([in] RtBYTE newVal)
HRESULT | GetGreen8 ([out, retval] RtBYTE *pVal)
HRESULT | SetGreen8 ([in] RtBYTE newVal)
HRESULT | GetBlue8 ([out, retval] RtBYTE *pVal)
HRESULT | SetBlue8 ([in] RtBYTE newVal)
HRESULT | GetAlpha8 ([out, retval] RtBYTE *pVal)
HRESULT | SetAlpha8 ([in] RtBYTE newVal)
HRESULT | SetColor ([in] float fRed,[in] float fGreen,[in] float fBlue,[in] float fAlpha)
HRESULT | GetColor ([out] float *fRed,[out] float *fGreen,[out] float *fBlue,[out] float *fAlpha)
HRESULT | SetColor32 ([in] ULONG dwColor)
HRESULT | GetColor32 ([out, retval] ULONG *pdwColor)
HRESULT | SetColorRGBA8 ([in] RtBYTE nRed,[in] RtBYTE nGreen,[in] RtBYTE nBlue,[in] RtBYTE nAlpha)
HRESULT | SetColorARGB8 ([in] RtBYTE nAlpha,[in] RtBYTE nRed,[in] RtBYTE nGreen,[in] RtBYTE nBlue)
HRESULT | GetColorRGBA8 ([out] RtBYTE *nRed,[out] RtBYTE *nGreen,[out] RtBYTE *nBlue,[out] RtBYTE *nAlpha)
HRESULT | SetColorRGB8 ([in] RtBYTE nRed,[in] RtBYTE nGreen,[in] RtBYTE nBlue)
HRESULT | SetColorArray ([in] FLOAT *pfColors)
HRESULT | GetColorArray ([out, retval] FLOAT *pfColors)
HRESULT | SetCOLORREF ([in] COLORREF dwNewValue)
HRESULT | GetCOLORREF ([out] COLORREF *dwValue)
HRESULT | SetColorHSL ([in] float fHue,[in] float fSat,[in] float fLum)
HRESULT | GetColorHSL ([out] float *fHue,[out] float *fSat,[out] float *fLum)
HRESULT | GetHue ([out, retval] float *pVal)
HRESULT | GetSat ([out, retval] float *pVal)
HRESULT | GetLum ([out, retval] float *pVal)

## Detailed Description

IRdColor is used to store colors. It has support for packed 32bit unsigned int value - RGBA in one DWORD and also supports High definition range colors - 4byte floats per one channel.

Floating point color rule is that value 1.0 means full color (just as 255 was for 8bit range) Values greater than 1.0 are allowed to support HDR. Values smaller than 0.0 are allowed too.

Conversion to packed 32bit DWORD clamps all values greater than 1.0 to 255. The storage has format BGRA (8bits per channel, B is in first 8 least significant bits, A is in 8 most significant bits).

http://en.wikipedia.org/wiki/High_dynamic_range_imaging

## Member Function Documentation

HRESULT IRdColor::Clear | ( | void |  | ) |

Clear the contents of the color data (set all to zero).

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetRed | ( | [out, retval] float * | pVal | ) |

Get Red portion of the color.

Parameters:

  | pVal | [out, retval] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetRed | ( | [in] float | newVal | ) |

Set Red portion of the color.

Parameters:

  | newVal | [in] specifies the new color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetGreen | ( | [out, retval] float * | pVal | ) |

Get Green portion of the color.

Parameters:

  | pVal | [out, retval] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetGreen | ( | [in] float | newVal | ) |

Set Green portion of the color.

Parameters:

  | newVal | [in] specifies the new color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetBlue | ( | [out, retval] float * | pVal | ) |

Get Blue portion of the color.

Parameters:

  | pVal | [out, retval] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetBlue | ( | [in] float | newVal | ) |

Set Blue portion of the color.

Parameters:

  | newVal | [in] specifies the new color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetAlpha | ( | [out, retval] float * | pVal | ) |

Get Alpha portion of the color.

Parameters:

  | pVal | [out, retval] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetAlpha | ( | [in] float | newVal | ) |

Set Alpha portion of the color.

Parameters:

  | newVal | [in] specifies the new color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetRed8 | ( | [out, retval] RtBYTE * | pVal | ) |

Get Red portion of the color in 8bit unsigned format. Values in range 0.0 to 1.0 are mapped to range 0 to 255.

Parameters:

  | pVal | [out, retval] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetRed8 | ( | [in] RtBYTE | newVal | ) |

Set Red portion of the color in 8bit unsigned format. Values are mapped to range 0.0 to 1.0

Parameters:

  | pVal | [in] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetGreen8 | ( | [out, retval] RtBYTE * | pVal | ) |

Get Green portion of the color in 8bit unsigned format. Values in range 0.0 to 1.0 are mapped to range 0 to 255.

Parameters:

  | pVal | [out, retval] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetGreen8 | ( | [in] RtBYTE | newVal | ) |

Set Green portion of the color in 8bit unsigned format. Values are mapped to range 0.0 to 1.0

Parameters:

  | pVal | [in] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetBlue8 | ( | [out, retval] RtBYTE * | pVal | ) |

Get Blue portion of the color in 8bit unsigned format. Values in range 0.0 to 1.0 are mapped to range 0 to 255.

Parameters:

  | pVal | [out, retval] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetBlue8 | ( | [in] RtBYTE | newVal | ) |

Set Blue portion of the color in 8bit unsigned format. Values are mapped to range 0.0 to 1.0

Parameters:

  | pVal | [in] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetAlpha8 | ( | [out, retval] RtBYTE * | pVal | ) |

Get Alpha portion of the color in 8bit unsigned format. Values in range 0.0 to 1.0 are mapped to range 0 to 255.

Parameters:

  | pVal | [out, retval] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetAlpha8 | ( | [in] RtBYTE | newVal | ) |

Set Alpha portion of the color in 8bit unsigned format. Values are mapped to range 0.0 to 1.0

Parameters:

  | pVal | [in] is filled with the color channel data.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetColor | ( | [in] float | fRed,
|  | [in] float | fGreen,
|  | [in] float | fBlue,
|  | [in] float | fAlpha |
| ) |  |  |

Set color from four values.

Parameters:

  | fRed | [in] specifies the red portion.
  | fGreen | [in] specifies the green portion.
  | fBlue | [in] specifies the blue portion.
  | fAlpha | [in] specifies the alpha portion.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetColor | ( | [out] float * | fRed,
|  | [out] float * | fGreen,
|  | [out] float * | fBlue,
|  | [out] float * | fAlpha |
| ) |  |  |

Get the color of all four channels.

Parameters:

  | fRed | [out] is filled with the red portion if not NULL.
  | fGreen | [out] is filled with the green portion if not NULL.
  | fBlue | [out] is filled with the blue portion if not NULL.
  | fAlpha | [out] is filled with the alpha portion if not NULL.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetColor32 | ( | [in] ULONG | dwColor | ) |

Set color from single DWORD value. The storage format is ARGB (8bits per channel, B is in first 8 least significant bits, A is in 8 most significant bits) i.e. D3DCOLOR type.

Parameters:

  | dwColor | [in] specifies the color value.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetColor32 | ( | [out, retval] ULONG * | pdwColor | ) |

Get the color in single DWORD value. Conversion to packed 32bit DWORD clamps all values greater than 1.0 to 255. The storage format is ARGB (8bits per channel, B is in first 8 least significant bits, A is in 8 most significant bits).

Parameters:

  | pdwColor | [out, retval] is filled with the color value.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetColorRGBA8 | ( | [in] RtBYTE | nRed,
|  | [in] RtBYTE | nGreen,
|  | [in] RtBYTE | nBlue,
|  | [in] RtBYTE | nAlpha |
| ) |  |  |

Set color from four 8bit unsigned values.

Parameters:

  | nRed | [in] specifies the red portion.
  | nGreen | [in] specifies the green portion.
  | nBlue | [in] specifies the blue portion.
  | nAlpha | [in] specifies the alpha portion.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetColorARGB8 | ( | [in] RtBYTE | nAlpha,
|  | [in] RtBYTE | nRed,
|  | [in] RtBYTE | nGreen,
|  | [in] RtBYTE | nBlue |
| ) |  |  |

Set color from four 8bit unsigned values.

Parameters:

  | nAlpha | [in] specifies the alpha portion.
  | nRed | [in] specifies the red portion.
  | nGreen | [in] specifies the green portion.
  | nBlue | [in] specifies the blue portion.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetColorRGBA8 | ( | [out] RtBYTE * | nRed,
|  | [out] RtBYTE * | nGreen,
|  | [out] RtBYTE * | nBlue,
|  | [out] RtBYTE * | nAlpha |
| ) |  |  |

Return color in four 8bit unsigned values.

Parameters:

  | nRed | [out] is filled with the red portion if not NULL.
  | nGreen | [out] is filled with the green portion if not NULL.
  | nBlue | [out] is filled with the blue portion if not NULL.
  | nAlpha | [out] is filled with the alpha portion if not NULL.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetColorRGB8 | ( | [in] RtBYTE | nRed,
|  | [in] RtBYTE | nGreen,
|  | [in] RtBYTE | nBlue |
| ) |  |  |

Set color from three 8bit unsigned values. Alpha is set to 1.0

Parameters:

  | nRed | [in] specifies the red portion.
  | nGreen | [in] specifies the green portion.
  | nBlue | [in] specifies the blue portion.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetColorArray | ( | [in] FLOAT * | pfColors | ) |

Set color from the array of four consecutive floats.

Parameters:

  | pfColors | [in] specifies the array in sequence R G B A.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetColorArray | ( | [out, retval] FLOAT * | pfColors | ) |

Return color in from the array of four consecutive floats.

Parameters:

  | pfColors | [out, retval] is filled with values in sequence R G B A.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetCOLORREF | ( | [in] COLORREF | dwNewValue | ) |

Set color from an COLORREF value.

Parameters:

  | dwNewValue | [in] specifies new color value.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetCOLORREF | ( | [out] COLORREF * | dwValue | ) |

Return color values in an COLORREF value..

Parameters:

  | dwValue | [out] is filled with the color value.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::SetColorHSL | ( | [in] float | fHue,
|  | [in] float | fSat,
|  | [in] float | fLum |
| ) |  |  |

Set color values in an HSL format.

Parameters:

  | fHue | [in] specifies hue.
  | fSat | [in] specifies saturation.
  | fLum | [in] specifies luminance.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetColorHSL | ( | [out] float * | fHue,
|  | [out] float * | fSat,
|  | [out] float * | fLum |
| ) |  |  |

Get color values in an HSL format.

Parameters:

  | fHue | [out] is filled with the hue.
  | fSat | [out] is filled with the saturation.
  | fLum | [out] is filled with the luminance.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetHue | ( | [out, retval] float * | pVal | ) |

Get Hue part from HSL format.

Parameters:

  | pVal | [out, retval] is filled with the value.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetSat | ( | [out, retval] float * | pVal | ) |

Get Sat part from HSL format.

Parameters:

  | pVal | [out, retval] is filled with the value.

Returns:
  Standard HRESULT processing can be applied to the result.

HRESULT IRdColor::GetLum | ( | [out, retval] float * | pVal | ) |

Get Lum part from HSL format.

Parameters:

  | pVal | [out, retval] is filled with the value.

Returns:
  Standard HRESULT processing can be applied to the result.