Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
Resource class. More...
#include <ilviews/base/resource.h>
Public Member Functions | |
IlvIntensity | getBlue () const |
Retrieves the blue component value. More... | |
IlvIntensity | getGreen () const |
Retrieves the green component value. More... | |
void | getHSV (IlFloat &hue, IlFloat &saturation, IlFloat &value) const |
Retrieves the HSV values. More... | |
IlFloat | getHue () const |
Retrieves the hue value. More... | |
IlUInt | getIndex () const |
Gets the index of this color. More... | |
IlvIntensity | getRed () const |
Retrieves the red component value. More... | |
void | getRGB (IlvIntensity &red, IlvIntensity &green, IlvIntensity &blue) const |
Retrieves the RGB component values. More... | |
IlFloat | getSaturation () const |
Retrieves the color saturation value. More... | |
IlFloat | getValue () const |
Retrieves the luminosity value. More... | |
IlBoolean | isMutable () const |
Get the mutable attribute. More... | |
void | setBlue (IlvIntensity blue) |
Sets the blue component value. More... | |
void | setGreen (IlvIntensity green) |
Sets the green component value. More... | |
void | setHSV (IlFloat hue, IlFloat saturation, IlFloat value) |
Sets the HSV parameters. More... | |
void | setHue (IlFloat hue) |
Sets the hue value. More... | |
virtual void | setName (const char *name) |
Sets the name of the resource. More... | |
void | setRed (IlvIntensity red) |
Sets the red component value. More... | |
void | setRGB (IlvIntensity red, IlvIntensity green, IlvIntensity blue) |
Sets the RGB component values. More... | |
void | setSaturation (IlFloat saturation) |
Sets the saturation. More... | |
void | setValue (IlFloat value) |
Sets the luminosity value. More... | |
virtual void | unLock () |
Unlocks the resource. More... | |
Public Member Functions inherited from IlvResource | |
IlvDisplay * | getDisplay () const |
Gets the IlvDisplay instance. More... | |
const char * | getName () const |
Gets the resource name. More... | |
void | lock () |
Locks the resource. More... | |
Static Public Member Functions | |
static void | ComputeReliefColors (const IlvColor *reference, IlvColor *&topShade, IlvColor *&bottomShade, IlvColor *&select) |
Computes colors that make a shadow effect. More... | |
static void | HSVToRGB (IlFloat h, IlFloat s, IlFloat v, IlvIntensity &red, IlvIntensity &green, IlvIntensity &blue) |
Converts HSV values to the RGB model. More... | |
static void | RGBToHSV (IlvIntensity red, IlvIntensity green, IlvIntensity blue, IlFloat &h, IlFloat &s, IlFloat &v) |
Converts RGB values to the HSV model. More... | |
Friends | |
class | IlvDisplay |
Resource class.
Library: xviews or winviews or mviews (mutually exclusive)
This class lets you manipulate color objects, both in the RGB
and the HSV
color models.
IlvColor
has no constructor. The only way to obtain a color is to ask your IlvDisplay
object to get it for you.
A color is entirely defined by its three component values: red
, green
and blue
. These values are stored as unsigned 16-bit numbers. For example, black is defined with its three components set to zero, and white has its three components set to 65535
.
An IlvColor
can be mutable on systems that accept it. Values defining a mutable color can be modified on the fly, allowing to animate your displays without requiring a refresh of the screen.
|
static |
Computes colors that make a shadow effect.
The different colors are derived from reference by making it brighter or dimmer.
reference | The reference color. |
topShade | Is set to a brighter version of reference. |
bottomShade | Is set to a dimmer version of reference. |
select | A color that looks like a selected version of reference (usually slightly dimmer). |
IlvIntensity IlvColor::getBlue | ( | ) | const |
Retrieves the blue component value.
IlvIntensity IlvColor::getGreen | ( | ) | const |
Retrieves the green component value.
Retrieves the HSV
values.
Obtains the current values of all three HSV
components: hue, saturation and luminosity.
hue | The hue value of this color. |
saturation | The saturation value of this color. |
value | The luminosity value of this color. |
IlFloat IlvColor::getHue | ( | ) | const |
Retrieves the hue value.
This value is computed from the RGB color model. It corresponds to an angle in the HSV
color model, where a value of 0
indicates a pure red color, 120
indicates a pure blue color, and 240
indicates a pure green color.
HSV
cone model, this number represents an angle in the range of 0 to 360 degrees. IlUInt IlvColor::getIndex | ( | ) | const |
Gets the index of this color.
Colors are generally stored in a color table that is maintained internally by your IlvDisplay
object. You can obtain the index of a color object (an unsigned long integer) by means of this member function. Then you can use this number for remapping processes involving color bitmaps, when you want to map pixel values to color objects.
IlvIntensity IlvColor::getRed | ( | ) | const |
Retrieves the red component value.
void IlvColor::getRGB | ( | IlvIntensity & | red, |
IlvIntensity & | green, | ||
IlvIntensity & | blue | ||
) | const |
Retrieves the RGB component values.
red | The red component value. |
green | The green component value. |
blue | The blue component value. |
IlFloat IlvColor::getSaturation | ( | ) | const |
Retrieves the color saturation value.
HSV
cone model, this number ranges from zero (gray) to one (maximum vividness). IlFloat IlvColor::getValue | ( | ) | const |
Retrieves the luminosity value.
HSV
cone model, this number ranges from zero (black) to one (white).
|
static |
Converts HSV
values to the RGB
model.
h | The input hue value. |
s | The input saturation value. |
v | The input luminosity value. If this is 0 the output result will always be 0 for all components, no matter what values are set in h and s. |
red | Is set to the output red component value. |
green | Is set to the output green component value. |
blue | Is set to the output blue component value. |
IlBoolean IlvColor::isMutable | ( | ) | const |
Get the mutable attribute.
Boolean
value that indicates whether this color is mutable or not. A color can be either static (impossible to modify after its creation) or mutable. In the latter case, you can use set
member functions to dynamically modify a color, even when there are drawings with this color on the screen. (These set
functions are indicated in the next functions.)Mutable colors are costly, however, in terms of internal resource management. You specify whether or not you want mutable color in the IlvDisplay
member functions that create these objects.
|
static |
Converts RGB
values to the HSV
model.
red | The input red value. |
green | The input green value. |
blue | The input blue value. |
h | Is set to the output hue value. |
s | Is set to the output saturation value. |
v | Is set to the output luminosity value value. |
void IlvColor::setBlue | ( | IlvIntensity | blue | ) |
Sets the blue component value.
This member function does nothing if this color is not mutable.
Assigns an intensity to the blue component. If the mutable color is allocated in a higher bitPlaneGroup
(that is, the allocated color allocates many slots of the color map) then all the slots are modified.
blue | The new blue component value of this color. |
void IlvColor::setGreen | ( | IlvIntensity | green | ) |
Sets the green component value.
This member function does nothing if this color is not mutable.
Assigns an intensity to the green component. If the mutable color is allocated in a higher bitPlaneGroup
(that is, the allocated color allocates many slots of the color map) then all the slots are modified.
green | The new green component value of this color. |
Sets the HSV parameters.
This member function does nothing if this color is not mutable.
Assigns values to all three HSV
components: hue, saturation and luminosity.
hue | The new hue value of this color. |
saturation | The new saturation value of this color. |
value | The new luminosity value of this color. |
void IlvColor::setHue | ( | IlFloat | hue | ) |
Sets the hue value.
This member function does nothing if this color is not mutable.
Assigns a hue value to the current color. In the context of the HSV
cone model, this number represents an angle in the range of 0 to 360º.
hue | The new hue value of this color. |
|
virtual |
Sets the name of the resource.
Names your resource by means of a unique name string descriptor that is internally copied.
Reimplemented from IlvResource.
void IlvColor::setRed | ( | IlvIntensity | red | ) |
Sets the red component value.
This member function does nothing if this color is not mutable.
Assigns an intensity to the red component. If the mutable color is allocated in a higher bitPlaneGroup
(that is, the allocated color allocates many slots of the color map) then all the slots are modified.
red | The new red component value of this color. |
void IlvColor::setRGB | ( | IlvIntensity | red, |
IlvIntensity | green, | ||
IlvIntensity | blue | ||
) |
Sets the RGB component values.
This member function does nothing if this color is not mutable.
Assigns intensities to all three components: red, green and blue. If the mutable color is allocated in a higher bitPlaneGroup
(that is, the allocated color allocates many slots of the color map) then all the components are modified.
red | The new red component value of this color. |
green | The new green component value of this color. |
blue | The new blue component value of this color. |
void IlvColor::setSaturation | ( | IlFloat | saturation | ) |
Sets the saturation.
This member function does nothing if this color is not mutable.
Assigns a saturation value to the current color. In the context of the HSV
cone model, this number ranges from zero (gray) to one (maximum vividness).
saturation | The new saturation value of this color. |
void IlvColor::setValue | ( | IlFloat | value | ) |
Sets the luminosity value.
This member function does nothing if this color is not mutable.
Assigns a luminosity value to the current color. In the context of the HSV
cone model, this number ranges from zero (black) to one (white).
value | The new luminosity value of this color. |
|
virtual |
Unlocks the resource.
This function decrements the reference count of the resource, and deletes it if this count becomes 0
. Resource management is closely concerned with the way resources are locked and unlocked. Whenever you need a specific resource in one of your persistent objects, you should use this mechanism to make sure that it will stay safe within your IlvDisplay
instance. If your application needs more than one instance of IlvDisplay
, you have to create resources within each environment, since resources cannot be shared between the different IlvDisplay
contexts.
Reimplemented from IlvResource.
© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.