PixelType< ChanType, NumChans > Class Template Reference


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, 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, 1 > &p)
  conversion constructor
  PixelType (const PixelType< uInt16Channel, 4 > &p)
  conversion constructor
  PixelType (const PixelType< uInt16Channel, 3 > &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, 1 > &p)
  conversion constructor
  PixelType (const PixelType< float32Channel, 4 > &p)
  conversion constructor
  PixelType (const PixelType< float32Channel, 3 > &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, 3 >
class  PixelType< uInt8Channel, 4 >
class  PixelType< uInt16Channel, 1 >
class  PixelType< uInt16Channel, 3 >
class  PixelType< uInt16Channel, 4 >
class  PixelType< float16Channel, 1 >
class  PixelType< float16Channel, 3 >
class  PixelType< float16Channel, 4 >
class  PixelType< float32Channel, 1 >
class  PixelType< float32Channel, 3 >
class  PixelType< float32Channel, 4 >

Constructor & Destructor Documentation

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

conversion constructor

Definition at line 401 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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 419 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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, 1 > &  p ) [inline]

conversion constructor

Definition at line 437 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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 453 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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 470 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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, 1 > &  p ) [inline]

conversion constructor

Definition at line 488 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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 504 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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 521 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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, 1 > &  p ) [inline]

conversion constructor

Definition at line 539 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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 555 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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 572 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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, 1 > &  p ) [inline]

conversion constructor

Definition at line 590 of file image.h.

    {
        switch (NumChans) { // this switch gets resolved at compile time
        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]

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

Definition at line 391 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]

RGBA = Luminance of input.

Definition at line 606 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]

RGBA = Luminance of input.

Definition at line 617 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]

RGBA = Luminance of input.

Definition at line 628 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]

RGBA = Luminance of input.

Definition at line 639 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]

RGBA = Luminance of input.

Definition at line 651 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]

RGBA = Luminance of input.

Definition at line 662 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]

RGBA = Luminance of input.

Definition at line 673 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]

RGBA = Luminance of input.

Definition at line 684 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]

RGBA = Luminance of input.

Definition at line 695 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]

RGBA = Luminance of input.

Definition at line 704 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]

RGBA = Luminance of input.

Definition at line 713 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]

RGBA = Luminance of input.

Definition at line 722 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]

RGBA = 1 - 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(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]

RGBA = 1 - 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(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]

RGBA = 1 - Luminance of input.

Definition at line 756 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]

RGBA = 1 - Luminance of input.

Definition at line 768 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]

RGBA = 1 - Luminance of input.

Definition at line 781 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]

RGBA = 1 - Luminance of input.

Definition at line 793 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]

RGBA = 1 - Luminance of input.

Definition at line 805 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]

RGBA = 1 - Luminance of input.

Definition at line 817 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]

RGBA = 1 - Luminance of input.

Definition at line 828 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]

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(float32Channel(1.0f - ((float)p.m_pixel[0])));
        }
    }
void SetInvLuminance ( const PixelType< uInt16Channel, 1 > &  p ) [inline]

RGBA = 1 - Luminance of input.

Definition at line 846 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]

RGBA = 1 - Luminance of input.

Definition at line 855 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]

Definition at line 372 of file image.h.

friend class PixelType< uInt8Channel,3 > [friend]

Definition at line 373 of file image.h.

friend class PixelType< uInt8Channel,4 > [friend]

Definition at line 374 of file image.h.

friend class PixelType< uInt16Channel,1 > [friend]

Definition at line 375 of file image.h.

friend class PixelType< uInt16Channel,3 > [friend]

Definition at line 376 of file image.h.

friend class PixelType< uInt16Channel,4 > [friend]

Definition at line 377 of file image.h.

friend class PixelType< float16Channel, 1 > [friend]

Definition at line 378 of file image.h.

friend class PixelType< float16Channel, 3 > [friend]

Definition at line 379 of file image.h.

friend class PixelType< float16Channel, 4 > [friend]

Definition at line 380 of file image.h.

friend class PixelType< float32Channel, 1 > [friend]

Definition at line 381 of file image.h.

friend class PixelType< float32Channel, 3 > [friend]

Definition at line 382 of file image.h.

friend class PixelType< float32Channel, 4 > [friend]

Definition at line 383 of file image.h.


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