- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Friends

# PixelType< ChanType, NumChans > Class Template Reference

Search for all occurrences

## Detailed Description

### template<class ChanType, const unsigned char NumChans>
class mudbox::PixelType< ChanType, NumChans >

A templated pixel type class, where the channel type and number of channels are arguments.

Supports the defined channel types and channel counts of 1, 2, 3, and 4. It can convert between any one type of pixel and any other directly, and provides constructors to achieve this. It also supports swapping the r and b channels and converting to inverse luminance. The channel types handle converting between each other, while the pixel types handle converting between each other.

Definition at line 366 of file image.h.

`#include <image.h>`

List of all members.

## Public Member Functions
PixelType< ChanType, NumChans > & | swapRB ()
| Swap the red and blue channels -- converts RGBA to BGRA and back.
| PixelType (const PixelType< uInt8Channel, 4 > &p)
| conversion constructor
| PixelType (const PixelType< uInt8Channel, 3 > &p)
| conversion constructor
| PixelType (const PixelType< uInt8Channel, 2 > &p)
| conversion constructor
| PixelType (const PixelType< uInt8Channel, 1 > &p)
| conversion constructor
| PixelType (const PixelType< uInt16Channel, 4 > &p)
| conversion constructor
| PixelType (const PixelType< uInt16Channel, 3 > &p)
| conversion constructor
| PixelType (const PixelType< uInt16Channel, 2 > &p)
| conversion constructor
| PixelType (const PixelType< uInt16Channel, 1 > &p)
| conversion constructor
| PixelType (const PixelType< float16Channel, 4 > &p)
| conversion constructor
| PixelType (const PixelType< float16Channel, 3 > &p)
| conversion constructor
| PixelType (const PixelType< float16Channel, 2 > &p)
| conversion constructor
| PixelType (const PixelType< float16Channel, 1 > &p)
| conversion constructor
| PixelType (const PixelType< float32Channel, 4 > &p)
| conversion constructor
| PixelType (const PixelType< float32Channel, 3 > &p)
| conversion constructor
| PixelType (const PixelType< float32Channel, 2 > &p)
| conversion constructor
| PixelType (const PixelType< float32Channel, 1 > &p)
| conversion constructor
void | SetLuminance (const PixelType< uInt8Channel, 4 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< uInt8Channel, 3 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< uInt16Channel, 4 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< uInt16Channel, 3 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< float16Channel, 4 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< float16Channel, 3 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< float32Channel, 4 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< float32Channel, 3 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< float32Channel, 1 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< float16Channel, 1 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< uInt16Channel, 1 > &p)
| RGBA = Luminance of input.
void | SetLuminance (const PixelType< uInt8Channel, 1 > &p)
| RGBA = Luminance of input.
void | SetInvLuminance (const PixelType< uInt8Channel, 4 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< uInt8Channel, 3 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< uInt16Channel, 4 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< uInt16Channel, 3 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< float16Channel, 4 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< float16Channel, 3 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< float32Channel, 4 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< float32Channel, 3 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< float32Channel, 1 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< float16Channel, 1 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< uInt16Channel, 1 > &p)
| RGBA = 1 - Luminance of input.
void | SetInvLuminance (const PixelType< uInt8Channel, 1 > &p)
| RGBA = 1 - Luminance of input.
## Friends
class | PixelType< uInt8Channel, 1 >
class | PixelType< uInt8Channel, 2 >
class | PixelType< uInt8Channel, 3 >
class | PixelType< uInt8Channel, 4 >
class | PixelType< uInt16Channel, 1 >
class | PixelType< uInt16Channel, 2 >
class | PixelType< uInt16Channel, 3 >
class | PixelType< uInt16Channel, 4 >
class | PixelType< float16Channel, 1 >
class | PixelType< float16Channel, 2 >
class | PixelType< float16Channel, 3 >
class | PixelType< float16Channel, 4 >
class | PixelType< float32Channel, 1 >
class | PixelType< float32Channel, 2 >
class | PixelType< float32Channel, 3 >
class | PixelType< float32Channel, 4 >

## Constructor & Destructor Documentation

PixelType | ( | const PixelType< uInt8Channel, 4 > & | p | ) | `[inline]`

conversion constructor

