Orfeo Toolbox  4.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
itk::RGBPixel< TComponent > Class Template Reference

Represent Red, Green and Blue components for color images. More...

#include <itkRGBPixel.h>

+ Inheritance diagram for itk::RGBPixel< TComponent >:
+ Collaboration diagram for itk::RGBPixel< TComponent >:

Public Types

typedef FixedArray< TComponent, 3 > BaseArray
 
typedef ValueType CArray [VLength]
 
typedef TComponent ComponentType
 
typedef const ValueTypeconst_pointer
 
typedef const ValueTypeconst_reference
 
typedef const ValueTypeConstIterator
 
typedef ValueTypeIterator
 
typedef NumericTraits
< ComponentType >::RealType 
LuminanceType
 
typedef ValueTypepointer
 
typedef ValueTypereference
 
typedef RGBPixel Self
 
typedef unsigned int SizeType
 
typedef FixedArray< TComponent, 3 > Superclass
 
typedef TComponent ValueType
 

Public Member Functions

 RGBPixel ()
 
 RGBPixel (const ComponentType &r)
 
template<typename TRGBPixelValueType >
 RGBPixel (const RGBPixel< TRGBPixelValueType > &r)
 
 RGBPixel (const ComponentType r[3])
 
Iterator Begin ()
 
ConstIterator Begin () const
 
Iterator End ()
 
ConstIterator End () const
 
void Fill (const ValueType &)
 
const ComponentTypeGetBlue (void) const
 
ValueTypeGetDataPointer ()
 
const ValueTypeGetDataPointer () const
 
const_reference GetElement (unsigned short index) const
 
const ComponentTypeGetGreen (void) const
 
LuminanceType GetLuminance (void) const
 
ComponentType GetNthComponent (int c) const
 
const ComponentTypeGetRed (void) const
 
ComponentType GetScalarValue () const
 
bool operator!= (const FixedArray &r) const
 
Self operator* (const ComponentType &f) const
 
Self operator+ (const Self &vec) const
 
const Selfoperator+= (const Self &vec)
 
Self operator- (const Self &vec) const
 
const Selfoperator-= (const Self &vec)
 
bool operator< (const Self &vec) const
 
template<typename TRGBPixelValueType >
Selfoperator= (const RGBPixel< TRGBPixelValueType > &r)
 
Selfoperator= (const ComponentType r[3])
 
bool operator== (const Self &vec) const
 
bool operator== (const FixedArray &r) const
 
reference operator[] (short index)
 
const_reference operator[] (short index) const
 
reference operator[] (unsigned short index)
 
const_reference operator[] (unsigned short index) const
 
reference operator[] (int index)
 
const_reference operator[] (int index) const
 
reference operator[] (unsigned int index)
 
const_reference operator[] (unsigned int index) const
 
reference operator[] (long index)
 
const_reference operator[] (long index) const
 
reference operator[] (unsigned long index)
 
const_reference operator[] (unsigned long index) const
 
reference operator[] (long long index)
 
const_reference operator[] (long long index) const
 
reference operator[] (unsigned long long index)
 
const_reference operator[] (unsigned long long index) const
 
ReverseIterator rBegin ()
 
ConstReverseIterator rBegin () const
 
ReverseIterator rEnd ()
 
ConstReverseIterator rEnd () const
 
void Set (ComponentType red, ComponentType green, ComponentType blue)
 
void SetBlue (ComponentType blue)
 
void SetElement (unsigned short index, const_reference value)
 
void SetGreen (ComponentType green)
 
void SetNthComponent (int c, const ComponentType &v)
 
void SetRed (ComponentType red)
 
SizeType Size () const
 

Static Public Member Functions

static FixedArray Filled (const ValueType &)
 
static unsigned int GetNumberOfComponents ()
 

Static Public Attributes

static const unsigned int Dimension = 3
 
static const unsigned int Length = 3
 

Detailed Description

template<typename TComponent = unsigned short>
class itk::RGBPixel< TComponent >

Represent Red, Green and Blue components for color images.

This class is templated over the representation used for each component.

The following syntax for assigning an index is allowed/suggested:

RGBPixel<float> pixel; pixel = 1.0f, 0.0f, .5f;
RGBPixel<char> pixelArray[2];
pixelArray[0] = 255, 255, 255;
pixelArray[1] = 255, 255, 244;

Since RGBPixel is a subclass of Array, you can access its components as: pixel[0], pixel[1], pixel[2]

{SimpleOperations/RGBPixel,Create an RGB image}

Examples:
BasicFilters/DEMToRainbowExample.cxx, BasicFilters/HillShadingExample.cxx, and FeatureExtraction/ExtractRoadByStepsExample.cxx.

Definition at line 58 of file itkRGBPixel.h.

Member Typedef Documentation

