color.h File Reference

#include "GeomExport.h"
#include "maxheap.h"
#include <WTypes.h>
#include "point3.h"
#include "maxtypes.h"
#include <tchar.h>
#include <wingdi.h>

Classes

struct  RealPixel
 
class  Color
 
struct  LogLUV32Pixel
 
struct  LogLUV24Pixel
 

Macros

#define FLto255(x)   ((int)((x)*255.0f+.5))
 

Functions

RealPixel MakeRealPixel (float r, float g, float b)
 
void ExpandRealPixel (const RealPixel &rp, float &r, float &g, float &b)
 
int MaxComponent (const Color &)
 
int MinComponent (const Color &)
 
float MaxVal (const Color &)
 
float MinVal (const Color &)
 
float Length (const Color &v)
 
Color operator* (float f, const Color &a)
 
Color operator* (const Color &a, float f)
 
Color operator/ (const Color &a, float f)
 
Color operator+ (const Color &a, float f)
 
Color operator+ (float f, const Color &a)
 
Color operator- (const Color &a, float f)
 
Color operator- (float f, const Color &a)
 
static float Intens (const Color &c)
 

Macro Definition Documentation

#define FLto255 (   x)    ((int)((x)*255.0f+.5))

Function Documentation

RealPixel MakeRealPixel ( float  r,
float  g,
float  b 
)
void ExpandRealPixel ( const RealPixel rp,
float &  r,
float &  g,
float &  b 
)
int MaxComponent ( const Color )
Remarks
Returns the index of the component with the maximum absolute value.
Parameters:
const Color&

The color to check.
Returns
The index of the component with the maximum absolute value. r=0, g=1, b=2.
int MinComponent ( const Color )
Remarks
Returns the index of the component with the minimum absolute value
Parameters:
const Color&

The color to check.
Returns
The index of the component with the minimum absolute value. r=0, g=1, b=2.
float MaxVal ( const Color )
Remarks
Returns the value of the component with the maximum absolute value.
Parameters:
const Color&

The color to check.
Returns
The value of the component with the maximum absolute value.
float MinVal ( const Color )
Remarks
The value of the component with the minimum absolute value.
Parameters:
const Color&

The color to check.
Returns
float Length ( const Color v)
inline
Remarks
Returns the 'length' of the color, i.e.

return (float)sqrt(v.r*v.r+v.g*v.g+v.b*v.b);
Parameters:
const Color& v

The color to return the length of.
Returns
The length of the color.
Operators:
363  {
364  return (float)sqrt(v.r*v.r+v.g*v.g+v.b*v.b);
365  }
float g
These values are in the range 0.0 to 1.0.
Definition: color.h:76
float b
These values are in the range 0.0 to 1.0.
Definition: color.h:78
float r
These values are in the range 0.0 to 1.0.
Definition: color.h:74
Color operator* ( float  f,
const Color a 
)
inline
412  {
413  return(Color(a.r*f, a.g*f, a.b*f));
414  }
float g
These values are in the range 0.0 to 1.0.
Definition: color.h:76
Definition: color.h:69
float b
These values are in the range 0.0 to 1.0.
Definition: color.h:78
float r
These values are in the range 0.0 to 1.0.
Definition: color.h:74
Color operator* ( const Color a,
float  f 
)
inline
416  {
417  return(Color(a.r*f, a.g*f, a.b*f));
418  }
float g
These values are in the range 0.0 to 1.0.
Definition: color.h:76
Definition: color.h:69
float b
These values are in the range 0.0 to 1.0.
Definition: color.h:78
float r
These values are in the range 0.0 to 1.0.
Definition: color.h:74
Color operator/ ( const Color a,
float  f 
)
inline
420  {
421  return(Color(a.r/f, a.g/f, a.b/f));
422  }
float g
These values are in the range 0.0 to 1.0.
Definition: color.h:76
Definition: color.h:69
float b
These values are in the range 0.0 to 1.0.
Definition: color.h:78
float r
These values are in the range 0.0 to 1.0.
Definition: color.h:74
Color operator+ ( const Color a,
float  f 
)
inline
424  {
425  return(Color(a.r+f, a.g+f, a.b+f));
426  }
float g
These values are in the range 0.0 to 1.0.
Definition: color.h:76
Definition: color.h:69
float b
These values are in the range 0.0 to 1.0.
Definition: color.h:78
float r
These values are in the range 0.0 to 1.0.
Definition: color.h:74
Color operator+ ( float  f,
const Color a 
)
inline
428  {
429  return(Color(a.r+f, a.g+f, a.b+f));
430  }
float g
These values are in the range 0.0 to 1.0.
Definition: color.h:76
Definition: color.h:69
float b
These values are in the range 0.0 to 1.0.
Definition: color.h:78
float r
These values are in the range 0.0 to 1.0.
Definition: color.h:74
Color operator- ( const Color a,
float  f 
)
inline
432  {
433  return(Color(a.r-f, a.g-f, a.b-f));
434  }
float g
These values are in the range 0.0 to 1.0.
Definition: color.h:76
Definition: color.h:69
float b
These values are in the range 0.0 to 1.0.
Definition: color.h:78
float r
These values are in the range 0.0 to 1.0.
Definition: color.h:74
Color operator- ( float  f,
const Color a 
)
inline
436  {
437  return(Color(f-a.r, f-a.g, f-a.b));
438  }
float g
These values are in the range 0.0 to 1.0.
Definition: color.h:76
Definition: color.h:69
float b
These values are in the range 0.0 to 1.0.
Definition: color.h:78
float r
These values are in the range 0.0 to 1.0.
Definition: color.h:74
static float Intens ( const Color c)
inlinestatic
580 { return (c.r+c.g+c.b)/3.0f; }
float g
These values are in the range 0.0 to 1.0.
Definition: color.h:76
float b
These values are in the range 0.0 to 1.0.
Definition: color.h:78
float r
These values are in the range 0.0 to 1.0.
Definition: color.h:74