Definition at line 405 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = p.m_pixel[3]; // intentional fall through.
            case 1: m_pixel[0] = ChanType(uInt16Channel((uInt8)p.m_pixel[0]*77  +
                                                        (uInt8)p.m_pixel[1]*150 +
                                                        (uInt8)p.m_pixel[2]*28));
            break;
            // cppcheck mistakenly warns about array bounds here -- ignore it.
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2]; m_pixel[3] = p.m_pixel[3];
            break;
            }
        }

PixelType | ( | const PixelType< uInt8Channel, 3 > & | p | ) | `[inline]`

conversion constructor

Definition at line 424 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = ChanType( float32Channel( 1.0f ) ); // intentional fall through.
            case 1: m_pixel[0] = ChanType(uInt16Channel((uInt8)p.m_pixel[0]*77  +
                                                        (uInt8)p.m_pixel[1]*150 +
                                                        (uInt8)p.m_pixel[2]*28));
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
                    m_pixel[3] = ChanType(float32Channel(1.0f));
            break;
            }
        }

PixelType | ( | const PixelType< uInt8Channel, 2 > & | p | ) | `[inline]`

conversion constructor

Definition at line 443 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 1: m_pixel[0] = p.m_pixel[0];
            break;
            case 2: m_pixel[0] = p.m_pixel[0];
                    m_pixel[1] = p.m_pixel[1];
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
                    m_pixel[3] = p.m_pixel[1];
            break;
            }
        }

PixelType | ( | const PixelType< uInt8Channel, 1 > & | p | ) | `[inline]`

conversion constructor

Definition at line 462 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = ChanType( float32Channel( 1.0f ) ); // intentional fall through.
            case 1: m_pixel[0] = p.m_pixel[0];
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0]; m_pixel[3] = ChanType(float32Channel(1.0f)); ;
            break;
            }
        }

PixelType | ( | const PixelType< uInt16Channel, 4 > & | p | ) | `[inline]`

conversion constructor

Definition at line 479 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time

            case 2: m_pixel[1] = p.m_pixel[3]; // intentional fallthrough.
            case 1: m_pixel[0] = ChanType(uInt16Channel((((uInt16)p.m_pixel[0]*19660)>>16) +
                                                        (((uInt16)p.m_pixel[1]*38666)>>16) +
                                                        (((uInt16)p.m_pixel[2]*7209 )>>16)));
            break;

            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2]; m_pixel[3] = p.m_pixel[3];
            break;
            }
        }

PixelType | ( | const PixelType< uInt16Channel, 3 > & | p | ) | `[inline]`

conversion constructor

Definition at line 499 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = ChanType(float32Channel(1.0f)); // intentional fallthrough
            case 1: m_pixel[0] = ChanType(uInt16Channel((((uInt16)p.m_pixel[0]*19660)>>16) +
                                                        (((uInt16)p.m_pixel[1]*38666)>>16) +
                                                        (((uInt16)p.m_pixel[2]*7209 )>>16)));
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
                    m_pixel[3] = ChanType(float32Channel(1.0f));
            break;
            }
        }

PixelType | ( | const PixelType< uInt16Channel, 2 > & | p | ) | `[inline]`

conversion constructor

Definition at line 518 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 1: m_pixel[0] = p.m_pixel[0];
            break;
            case 2: m_pixel[0] = p.m_pixel[0];
                    m_pixel[1] = p.m_pixel[1];
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
                    m_pixel[3] = p.m_pixel[1];
            break;
            }
        }

PixelType | ( | const PixelType< uInt16Channel, 1 > & | p | ) | `[inline]`

conversion constructor

Definition at line 537 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = ChanType(float32Channel(1.0f)); // intentional fallthrough
            case 1: m_pixel[0] = p.m_pixel[0];
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0]; m_pixel[3] = ChanType(float32Channel(1.0f));
            break;
            }
        }

PixelType | ( | const PixelType< float16Channel, 4 > & | p | ) | `[inline]`

conversion constructor

Definition at line 554 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = p.m_pixel[1];
            case 1: m_pixel[0] = ChanType(float32Channel(((float)p.m_pixel[0]*0.30f) +
                                                         ((float)p.m_pixel[1]*0.59f) +
                                                         ((float)p.m_pixel[2]*0.11f)));
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2]; m_pixel[3] = p.m_pixel[3];
            break;
            }
        }