template<typename TComponent = unsigned short>
typedef FixedArray< TComponent, 3 > itk::RGBPixel< TComponent >::BaseArray

Convenience typedefs.

Definition at line 66 of file itkRGBPixel.h.

typedef ValueType itk::FixedArray< TComponent , VLength >::CArray[VLength]
inherited

A type representing the C-array version of this FixedArray.

Definition at line 63 of file itkFixedArray.h.

template<typename TComponent = unsigned short>
typedef TComponent itk::RGBPixel< TComponent >::ComponentType

Define the component type.

Definition at line 75 of file itkRGBPixel.h.

typedef const ValueType* itk::FixedArray< TComponent , VLength >::const_pointer
inherited

A const pointer to the ValueType.

Definition at line 121 of file itkFixedArray.h.

typedef const ValueType& itk::FixedArray< TComponent , VLength >::const_reference
inherited

A const reference to the ValueType.

Definition at line 127 of file itkFixedArray.h.

typedef const ValueType* itk::FixedArray< TComponent , VLength >::ConstIterator
inherited

A const iterator through the array.

Definition at line 69 of file itkFixedArray.h.

typedef ValueType* itk::FixedArray< TComponent , VLength >::Iterator
inherited

An iterator through the array.

Definition at line 66 of file itkFixedArray.h.

template<typename TComponent = unsigned short>
typedef NumericTraits< ComponentType >::RealType itk::RGBPixel< TComponent >::LuminanceType

Definition at line 76 of file itkRGBPixel.h.

typedef ValueType* itk::FixedArray< TComponent , VLength >::pointer
inherited

A pointer to the ValueType.

Definition at line 118 of file itkFixedArray.h.

typedef ValueType& itk::FixedArray< TComponent , VLength >::reference
inherited

A reference to the ValueType.

Definition at line 124 of file itkFixedArray.h.

template<typename TComponent = unsigned short>
typedef RGBPixel itk::RGBPixel< TComponent >::Self

Standard class typedefs.

Definition at line 62 of file itkRGBPixel.h.

typedef unsigned int itk::FixedArray< TComponent , VLength >::SizeType
inherited

Definition at line 129 of file itkFixedArray.h.

template<typename TComponent = unsigned short>
typedef FixedArray< TComponent, 3 > itk::RGBPixel< TComponent >::Superclass

Definition at line 63 of file itkRGBPixel.h.

typedef TComponent itk::FixedArray< TComponent , VLength >::ValueType
inherited

The element type stored at each location in the FixedArray.

Definition at line 60 of file itkFixedArray.h.

Constructor & Destructor Documentation

template<typename TComponent = unsigned short>
itk::RGBPixel< TComponent >::RGBPixel ( )
inline

Default constructor has nothing to do

Definition at line 79 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
itk::RGBPixel< TComponent >::RGBPixel ( const ComponentType r)
inline

Constructor to fill Red=Blug=Green= r.

Definition at line 81 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
template<typename TRGBPixelValueType >
itk::RGBPixel< TComponent >::RGBPixel ( const RGBPixel< TRGBPixelValueType > &  r)
inline

Pass-through constructor for the Array base class.

Definition at line 85 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
itk::RGBPixel< TComponent >::RGBPixel ( const ComponentType  r[3])
inline

Definition at line 86 of file itkRGBPixel.h.

Member Function Documentation

Iterator itk::FixedArray< TComponent , VLength >::Begin ( void  )
inherited

Get various iterators to the array.

Get an Iterator for the beginning of the FixedArray.

ConstIterator itk::FixedArray< TComponent , VLength >::Begin ( void  ) const
inherited

Get a ConstIterator for the beginning of the FixedArray.

Iterator itk::FixedArray< TComponent , VLength >::End ( void  )
inherited

Get an Iterator for the end of the FixedArray.

ConstIterator itk::FixedArray< TComponent , VLength >::End ( void  ) const
inherited

Get a ConstIterator for the end of the FixedArray.

void itk::FixedArray< TComponent , VLength >::Fill ( const ValueType &  )
inherited

Fill all elements of the array with the given value.

Referenced by itk::RGBPixel< TPixel >::RGBPixel(), and itk::NumericTraits< RGBPixel< T > >::SetLength().

static FixedArray itk::FixedArray< TComponent , VLength >::Filled ( const ValueType &  )
staticinherited

Return an FixedArray with all elements assigned to the given value.

template<typename TComponent = unsigned short>
const ComponentType& itk::RGBPixel< TComponent >::GetBlue ( void  ) const
inline

Get the Blue component.

Definition at line 158 of file itkRGBPixel.h.

Referenced by itk::BluePixelAccessor< T >::Get().

ValueType* itk::FixedArray< TComponent , VLength >::GetDataPointer ( )
inlineinherited

