3ds Max C++ API Reference
acolor.h File Reference
#include "GeomExport.h"
#include "point3.h"
#include "point4.h"
#include "color.h"
#include "maxcolors.h"
#include <cstdint>

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

◆ RGBA

typedef AColor RGBA

Function Documentation

◆ MaxComponent()

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.

◆ MinComponent()

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.

◆ operator*() [1/2]

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.
447 {
448  return (AColor(a.r * f, a.g * f, a.b * f, a.a * f));
449 }
Definition: acolor.h:31
float r
These values are in the range 0.0 to 1.0.
Definition: acolor.h:36
float a
Definition: acolor.h:39
float b
Definition: acolor.h:38
float g
Definition: acolor.h:37

◆ operator*() [2/2]

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

◆ CompOver()

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.
470 {
471  return fg + (1.0f - fg.a) * bg;
472 }

◆ Intens()

static float Intens ( const AColor c)
inlinestatic
477 {
478  return (c.r + c.g + c.b) / 3.0f;
479 }