PixelType | ( | const PixelType< float16Channel, 3 > & | p | ) | `[inline]`

conversion constructor

Definition at line 572 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = ChanType(float32Channel(1.0f));
            case 1: m_pixel[0] = ChanType(float32Channel(((float)p.m_pixel[0]*0.30f) +
                                                         ((float)p.m_pixel[1]*0.59f) +
                                                         ((float)p.m_pixel[2]*0.11f)));
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
                    m_pixel[3] = ChanType(float32Channel(1.0f));
            break;
            }
        }

PixelType | ( | const PixelType< float16Channel, 2 > & | p | ) | `[inline]`

conversion constructor

Definition at line 591 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 1: m_pixel[0] = p.m_pixel[0];
            break;
            case 2: m_pixel[0] = p.m_pixel[0];
                    m_pixel[1] = p.m_pixel[1];
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
                    m_pixel[3] = p.m_pixel[1];
            break;
            }
        }

PixelType | ( | const PixelType< float16Channel, 1 > & | p | ) | `[inline]`

conversion constructor

Definition at line 610 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = ChanType(float32Channel(1.0f));
            case 1: m_pixel[0] = p.m_pixel[0];
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0]; m_pixel[3] = ChanType(float32Channel(1.0f));
            break;
            }
        }

PixelType | ( | const PixelType< float32Channel, 4 > & | p | ) | `[inline]`

conversion constructor

Definition at line 627 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = p.m_pixel[3];
            case 1: m_pixel[0] = ChanType(float32Channel(((float)p.m_pixel[0]*0.30f) +
                                                         ((float)p.m_pixel[1]*0.59f) +
                                                         ((float)p.m_pixel[2]*0.11f)));
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2]; m_pixel[3] = p.m_pixel[3];
            break;
            }
        }

PixelType | ( | const PixelType< float32Channel, 3 > & | p | ) | `[inline]`

conversion constructor

Definition at line 645 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = ChanType(float32Channel(1.0f));
            case 1: m_pixel[0] = ChanType(float32Channel(((float)p.m_pixel[0]*0.30f) +
                                                         ((float)p.m_pixel[1]*0.59f) +
                                                         ((float)p.m_pixel[2]*0.11f)));
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
                    m_pixel[2] = p.m_pixel[2];
                    m_pixel[3] = ChanType(float32Channel(1.0f));
            break;
            }
        }

PixelType | ( | const PixelType< float32Channel, 2 > & | p | ) | `[inline]`

conversion constructor

Definition at line 664 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 1: m_pixel[0] = p.m_pixel[0];
            break;
            case 2: m_pixel[0] = p.m_pixel[0];
                    m_pixel[1] = p.m_pixel[1];
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
                    m_pixel[3] = p.m_pixel[1];
            break;
            }
        }

PixelType | ( | const PixelType< float32Channel, 1 > & | p | ) | `[inline]`

conversion constructor

Definition at line 683 of file image.h.

        {
            switch (NumChans) { // this switch gets resolved at compile time
            case 2: m_pixel[1] = ChanType(float32Channel(1.0f));
            case 1: m_pixel[0] = p.m_pixel[0];
            break;
            case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0];
            break;
            case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
                    m_pixel[2] = p.m_pixel[0]; m_pixel[3] = ChanType(float32Channel(1.0f));
            break;
            }
        }

## Member Function Documentation

PixelType<ChanType, NumChans>& swapRB | ( |  | ) | `[inline]`

Search for all occurrences

Swap the red and blue channels -- converts RGBA to BGRA and back.

Definition at line 395 of file image.h.

                                                {
            if (NumChans > 2) { // conditional will be resolved at compile time.
                ChanType t = m_pixel[0];
                m_pixel[0] = m_pixel[2];
                m_pixel[2] = t;
            }
            return *this;
        }

void SetLuminance | ( | const PixelType< uInt8Channel, 4 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 699 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt16Channel(((uInt8)p.m_pixel[0]*77  +
                                                     (uInt8)p.m_pixel[1]*150 +
                                                     (uInt8)p.m_pixel[2]*28)));
            }
        }

