Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ColorTemperatureTable Class Reference

#include <starcolors.h>

Collaboration diagram for ColorTemperatureTable:

Collaboration graph
List of all members.

Public Member Functions

 ColorTemperatureTable (Color *_colors, unsigned int _nColors, float maxTemp)
Color lookupColor (float temp) const

Private Attributes

const Colorcolors
unsigned nColors
float tempScale

Constructor & Destructor Documentation

ColorTemperatureTable::ColorTemperatureTable Color _colors,
unsigned int  _nColors,
float  maxTemp
[inline]
 

Definition at line 21 of file starcolors.h.

References colors, nColors, and tempScale.

00023                                          :
00024         colors(_colors),
00025         nColors(_nColors),
00026         tempScale((float) (_nColors - 1) / maxTemp)
00027     {};


Member Function Documentation

Color ColorTemperatureTable::lookupColor float  temp  )  const [inline]
 

Definition at line 29 of file starcolors.h.

References colors, nColors, and tempScale.

Referenced by StarRenderer::process(), and Renderer::renderStar().

00030     {
00031         unsigned int colorTableIndex = (unsigned int) (temp * tempScale);
00032         if (colorTableIndex >= nColors)
00033             return colors[nColors - 1];
00034         else
00035             return colors[colorTableIndex];
00036     }


Member Data Documentation

const Color* ColorTemperatureTable::colors [private]
 

Definition at line 39 of file starcolors.h.

Referenced by ColorTemperatureTable(), and lookupColor().

unsigned ColorTemperatureTable::nColors [private]
 

Definition at line 40 of file starcolors.h.

Referenced by ColorTemperatureTable(), and lookupColor().

float ColorTemperatureTable::tempScale [private]
 

Definition at line 41 of file starcolors.h.

Referenced by ColorTemperatureTable(), and lookupColor().


The documentation for this class was generated from the following file:
Generated on Sat Jan 14 22:33:11 2006 for Celestia by  doxygen 1.4.1