PixelType< ChanType, NumChans > Class Template Reference

PixelType< ChanType, NumChans > Class Template Reference

#include <image.h>

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

Public Member Functions

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

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.

406  {
407  switch (NumChans) { // this switch gets resolved at compile time
408  case 2: m_pixel[1] = p.m_pixel[3]; // intentional fall through.
409  case 1: m_pixel[0] = ChanType(uInt16Channel((uInt8)p.m_pixel[0]*77 +
410  (uInt8)p.m_pixel[1]*150 +
411  (uInt8)p.m_pixel[2]*28));
412  break;
413  // cppcheck mistakenly warns about array bounds here -- ignore it.
414  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
415  m_pixel[2] = p.m_pixel[2];
416  break;
417  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
418  m_pixel[2] = p.m_pixel[2]; m_pixel[3] = p.m_pixel[3];
419  break;
420  }
421  }
unsigned char uInt8
Definition: image.h:87
GLfloat GLfloat p
Definition: GLee.h:5416
PixelType ( const PixelType< uInt8Channel, 3 > &  p)
inline

conversion constructor

Definition at line 424 of file image.h.

425  {
426  switch (NumChans) { // this switch gets resolved at compile time
427  case 2: m_pixel[1] = ChanType( float32Channel( 1.0f ) ); // intentional fall through.
428  case 1: m_pixel[0] = ChanType(uInt16Channel((uInt8)p.m_pixel[0]*77 +
429  (uInt8)p.m_pixel[1]*150 +
430  (uInt8)p.m_pixel[2]*28));
431  break;
432  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
433  m_pixel[2] = p.m_pixel[2];
434  break;
435  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
436  m_pixel[2] = p.m_pixel[2];
437  m_pixel[3] = ChanType(float32Channel(1.0f));
438  break;
439  }
440  }
unsigned char uInt8
Definition: image.h:87
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
PixelType ( const PixelType< uInt8Channel, 2 > &  p)
inline

conversion constructor

Definition at line 443 of file image.h.

444  {
445  switch (NumChans) { // this switch gets resolved at compile time
446  case 1: m_pixel[0] = p.m_pixel[0];
447  break;
448  case 2: m_pixel[0] = p.m_pixel[0];
449  m_pixel[1] = p.m_pixel[1];
450  break;
451  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
452  m_pixel[2] = p.m_pixel[0];
453  break;
454  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
455  m_pixel[2] = p.m_pixel[0];
456  m_pixel[3] = p.m_pixel[1];
457  break;
458  }
459  }
GLfloat GLfloat p
Definition: GLee.h:5416
PixelType ( const PixelType< uInt8Channel, 1 > &  p)
inline

conversion constructor

Definition at line 462 of file image.h.