void SetLuminance | ( | const PixelType< uInt8Channel, 3 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 710 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt16Channel(((uInt8)p.m_pixel[0]*77  +
                                                     (uInt8)p.m_pixel[1]*150 +
                                                     (uInt8)p.m_pixel[2]*28)));
            }
        }

void SetLuminance | ( | const PixelType< uInt16Channel, 4 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 721 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt16Channel(((((uInt16)p.m_pixel[0]*19660)>>16) +
                                                     (((uInt16)p.m_pixel[1]*38666)>>16) +
                                                     (((uInt16)p.m_pixel[2]*7209 )>>16))));
            }
        }

void SetLuminance | ( | const PixelType< uInt16Channel, 3 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 732 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt16Channel(((((uInt16)p.m_pixel[0]*19660)>>16) +
                                                     (((uInt16)p.m_pixel[1]*38666)>>16) +
                                                     (((uInt16)p.m_pixel[2]*7209 )>>16))));
            }
        }

void SetLuminance | ( | const PixelType< float16Channel, 4 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 744 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel((((float)p.m_pixel[0]*0.30f) +
                                                      ((float)p.m_pixel[1]*0.59f) +
                                                      ((float)p.m_pixel[2]*0.11f))));
            }
        }

void SetLuminance | ( | const PixelType< float16Channel, 3 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 755 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel((((float)p.m_pixel[0]*0.30f) +
                                                      ((float)p.m_pixel[1]*0.59f) +
                                                      ((float)p.m_pixel[2]*0.11f))));
            }
        }

void SetLuminance | ( | const PixelType< float32Channel, 4 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 766 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel((((float)p.m_pixel[0]*0.30f) +
                                                      ((float)p.m_pixel[1]*0.59f) +
                                                      ((float)p.m_pixel[2]*0.11f))));
            }
        }

void SetLuminance | ( | const PixelType< float32Channel, 3 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 777 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel((((float)p.m_pixel[0]*0.30f) +
                                                      ((float)p.m_pixel[1]*0.59f) +
                                                      ((float)p.m_pixel[2]*0.11f))));
            }
        }

void SetLuminance | ( | const PixelType< float32Channel, 1 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 788 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel(1.0f - ((float)p.m_pixel[0])));
            }
        }

void SetLuminance | ( | const PixelType< float16Channel, 1 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 797 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel(((float)p.m_pixel[0])));
            }
        }

void SetLuminance | ( | const PixelType< uInt16Channel, 1 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 806 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt16Channel(((uInt16)p.m_pixel[0])));
            }
        }

void SetLuminance | ( | const PixelType< uInt8Channel, 1 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = Luminance of input.

Definition at line 815 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt8Channel(((uInt8)p.m_pixel[0])));
            }
        }

void SetInvLuminance | ( | const PixelType< uInt8Channel, 4 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 825 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt16Channel(65535 -
                                                    ((uInt8)p.m_pixel[0]*77  +
                                                     (uInt8)p.m_pixel[1]*150 +
                                                     (uInt8)p.m_pixel[2]*28)));
            }
        }

void SetInvLuminance | ( | const PixelType< uInt8Channel, 3 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 837 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt16Channel(65535 -
                                                    ((uInt8)p.m_pixel[0]*77  +
                                                     (uInt8)p.m_pixel[1]*150 +
                                                     (uInt8)p.m_pixel[2]*28)));
            }
        }

void SetInvLuminance | ( | const PixelType< uInt16Channel, 4 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 849 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt16Channel(65535 -
                                                    ((((uInt16)p.m_pixel[0]*19660)>>16) +
                                                     (((uInt16)p.m_pixel[1]*38666)>>16) +
                                                     (((uInt16)p.m_pixel[2]*7209 )>>16))));
            }
        }

void SetInvLuminance | ( | const PixelType< uInt16Channel, 3 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 861 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt16Channel(65535 -
                                                    ((((uInt16)p.m_pixel[0]*19660)>>16) +
                                                     (((uInt16)p.m_pixel[1]*38666)>>16) +
                                                     (((uInt16)p.m_pixel[2]*7209 )>>16))));
            }
        }

