Classes | Defines | Functions

color.h File Reference

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

Go to the source code of this file.

Classes

struct   RealPixel
class   Color
struct   LogLUV32Pixel
struct   LogLUV24Pixel

Defines

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

Functions

GEOMEXPORT RealPixel  MakeRealPixel (float r, float g, float b)
GEOMEXPORT void  ExpandRealPixel (const RealPixel &rp, float &r, float &g, float &b)
GEOMEXPORT int  MaxComponent (const Color &)
GEOMEXPORT int  MinComponent (const Color &)
GEOMEXPORT float  MaxVal (const Color &)
GEOMEXPORT 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)

Define Documentation

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

Definition at line 22 of file color.h.


Function Documentation

GEOMEXPORT RealPixel MakeRealPixel ( float  r,
float  g,
float  b 
)
GEOMEXPORT void ExpandRealPixel ( const RealPixel rp,
float &  r,
float &  g,
float &  b 
)
GEOMEXPORT 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.
GEOMEXPORT 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.
GEOMEXPORT 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.
GEOMEXPORT 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:

Definition at line 342 of file color.h.

                                    {   
    return (float)sqrt(v.r*v.r+v.g*v.g+v.b*v.b);
    }
Color operator* ( float  f,
const Color a 
) [inline]

Definition at line 391 of file color.h.

                                                {
    return(Color(a.r*f, a.g*f, a.b*f));
    }
Color operator* ( const Color a,
float  f 
) [inline]

Definition at line 395 of file color.h.

                                                {
    return(Color(a.r*f, a.g*f, a.b*f));
    }
Color operator/ ( const Color a,
float  f 
) [inline]

Definition at line 399 of file color.h.

                                                {
    return(Color(a.r/f, a.g/f, a.b/f));
    }
Color operator+ ( const Color a,
float  f 
) [inline]

Definition at line 403 of file color.h.

                                                {
    return(Color(a.r+f, a.g+f, a.b+f));
    }
Color operator+ ( float  f,
const Color a 
) [inline]

Definition at line 407 of file color.h.

                                                {
    return(Color(a.r+f, a.g+f, a.b+f));
    }
Color operator- ( const Color a,
float  f 
) [inline]

Definition at line 411 of file color.h.

                                                {
    return(Color(a.r-f, a.g-f, a.b-f));
    }
Color operator- ( float  f,
const Color a 
) [inline]

Definition at line 415 of file color.h.

                                                {
    return(Color(f-a.r, f-a.g, f-a.b));
    }