acolor.h File Reference

#include "GeomExport.h"
#include "maxheap.h"
#include "maxtypes.h"
#include "point3.h"
#include "point4.h"
#include "color.h"
#include <wingdi.h>

Classes

class  AColor
 

Typedefs

typedef AColor RGBA
 

Functions

int MaxComponent (const AColor &)
 
int MinComponent (const AColor &)
 
AColor operator* (float f, const AColor &a)
 
AColor operator* (const AColor &a, float f)
 
AColor CompOver (const AColor &fg, const AColor &bg)
 
static float Intens (const AColor &c)
 

Typedef Documentation

typedef AColor RGBA

Function Documentation

int MaxComponent ( const AColor )
Remarks
Returns the index of the component with the maximum absolute value.
Parameters:
const AColor&

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

The color to check.
Returns
The index of the component with the minimum absolute value. r=0, g=1, b=2, a=3.
AColor operator* ( float  f,
const AColor a 
)
inline
Remarks
Multiplies each component of an AColor by a float.
Returns
An AColor with each component multiplied by a float.
308  {
309  return(AColor(a.r*f, a.g*f, a.b*f, a.a*f));
310  }
float r
These values are in the range 0.0 to 1.0.
Definition: acolor.h:36
float a
Definition: acolor.h:36
float g
Definition: acolor.h:36
Definition: acolor.h:30
float b
Definition: acolor.h:36
AColor operator* ( const AColor a,
float  f 
)
inline
Remarks
Multiplies each component of an AColor by a float.
Returns
An AColor with each component multiplied by a float.
314  {
315  return(AColor(a.r*f, a.g*f, a.b*f, a.a*f));
316  }
float r
These values are in the range 0.0 to 1.0.
Definition: acolor.h:36
float a
Definition: acolor.h:36
float g
Definition: acolor.h:36
Definition: acolor.h:30
float b
Definition: acolor.h:36
AColor CompOver ( const AColor fg,
const AColor bg 
)
inline
Remarks
Composite fg over bg, assuming associated alpha, i.e. pre-multiplied alpha for both fg and bg

This is: fg + (1.0f-fg.a)*bg
Parameters:
const AColor &fg

Specifies the foreground color to composite.

const AColor& bg

Specifies the background color to composite over.
Returns
The resulting AColor.
329  {
330  return fg + (1.0f-fg.a)*bg;
331  }
float a
Definition: acolor.h:36
static float Intens ( const AColor c)
inlinestatic
335 { return (c.r+c.g+c.b)/3.0f; }
float r
These values are in the range 0.0 to 1.0.
Definition: acolor.h:36
float g
Definition: acolor.h:36
float b
Definition: acolor.h:36