void SetInvLuminance | ( | const PixelType< float16Channel, 4 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 874 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel(1.0f -
                                                     (((float)p.m_pixel[0]*0.30f) +
                                                      ((float)p.m_pixel[1]*0.59f) +
                                                      ((float)p.m_pixel[2]*0.11f))));
            }
        }

void SetInvLuminance | ( | const PixelType< float16Channel, 3 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 886 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel(1.0f -
                                                     (((float)p.m_pixel[0]*0.30f) +
                                                      ((float)p.m_pixel[1]*0.59f) +
                                                      ((float)p.m_pixel[2]*0.11f))));
            }
        }

void SetInvLuminance | ( | const PixelType< float32Channel, 4 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 898 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel(1.0f -
                                                     (((float)p.m_pixel[0]*0.30f) +
                                                      ((float)p.m_pixel[1]*0.59f) +
                                                      ((float)p.m_pixel[2]*0.11f))));
            }
        }

void SetInvLuminance | ( | const PixelType< float32Channel, 3 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 910 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel(1.0f - (((float)p.m_pixel[0]*0.30f) +
                                                             ((float)p.m_pixel[1]*0.59f) +
                                                             ((float)p.m_pixel[2]*0.11f))));
            }
        }

void SetInvLuminance | ( | const PixelType< float32Channel, 1 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 921 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel(1.0f - ((float)p.m_pixel[0])));
            }
        }

void SetInvLuminance | ( | const PixelType< float16Channel, 1 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 930 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(float32Channel(1.0f - ((float)p.m_pixel[0])));
            }
        }

void SetInvLuminance | ( | const PixelType< uInt16Channel, 1 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 939 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt16Channel(65535 - ((uInt16)p.m_pixel[0])));
            }
        }

void SetInvLuminance | ( | const PixelType< uInt8Channel, 1 > & | p | ) | `[inline]`

Search for all occurrences

RGBA = 1 - Luminance of input.

Definition at line 948 of file image.h.

        {
            if (NumChans == 4) {
                m_pixel[0] = m_pixel[1] = m_pixel[2] =
                m_pixel[3] = ChanType(uInt8Channel(255 - ((uInt8)p.m_pixel[0])));
            }
        }

## Friends And Related Function Documentation

friend class PixelType< uInt8Channel,1 > `[friend]`

Search for all occurrences

Definition at line 372 of file image.h.

friend class PixelType< uInt8Channel,2 > `[friend]`

Search for all occurrences

Definition at line 373 of file image.h.

friend class PixelType< uInt8Channel,3 > `[friend]`

Search for all occurrences

Definition at line 374 of file image.h.

friend class PixelType< uInt8Channel,4 > `[friend]`

Search for all occurrences

Definition at line 375 of file image.h.

friend class PixelType< uInt16Channel,1 > `[friend]`

Search for all occurrences

Definition at line 376 of file image.h.

friend class PixelType< uInt16Channel,2 > `[friend]`

Search for all occurrences

Definition at line 377 of file image.h.

friend class PixelType< uInt16Channel,3 > `[friend]`

Search for all occurrences

Definition at line 378 of file image.h.

friend class PixelType< uInt16Channel,4 > `[friend]`

Search for all occurrences

Definition at line 379 of file image.h.

friend class PixelType< float16Channel, 1 > `[friend]`

Search for all occurrences

Definition at line 380 of file image.h.

friend class PixelType< float16Channel, 2 > `[friend]`

Search for all occurrences

Definition at line 381 of file image.h.

friend class PixelType< float16Channel, 3 > `[friend]`

Search for all occurrences

Definition at line 382 of file image.h.

friend class PixelType< float16Channel, 4 > `[friend]`

Search for all occurrences

Definition at line 383 of file image.h.

friend class PixelType< float32Channel, 1 > `[friend]`

Search for all occurrences

Definition at line 384 of file image.h.

friend class PixelType< float32Channel, 2 > `[friend]`

Search for all occurrences

Definition at line 385 of file image.h.

friend class PixelType< float32Channel, 3 > `[friend]`

Search for all occurrences

Definition at line 386 of file image.h.

friend class PixelType< float32Channel, 4 > `[friend]`

Search for all occurrences

Definition at line 387 of file image.h.

The documentation for this class was generated from the following file:

- Mudbox/image.h