Classes | Typedefs | Functions

acolor.h File Reference

#include "GeomExport.h"
#include "maxheap.h"
#include "maxtypes.h"
#include "point3.h"
#include "point4.h"
#include "color.h"

Go to the source code of this file.

Classes

class   AColor

Typedefs

typedef AColor  RGBA

Functions

GEOMEXPORT int  MaxComponent (const AColor &)
GEOMEXPORT 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)

Typedef Documentation

typedef AColor RGBA

Definition at line 326 of file acolor.h.


Function Documentation

GEOMEXPORT 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.
GEOMEXPORT 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.

Definition at line 301 of file acolor.h.

                                                  {
    return(AColor(a.r*f, a.g*f, a.b*f, a.a*f));
    }
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.

Definition at line 307 of file acolor.h.

                                                  {
    return(AColor(a.r*f, a.g*f, a.b*f, a.a*f));
    }
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.

Definition at line 322 of file acolor.h.

                                                           {
    return  fg + (1.0f-fg.a)*bg;
    }