Return a pointer to the data.

Definition at line 220 of file itkFixedArray.h.

const ValueType* itk::FixedArray< TComponent , VLength >::GetDataPointer ( ) const
inlineinherited

Definition at line 225 of file itkFixedArray.h.

const_reference itk::FixedArray< TComponent , VLength >::GetElement ( unsigned short  index) const
inlineinherited

Definition at line 217 of file itkFixedArray.h.

template<typename TComponent = unsigned short>
const ComponentType& itk::RGBPixel< TComponent >::GetGreen ( void  ) const
inline

Get the Green component.

Definition at line 155 of file itkRGBPixel.h.

Referenced by itk::GreenPixelAccessor< T >::Get().

template<typename T >
RGBPixel< T >::LuminanceType itk::RGBPixel< T >::GetLuminance ( void  ) const

Get Luminance out of RGB

Compute luminance

Definition at line 160 of file itkRGBPixel.hxx.

template<typename TComponent = unsigned short>
ComponentType itk::RGBPixel< TComponent >::GetNthComponent ( int  c) const
inline

Return the value for the Nth component.

Definition at line 117 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
static unsigned int itk::RGBPixel< TComponent >::GetNumberOfComponents ( )
inlinestatic

Return the number of components.

Definition at line 114 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
const ComponentType& itk::RGBPixel< TComponent >::GetRed ( void  ) const
inline

Get the Red component.

Definition at line 152 of file itkRGBPixel.h.

Referenced by itk::RedPixelAccessor< T >::Get().

template<typename TComponent = unsigned short>
ComponentType itk::RGBPixel< TComponent >::GetScalarValue ( ) const
inline

Return the value for the Nth component.

Definition at line 120 of file itkRGBPixel.h.

bool itk::FixedArray< TComponent , VLength >::operator!= ( const FixedArray< TComponent, 3 > &  r) const
inlineinherited

Definition at line 191 of file itkFixedArray.h.

template<typename T >
RGBPixel< T > itk::RGBPixel< T >::operator* ( const ComponentType r) const

Returns a temporary copy of a vector

Definition at line 107 of file itkRGBPixel.hxx.

template<typename T >
RGBPixel< T > itk::RGBPixel< T >::operator+ ( const Self r) const

Aritmetic operations between pixels. Return a new RGBPixel.

Returns a temporary copy of a vector

Definition at line 43 of file itkRGBPixel.hxx.

template<typename T >
const RGBPixel< T > & itk::RGBPixel< T >::operator+= ( const Self r)

Returns a temporary copy of a vector

Definition at line 77 of file itkRGBPixel.hxx.

template<typename T >
RGBPixel< T > itk::RGBPixel< T >::operator- ( const Self r) const

Returns a temporary copy of a vector

Definition at line 60 of file itkRGBPixel.hxx.

template<typename T >
const RGBPixel< T > & itk::RGBPixel< T >::operator-= ( const Self r)

Returns a temporary copy of a vector

Definition at line 92 of file itkRGBPixel.hxx.

template<typename T >
bool itk::RGBPixel< T >::operator< ( const Self r) const

Returns the results from a test for less than (all components must be less than)

Definition at line 142 of file itkRGBPixel.hxx.

template<typename TComponent = unsigned short>
template<typename TRGBPixelValueType >
Self& itk::RGBPixel< TComponent >::operator= ( const RGBPixel< TRGBPixelValueType > &  r)
inline

Pass-through assignment operator for the Array base class.

Definition at line 90 of file itkRGBPixel.h.

template<typename T >
RGBPixel< T > & itk::RGBPixel< T >::operator= ( const ComponentType  r[3])

Assigment from a plain array

Definition at line 31 of file itkRGBPixel.hxx.

template<typename T >
bool itk::RGBPixel< T >::operator== ( const Self r) const

Returns the results from a test for equality (all components must be equal)

Definition at line 124 of file itkRGBPixel.hxx.

bool itk::FixedArray< TComponent , VLength >::operator== ( const FixedArray< TComponent, 3 > &  r) const
inherited

Operators == and != are used to compare whether two arrays are equal. Note that arrays are equal when the number of components (size) is the same, and each component value is equal.

Operator != compares different types of arrays.

reference itk::FixedArray< TComponent , VLength >::operator[] ( short  index)
inlineinherited

Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.

Definition at line 197 of file itkFixedArray.h.

Referenced by itk::RGBPixel< TPixel >::GetBlue(), itk::RGBPixel< TPixel >::GetGreen(), itk::RGBPixel< TPixel >::GetNthComponent(), itk::RGBPixel< TPixel >::GetRed(), itk::RGBPixel< TPixel >::Set(), itk::RGBPixel< TPixel >::SetBlue(), itk::RGBPixel< TPixel >::SetGreen(), itk::RGBPixel< TPixel >::SetNthComponent(), and itk::RGBPixel< TPixel >::SetRed().

