3ds Max C++ API Reference
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 + .5f))
 

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

◆ FLto255

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

Function Documentation

◆ MakeRealPixel()

RealPixel MakeRealPixel ( float  r,
float  g,
float  b 
)

◆ ExpandRealPixel()

void ExpandRealPixel ( const RealPixel rp,
float &  r,
float &  g,
float &  b 
)

◆ MaxComponent()

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.

◆ MinComponent()

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.

◆ MaxVal()

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.

◆ MinVal()

float MinVal ( const Color )
Remarks
The value of the component with the minimum absolute value.
Parameters:
const Color&

The color to check.
Returns

◆ Length()

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:
466 {
467  return (float)sqrt(v.r * v.r + v.g * v.g + v.b * v.b);
468 }
float r
These values are in the range 0.0 to 1.0.
Definition: color.h:79
float b
These values are in the range 0.0 to 1.0.
Definition: color.h:83
float g
These values are in the range 0.0 to 1.0.
Definition: color.h:81

◆ operator*() [1/2]

Color operator* ( float  f,
const Color a 
)
inline
536 {
537  return (Color(a.r * f, a.g * f, a.b * f));
538 }
Definition: color.h:74

◆ operator*() [2/2]

Color operator* ( const Color a,
float  f 
)
inline
541 {
542  return (Color(a.r * f, a.g * f, a.b * f));
543 }

◆ operator/()

Color operator/ ( const Color a,
float  f 
)
inline
546 {
547  return (Color(a.r / f, a.g / f, a.b / f));
548 }

◆ operator+() [1/2]

Color operator+ ( const Color a,
float  f 
)
inline
551 {
552  return (Color(a.r + f, a.g + f, a.b + f));
553 }

◆ operator+() [2/2]

Color operator+ ( float  f,
const Color a 
)
inline
556 {
557  return (Color(a.r + f, a.g + f, a.b + f));
558 }

◆ operator-() [1/2]

Color operator- ( const Color a,
float  f 
)
inline
561 {
562  return (Color(a.r - f, a.g - f, a.b - f));
563 }

◆ operator-() [2/2]

Color operator- ( float  f,
const Color a 
)
inline
566 {
567  return (Color(f - a.r, f - a.g, f - a.b));
568 }

◆ Intens()

static float Intens ( const Color c)
inlinestatic
731 {
732  return (c.r + c.g + c.b) / 3.0f;
733 }