Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

WPCG::WP_Color Class Reference

#include <WP_Color.h>

List of all members.

Public Methods

 WP_Color ()
 WP_Color (scalar r, scalar g, scalar b, scalar a=1.0)
 WP_Color (byte r, byte g, byte b, byte a=255)
 ~WP_Color ()
 WP_Color (const WP_Color &c)
WP_Color & operator= (const WP_Color &c)
byte fromFloatToByte (int index)

Public Attributes

scalar components [4]


Detailed Description

this class represents an OpenGL color object with an alpha component
Author:
Copyright (C) 2001 W.P. van Paassen peter@paassen.tmfweb.nl
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


Constructor & Destructor Documentation

WPCG::WP_Color::WP_Color   [inline]
 

WPCG::WP_Color::WP_Color scalar    r,
scalar    g,
scalar    b,
scalar    a = 1.0
[inline]
 

Parameters:
r  the red color component in float format (0.0-1.0)
g  the green color component in float format (0.0-1.0)
b  the blue color component in float format (0.0-1.0)
a  the optional alpha component in float format (0.0-1.0)

WPCG::WP_Color::WP_Color byte    r,
byte    g,
byte    b,
byte    a = 255
[inline]
 

Parameters:
r  the red color component in byte format (0-255)
g  the green color component in byte format (0-255)
b  the blue color component in byte format (0-255)
a  the optional alpha (transparancy) color component in byte format (0-255)

WPCG::WP_Color::~WP_Color   [inline]
 

WPCG::WP_Color::WP_Color const WP_Color &    c [inline]
 


Member Function Documentation

byte WPCG::WP_Color::fromFloatToByte int    index [inline]
 

this function converts a color component from float to byte

Parameters:
index  in index in the component array. 0-r, 1-g, 2-b, 3-a
Returns:
a byte containing the value of the wanted color component

WP_Color& WPCG::WP_Color::operator= const WP_Color &    c [inline]
 

assigment operator

Parameters:
c  the to be copied color
Returns:
a reference to this new object containing the new color components


Member Data Documentation

scalar WPCG::WP_Color::components[4]
 

the components red, green, blue and alpha of the color object. These components are stored in float format (0.0-1.0), so in case byte format is needed use the fromFloatToByte function


The documentation for this class was generated from the following file:
Generated on Tue Jan 28 20:26:38 2003 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002