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:
360  {
361  return (float)sqrt(v.r*v.r+v.g*v.g+v.b*v.b);
362  }
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
409  {
410  return(Color(a.r*f, a.g*f, a.b*f));
411  }
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
413  {
414  return(Color(a.r*f, a.g*f, a.b*f));
415  }
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
417  {
418  return(Color(a.r/f, a.g/f, a.b/f));
419  }
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
421  {
422  return(Color(a.r+f, a.g+f, a.b+f));
423  }
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
425  {
426  return(Color(a.r+f, a.g+f, a.b+f));
427  }
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
429  {
430  return(Color(a.r-f, a.g-f, a.b-f));
431  }
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
433  {
434  return(Color(f-a.r, f-a.g, f-a.b));
435  }
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
577 { 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