463  {
464  switch (NumChans) { // this switch gets resolved at compile time
465  case 2: m_pixel[1] = ChanType( float32Channel( 1.0f ) ); // intentional fall through.
466  case 1: m_pixel[0] = p.m_pixel[0];
467  break;
468  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
469  m_pixel[2] = p.m_pixel[0];
470  break;
471  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
472  m_pixel[2] = p.m_pixel[0]; m_pixel[3] = ChanType(float32Channel(1.0f)); ;
473  break;
474  }
475  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
PixelType ( const PixelType< uInt16Channel, 4 > &  p)
inline

conversion constructor

Definition at line 479 of file image.h.

480  {
481  switch (NumChans) { // this switch gets resolved at compile time
482 
483  case 2: m_pixel[1] = p.m_pixel[3]; // intentional fallthrough.
484  case 1: m_pixel[0] = ChanType(uInt16Channel((((uInt16)p.m_pixel[0]*19660)>>16) +
485  (((uInt16)p.m_pixel[1]*38666)>>16) +
486  (((uInt16)p.m_pixel[2]*7209 )>>16)));
487  break;
488 
489  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
490  m_pixel[2] = p.m_pixel[2];
491  break;
492  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
493  m_pixel[2] = p.m_pixel[2]; m_pixel[3] = p.m_pixel[3];
494  break;
495  }
496  }
GLfloat GLfloat p
Definition: GLee.h:5416
unsigned short uInt16
Definition: image.h:88
PixelType ( const PixelType< uInt16Channel, 3 > &  p)
inline

conversion constructor

Definition at line 499 of file image.h.

500  {
501  switch (NumChans) { // this switch gets resolved at compile time
502  case 2: m_pixel[1] = ChanType(float32Channel(1.0f)); // intentional fallthrough
503  case 1: m_pixel[0] = ChanType(uInt16Channel((((uInt16)p.m_pixel[0]*19660)>>16) +
504  (((uInt16)p.m_pixel[1]*38666)>>16) +
505  (((uInt16)p.m_pixel[2]*7209 )>>16)));
506  break;
507  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
508  m_pixel[2] = p.m_pixel[2];
509  break;
510  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
511  m_pixel[2] = p.m_pixel[2];
512  m_pixel[3] = ChanType(float32Channel(1.0f));
513  break;
514  }
515  }
GLfloat GLfloat p
Definition: GLee.h:5416
unsigned short uInt16
Definition: image.h:88
GLclampf f
Definition: GLee.h:9303
PixelType ( const PixelType< uInt16Channel, 2 > &  p)
inline

conversion constructor

Definition at line 518 of file image.h.

519  {
520  switch (NumChans) { // this switch gets resolved at compile time
521  case 1: m_pixel[0] = p.m_pixel[0];
522  break;
523  case 2: m_pixel[0] = p.m_pixel[0];
524  m_pixel[1] = p.m_pixel[1];
525  break;
526  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
527  m_pixel[2] = p.m_pixel[0];
528  break;
529  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
530  m_pixel[2] = p.m_pixel[0];
531  m_pixel[3] = p.m_pixel[1];
532  break;
533  }
534  }
GLfloat GLfloat p
Definition: GLee.h:5416
PixelType ( const PixelType< uInt16Channel, 1 > &  p)
inline

conversion constructor

Definition at line 537 of file image.h.

538  {
539  switch (NumChans) { // this switch gets resolved at compile time
540  case 2: m_pixel[1] = ChanType(float32Channel(1.0f)); // intentional fallthrough
541  case 1: m_pixel[0] = p.m_pixel[0];
542  break;
543  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
544  m_pixel[2] = p.m_pixel[0];
545  break;
546  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
547  m_pixel[2] = p.m_pixel[0]; m_pixel[3] = ChanType(float32Channel(1.0f));
548  break;
549  }
550  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
PixelType ( const PixelType< float16Channel, 4 > &  p)
inline

conversion constructor

Definition at line 554 of file image.h.

555  {
556  switch (NumChans) { // this switch gets resolved at compile time
557  case 2: m_pixel[1] = p.m_pixel[1];
558  case 1: m_pixel[0] = ChanType(float32Channel(((float)p.m_pixel[0]*0.30f) +
559  ((float)p.m_pixel[1]*0.59f) +
560  ((float)p.m_pixel[2]*0.11f)));
561  break;
562  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
563  m_pixel[2] = p.m_pixel[2];
564  break;
565  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
566  m_pixel[2] = p.m_pixel[2]; m_pixel[3] = p.m_pixel[3];
567  break;
568  }
569  }
GLfloat GLfloat p
Definition: GLee.h:5416
PixelType ( const PixelType< float16Channel, 3 > &  p)
inline

conversion constructor

Definition at line 572 of file image.h.

573  {
574  switch (NumChans) { // this switch gets resolved at compile time
575  case 2: m_pixel[1] = ChanType(float32Channel(1.0f));
576  case 1: m_pixel[0] = ChanType(float32Channel(((float)p.m_pixel[0]*0.30f) +
577  ((float)p.m_pixel[1]*0.59f) +
578  ((float)p.m_pixel[2]*0.11f)));
579  break;
580  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
581  m_pixel[2] = p.m_pixel[2];
582  break;
583  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
584  m_pixel[2] = p.m_pixel[2];
585  m_pixel[3] = ChanType(float32Channel(1.0f));
586  break;
587  }
588  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
PixelType ( const PixelType< float16Channel, 2 > &  p)
inline

conversion constructor

Definition at line 591 of file image.h.

592  {
593  switch (NumChans) { // this switch gets resolved at compile time
594  case 1: m_pixel[0] = p.m_pixel[0];
595  break;
596  case 2: m_pixel[0] = p.m_pixel[0];
597  m_pixel[1] = p.m_pixel[1];
598  break;
599  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
600  m_pixel[2] = p.m_pixel[0];
601  break;
602  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
603  m_pixel[2] = p.m_pixel[0];
604  m_pixel[3] = p.m_pixel[1];
605  break;
606  }
607  }
GLfloat GLfloat p
Definition: GLee.h:5416
PixelType ( const PixelType< float16Channel, 1 > &  p)
inline

conversion constructor

Definition at line 610 of file image.h.

611  {
612  switch (NumChans) { // this switch gets resolved at compile time
613  case 2: m_pixel[1] = ChanType(float32Channel(1.0f));
614  case 1: m_pixel[0] = p.m_pixel[0];
615  break;
616  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
617  m_pixel[2] = p.m_pixel[0];
618  break;
619  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
620  m_pixel[2] = p.m_pixel[0]; m_pixel[3] = ChanType(float32Channel(1.0f));
621  break;
622  }
623  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
PixelType ( const PixelType< float32Channel, 4 > &  p)
inline

conversion constructor

Definition at line 627 of file image.h.

628  {
629  switch (NumChans) { // this switch gets resolved at compile time
630  case 2: m_pixel[1] = p.m_pixel[3];
631  case 1: m_pixel[0] = ChanType(float32Channel(((float)p.m_pixel[0]*0.30f) +
632  ((float)p.m_pixel[1]*0.59f) +
633  ((float)p.m_pixel[2]*0.11f)));
634  break;
635  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
636  m_pixel[2] = p.m_pixel[2];
637  break;
638  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
639  m_pixel[2] = p.m_pixel[2]; m_pixel[3] = p.m_pixel[3];
640  break;
641  }
642  }
GLfloat GLfloat p
Definition: GLee.h:5416
PixelType ( const PixelType< float32Channel, 3 > &  p)
inline

conversion constructor

Definition at line 645 of file image.h.

646  {
647  switch (NumChans) { // this switch gets resolved at compile time
648  case 2: m_pixel[1] = ChanType(float32Channel(1.0f));
649  case 1: m_pixel[0] = ChanType(float32Channel(((float)p.m_pixel[0]*0.30f) +
650  ((float)p.m_pixel[1]*0.59f) +
651  ((float)p.m_pixel[2]*0.11f)));
652  break;
653  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
654  m_pixel[2] = p.m_pixel[2];
655  break;
656  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[1];
657  m_pixel[2] = p.m_pixel[2];
658  m_pixel[3] = ChanType(float32Channel(1.0f));
659  break;
660  }
661  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
PixelType ( const PixelType< float32Channel, 2 > &  p)
inline

conversion constructor

Definition at line 664 of file image.h.

665  {
666  switch (NumChans) { // this switch gets resolved at compile time
667  case 1: m_pixel[0] = p.m_pixel[0];
668  break;
669  case 2: m_pixel[0] = p.m_pixel[0];
670  m_pixel[1] = p.m_pixel[1];
671  break;
672  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
673  m_pixel[2] = p.m_pixel[0];
674  break;
675  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
676  m_pixel[2] = p.m_pixel[0];
677  m_pixel[3] = p.m_pixel[1];
678  break;
679  }
680  }
GLfloat GLfloat p
Definition: GLee.h:5416
PixelType ( const PixelType< float32Channel, 1 > &  p)
inline

conversion constructor

Definition at line 683 of file image.h.

684  {
685  switch (NumChans) { // this switch gets resolved at compile time
686  case 2: m_pixel[1] = ChanType(float32Channel(1.0f));
687  case 1: m_pixel[0] = p.m_pixel[0];
688  break;
689  case 3: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
690  m_pixel[2] = p.m_pixel[0];
691  break;
692  case 4: m_pixel[0] = p.m_pixel[0]; m_pixel[1] = p.m_pixel[0];
693  m_pixel[2] = p.m_pixel[0]; m_pixel[3] = ChanType(float32Channel(1.0f));
694  break;
695  }
696  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303

Member Function Documentation

PixelType<ChanType, NumChans>& swapRB ( )
inline

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

Definition at line 395 of file image.h.

395  {
396  if (NumChans > 2) { // conditional will be resolved at compile time.
397  ChanType t = m_pixel[0];
398  m_pixel[0] = m_pixel[2];
399  m_pixel[2] = t;
400  }
401  return *this;
402  }
GLdouble GLdouble t
Definition: GLee.h:1181
void SetLuminance ( const PixelType< uInt8Channel, 4 > &  p)
inline

RGBA = Luminance of input.

Definition at line 699 of file image.h.

700  {
701  if (NumChans == 4) {
702  m_pixel[0] = m_pixel[1] = m_pixel[2] =
703  m_pixel[3] = ChanType(uInt16Channel(((uInt8)p.m_pixel[0]*77 +
704  (uInt8)p.m_pixel[1]*150 +
705  (uInt8)p.m_pixel[2]*28)));
706  }
707  }
unsigned char uInt8
Definition: image.h:87
GLfloat GLfloat p
Definition: GLee.h:5416
void SetLuminance ( const PixelType< uInt8Channel, 3 > &  p)
inline

RGBA = Luminance of input.

Definition at line 710 of file image.h.

711  {
712  if (NumChans == 4) {
713  m_pixel[0] = m_pixel[1] = m_pixel[2] =
714  m_pixel[3] = ChanType(uInt16Channel(((uInt8)p.m_pixel[0]*77 +
715  (uInt8)p.m_pixel[1]*150 +
716  (uInt8)p.m_pixel[2]*28)));
717  }
718  }
unsigned char uInt8
Definition: image.h:87
GLfloat GLfloat p
Definition: GLee.h:5416
void SetLuminance ( const PixelType< uInt16Channel, 4 > &  p)
inline

RGBA = Luminance of input.

Definition at line 721 of file image.h.

722  {
723  if (NumChans == 4) {
724  m_pixel[0] = m_pixel[1] = m_pixel[2] =
725  m_pixel[3] = ChanType(uInt16Channel(((((uInt16)p.m_pixel[0]*19660)>>16) +
726  (((uInt16)p.m_pixel[1]*38666)>>16) +
727  (((uInt16)p.m_pixel[2]*7209 )>>16))));
728  }
729  }
GLfloat GLfloat p
Definition: GLee.h:5416
unsigned short uInt16
Definition: image.h:88
void SetLuminance ( const PixelType< uInt16Channel, 3 > &  p)
inline

RGBA = Luminance of input.

Definition at line 732 of file image.h.

733  {
734  if (NumChans == 4) {
735  m_pixel[0] = m_pixel[1] = m_pixel[2] =
736  m_pixel[3] = ChanType(uInt16Channel(((((uInt16)p.m_pixel[0]*19660)>>16) +
737  (((uInt16)p.m_pixel[1]*38666)>>16) +
738  (((uInt16)p.m_pixel[2]*7209 )>>16))));
739  }
740  }
GLfloat GLfloat p
Definition: GLee.h:5416
unsigned short uInt16
Definition: image.h:88
void SetLuminance ( const PixelType< float16Channel, 4 > &  p)
inline

RGBA = Luminance of input.

Definition at line 744 of file image.h.

745  {
746  if (NumChans == 4) {
747  m_pixel[0] = m_pixel[1] = m_pixel[2] =
748  m_pixel[3] = ChanType(float32Channel((((float)p.m_pixel[0]*0.30f) +
749  ((float)p.m_pixel[1]*0.59f) +
750  ((float)p.m_pixel[2]*0.11f))));
751  }
752  }
GLfloat GLfloat p
Definition: GLee.h:5416
void SetLuminance ( const PixelType< float16Channel, 3 > &  p)
inline

RGBA = Luminance of input.

Definition at line 755 of file image.h.

756  {
757  if (NumChans == 4) {
758  m_pixel[0] = m_pixel[1] = m_pixel[2] =
759  m_pixel[3] = ChanType(float32Channel((((float)p.m_pixel[0]*0.30f) +
760  ((float)p.m_pixel[1]*0.59f) +
761  ((float)p.m_pixel[2]*0.11f))));
762  }
763  }
GLfloat GLfloat p
Definition: GLee.h:5416
void SetLuminance ( const PixelType< float32Channel, 4 > &  p)
inline

RGBA = Luminance of input.

Definition at line 766 of file image.h.

767  {
768  if (NumChans == 4) {
769  m_pixel[0] = m_pixel[1] = m_pixel[2] =
770  m_pixel[3] = ChanType(float32Channel((((float)p.m_pixel[0]*0.30f) +
771  ((float)p.m_pixel[1]*0.59f) +
772  ((float)p.m_pixel[2]*0.11f))));
773  }
774  }
GLfloat GLfloat p
Definition: GLee.h:5416
void SetLuminance ( const PixelType< float32Channel, 3 > &  p)
inline

RGBA = Luminance of input.

Definition at line 777 of file image.h.

778  {
779  if (NumChans == 4) {
780  m_pixel[0] = m_pixel[1] = m_pixel[2] =
781  m_pixel[3] = ChanType(float32Channel((((float)p.m_pixel[0]*0.30f) +
782  ((float)p.m_pixel[1]*0.59f) +
783  ((float)p.m_pixel[2]*0.11f))));
784  }
785  }
GLfloat GLfloat p
Definition: GLee.h:5416
void SetLuminance ( const PixelType< float32Channel, 1 > &  p)
inline

RGBA = Luminance of input.

Definition at line 788 of file image.h.

789  {
790  if (NumChans == 4) {
791  m_pixel[0] = m_pixel[1] = m_pixel[2] =
792  m_pixel[3] = ChanType(float32Channel(1.0f - ((float)p.m_pixel[0])));
793  }
794  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
void SetLuminance ( const PixelType< float16Channel, 1 > &  p)
inline

RGBA = Luminance of input.

Definition at line 797 of file image.h.

798  {
799  if (NumChans == 4) {
800  m_pixel[0] = m_pixel[1] = m_pixel[2] =
801  m_pixel[3] = ChanType(float32Channel(((float)p.m_pixel[0])));
802  }
803  }
GLfloat GLfloat p
Definition: GLee.h:5416
void SetLuminance ( const PixelType< uInt16Channel, 1 > &  p)
inline

RGBA = Luminance of input.

Definition at line 806 of file image.h.

807  {
808  if (NumChans == 4) {
809  m_pixel[0] = m_pixel[1] = m_pixel[2] =
810  m_pixel[3] = ChanType(uInt16Channel(((uInt16)p.m_pixel[0])));
811  }
812  }
GLfloat GLfloat p
Definition: GLee.h:5416
unsigned short uInt16
Definition: image.h:88
void SetLuminance ( const PixelType< uInt8Channel, 1 > &  p)
inline

RGBA = Luminance of input.

Definition at line 815 of file image.h.

816  {
817  if (NumChans == 4) {
818  m_pixel[0] = m_pixel[1] = m_pixel[2] =
819  m_pixel[3] = ChanType(uInt8Channel(((uInt8)p.m_pixel[0])));
820  }
821  }
unsigned char uInt8
Definition: image.h:87
GLfloat GLfloat p
Definition: GLee.h:5416
void SetInvLuminance ( const PixelType< uInt8Channel, 4 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 825 of file image.h.

826  {
827  if (NumChans == 4) {
828  m_pixel[0] = m_pixel[1] = m_pixel[2] =
829  m_pixel[3] = ChanType(uInt16Channel(65535 -
830  ((uInt8)p.m_pixel[0]*77 +
831  (uInt8)p.m_pixel[1]*150 +
832  (uInt8)p.m_pixel[2]*28)));
833  }
834  }
unsigned char uInt8
Definition: image.h:87
GLfloat GLfloat p
Definition: GLee.h:5416
void SetInvLuminance ( const PixelType< uInt8Channel, 3 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 837 of file image.h.

838  {
839  if (NumChans == 4) {
840  m_pixel[0] = m_pixel[1] = m_pixel[2] =
841  m_pixel[3] = ChanType(uInt16Channel(65535 -
842  ((uInt8)p.m_pixel[0]*77 +
843  (uInt8)p.m_pixel[1]*150 +
844  (uInt8)p.m_pixel[2]*28)));
845  }
846  }
unsigned char uInt8
Definition: image.h:87
GLfloat GLfloat p
Definition: GLee.h:5416
void SetInvLuminance ( const PixelType< uInt16Channel, 4 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 849 of file image.h.

850  {
851  if (NumChans == 4) {
852  m_pixel[0] = m_pixel[1] = m_pixel[2] =
853  m_pixel[3] = ChanType(uInt16Channel(65535 -
854  ((((uInt16)p.m_pixel[0]*19660)>>16) +
855  (((uInt16)p.m_pixel[1]*38666)>>16) +
856  (((uInt16)p.m_pixel[2]*7209 )>>16))));
857  }
858  }
GLfloat GLfloat p
Definition: GLee.h:5416
unsigned short uInt16
Definition: image.h:88
void SetInvLuminance ( const PixelType< uInt16Channel, 3 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 861 of file image.h.

862  {
863  if (NumChans == 4) {
864  m_pixel[0] = m_pixel[1] = m_pixel[2] =
865  m_pixel[3] = ChanType(uInt16Channel(65535 -
866  ((((uInt16)p.m_pixel[0]*19660)>>16) +
867  (((uInt16)p.m_pixel[1]*38666)>>16) +
868  (((uInt16)p.m_pixel[2]*7209 )>>16))));
869  }
870  }
GLfloat GLfloat p
Definition: GLee.h:5416
unsigned short uInt16
Definition: image.h:88
void SetInvLuminance ( const PixelType< float16Channel, 4 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 874 of file image.h.

875  {
876  if (NumChans == 4) {
877  m_pixel[0] = m_pixel[1] = m_pixel[2] =
878  m_pixel[3] = ChanType(float32Channel(1.0f -
879  (((float)p.m_pixel[0]*0.30f) +
880  ((float)p.m_pixel[1]*0.59f) +
881  ((float)p.m_pixel[2]*0.11f))));
882  }
883  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
void SetInvLuminance ( const PixelType< float16Channel, 3 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 886 of file image.h.

887  {
888  if (NumChans == 4) {
889  m_pixel[0] = m_pixel[1] = m_pixel[2] =
890  m_pixel[3] = ChanType(float32Channel(1.0f -
891  (((float)p.m_pixel[0]*0.30f) +
892  ((float)p.m_pixel[1]*0.59f) +
893  ((float)p.m_pixel[2]*0.11f))));
894  }
895  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
void SetInvLuminance ( const PixelType< float32Channel, 4 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 898 of file image.h.

899  {
900  if (NumChans == 4) {
901  m_pixel[0] = m_pixel[1] = m_pixel[2] =
902  m_pixel[3] = ChanType(float32Channel(1.0f -
903  (((float)p.m_pixel[0]*0.30f) +
904  ((float)p.m_pixel[1]*0.59f) +
905  ((float)p.m_pixel[2]*0.11f))));
906  }
907  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
void SetInvLuminance ( const PixelType< float32Channel, 3 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 910 of file image.h.

911  {
912  if (NumChans == 4) {
913  m_pixel[0] = m_pixel[1] = m_pixel[2] =
914  m_pixel[3] = ChanType(float32Channel(1.0f - (((float)p.m_pixel[0]*0.30f) +
915  ((float)p.m_pixel[1]*0.59f) +
916  ((float)p.m_pixel[2]*0.11f))));
917  }
918  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
void SetInvLuminance ( const PixelType< float32Channel, 1 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 921 of file image.h.

922  {
923  if (NumChans == 4) {
924  m_pixel[0] = m_pixel[1] = m_pixel[2] =
925  m_pixel[3] = ChanType(float32Channel(1.0f - ((float)p.m_pixel[0])));
926  }
927  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
void SetInvLuminance ( const PixelType< float16Channel, 1 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 930 of file image.h.

931  {
932  if (NumChans == 4) {
933  m_pixel[0] = m_pixel[1] = m_pixel[2] =
934  m_pixel[3] = ChanType(float32Channel(1.0f - ((float)p.m_pixel[0])));
935  }
936  }
GLfloat GLfloat p
Definition: GLee.h:5416
GLclampf f
Definition: GLee.h:9303
void SetInvLuminance ( const PixelType< uInt16Channel, 1 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 939 of file image.h.

940  {
941  if (NumChans == 4) {
942  m_pixel[0] = m_pixel[1] = m_pixel[2] =
943  m_pixel[3] = ChanType(uInt16Channel(65535 - ((uInt16)p.m_pixel[0])));
944  }
945  }
GLfloat GLfloat p
Definition: GLee.h:5416
unsigned short uInt16
Definition: image.h:88
void SetInvLuminance ( const PixelType< uInt8Channel, 1 > &  p)
inline

RGBA = 1 - Luminance of input.

Definition at line 948 of file image.h.

949  {
950  if (NumChans == 4) {
951  m_pixel[0] = m_pixel[1] = m_pixel[2] =
952  m_pixel[3] = ChanType(uInt8Channel(255 - ((uInt8)p.m_pixel[0])));
953  }
954  }
unsigned char uInt8
Definition: image.h:87
GLfloat GLfloat p
Definition: GLee.h:5416

Friends And Related Function Documentation

friend class PixelType< uInt8Channel, 1 >
friend

Definition at line 372 of file image.h.

friend class PixelType< uInt8Channel, 2 >
friend

Definition at line 373 of file image.h.

friend class PixelType< uInt8Channel, 3 >
friend

Definition at line 374 of file image.h.

friend class PixelType< uInt8Channel, 4 >
friend

Definition at line 375 of file image.h.

friend class PixelType< uInt16Channel, 1 >
friend

Definition at line 376 of file image.h.

friend class PixelType< uInt16Channel, 2 >
friend

Definition at line 377 of file image.h.

friend class PixelType< uInt16Channel, 3 >
friend

Definition at line 378 of file image.h.

friend class PixelType< uInt16Channel, 4 >
friend

Definition at line 379 of file image.h.

friend class PixelType< float16Channel, 1 >
friend

Definition at line 380 of file image.h.

friend class PixelType< float16Channel, 2 >
friend

Definition at line 381 of file image.h.

friend class PixelType< float16Channel, 3 >
friend

Definition at line 382 of file image.h.

friend class PixelType< float16Channel, 4 >
friend

Definition at line 383 of file image.h.

friend class PixelType< float32Channel, 1 >
friend

Definition at line 384 of file image.h.

friend class PixelType< float32Channel, 2 >
friend

Definition at line 385 of file image.h.

friend class PixelType< float32Channel, 3 >
friend

Definition at line 386 of file image.h.

friend class PixelType< float32Channel, 4 >
friend

Definition at line 387 of file image.h.


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