const_reference itk::FixedArray< TComponent , VLength >::operator[] ( short  index) const
inlineinherited

Definition at line 198 of file itkFixedArray.h.

reference itk::FixedArray< TComponent , VLength >::operator[] ( unsigned short  index)
inlineinherited

Definition at line 199 of file itkFixedArray.h.

const_reference itk::FixedArray< TComponent , VLength >::operator[] ( unsigned short  index) const
inlineinherited

Definition at line 200 of file itkFixedArray.h.

reference itk::FixedArray< TComponent , VLength >::operator[] ( int  index)
inlineinherited

Definition at line 201 of file itkFixedArray.h.

const_reference itk::FixedArray< TComponent , VLength >::operator[] ( int  index) const
inlineinherited

Definition at line 202 of file itkFixedArray.h.

reference itk::FixedArray< TComponent , VLength >::operator[] ( unsigned int  index)
inlineinherited

Definition at line 203 of file itkFixedArray.h.

const_reference itk::FixedArray< TComponent , VLength >::operator[] ( unsigned int  index) const
inlineinherited

Definition at line 204 of file itkFixedArray.h.

reference itk::FixedArray< TComponent , VLength >::operator[] ( long  index)
inlineinherited

Definition at line 205 of file itkFixedArray.h.

const_reference itk::FixedArray< TComponent , VLength >::operator[] ( long  index) const
inlineinherited

Definition at line 206 of file itkFixedArray.h.

reference itk::FixedArray< TComponent , VLength >::operator[] ( unsigned long  index)
inlineinherited

Definition at line 207 of file itkFixedArray.h.

const_reference itk::FixedArray< TComponent , VLength >::operator[] ( unsigned long  index) const
inlineinherited

Definition at line 208 of file itkFixedArray.h.

reference itk::FixedArray< TComponent , VLength >::operator[] ( long long  index)
inlineinherited

Definition at line 209 of file itkFixedArray.h.

const_reference itk::FixedArray< TComponent , VLength >::operator[] ( long long  index) const
inlineinherited

Definition at line 210 of file itkFixedArray.h.

reference itk::FixedArray< TComponent , VLength >::operator[] ( unsigned long long  index)
inlineinherited

Definition at line 211 of file itkFixedArray.h.

const_reference itk::FixedArray< TComponent , VLength >::operator[] ( unsigned long long  index) const
inlineinherited

Definition at line 212 of file itkFixedArray.h.

ReverseIterator itk::FixedArray< TComponent , VLength >::rBegin ( )
inherited

Get a begin ReverseIterator.

ConstReverseIterator itk::FixedArray< TComponent , VLength >::rBegin ( ) const
inherited

Get a begin ConstReverseIterator.

ReverseIterator itk::FixedArray< TComponent , VLength >::rEnd ( )
inherited

Get an end ReverseIterator.

ConstReverseIterator itk::FixedArray< TComponent , VLength >::rEnd ( ) const
inherited

Get an end ConstReverseIterator.

template<typename TComponent = unsigned short>
void itk::RGBPixel< TComponent >::Set ( ComponentType  red,
ComponentType  green,
ComponentType  blue 
)
inline

Set the three components.

Definition at line 144 of file itkRGBPixel.h.

Referenced by itk::ColorTable< TPixel >::GetColor().

template<typename TComponent = unsigned short>
void itk::RGBPixel< TComponent >::SetBlue ( ComponentType  blue)
inline
void itk::FixedArray< TComponent , VLength >::SetElement ( unsigned short  index,
const_reference  value 
)
inlineinherited

Set/Get element methods are more convenient in wrapping languages

Definition at line 215 of file itkFixedArray.h.

template<typename TComponent = unsigned short>
void itk::RGBPixel< TComponent >::SetGreen ( ComponentType  green)
inline
template<typename TComponent = unsigned short>
void itk::RGBPixel< TComponent >::SetNthComponent ( int  c,
const ComponentType v 
)
inline

Set the Nth component to v.

Definition at line 132 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
void itk::RGBPixel< TComponent >::SetRed ( ComponentType  red)
inline
SizeType itk::FixedArray< TComponent , VLength >::Size ( void  ) const
inherited

Get the size of the FixedArray.

Member Data Documentation

template<typename TComponent = unsigned short>
const unsigned int itk::RGBPixel< TComponent >::Dimension = 3
static

Dimension of the vector space.

Definition at line 69 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
const unsigned int itk::RGBPixel< TComponent >::Length = 3
static

Length of the pixel.

Definition at line 72 of file itkRGBPixel.h.


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

Generated at Sat Mar 8 2014 17:39:02 for Orfeo Toolbox with doxygen 1.8.3.1