ITK  5.0.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
itk::RGBPixel< TComponent > Class Template Reference

#include <itkRGBPixel.h>

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

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]

Wiki Examples:
Examples:
Examples/DataRepresentation/Image/ImageAdaptor2.cxx, Examples/DataRepresentation/Image/RGBImage.cxx, Examples/DataRepresentation/Mesh/RGBPointSet.cxx, Examples/Filtering/ResampleImageFilter6.cxx, Examples/Filtering/ResampleImageFilter9.cxx, Examples/Filtering/RGBCurvatureAnisotropicDiffusionImageFilter.cxx, Examples/Filtering/RGBGradientAnisotropicDiffusionImageFilter.cxx, Examples/Filtering/RGBToGrayscale.cxx, Examples/Filtering/VectorIndexSelection.cxx, Examples/IO/RGBImageReadWrite.cxx, Examples/IO/RGBImageSeriesReadWrite.cxx, Examples/IO/VisibleHumanPasteWrite.cxx, Examples/IO/VisibleHumanStreamReadWrite.cxx, Examples/Iterators/ImageLinearIteratorWithIndex.cxx, Examples/Iterators/ImageRegionIteratorWithIndex.cxx, Examples/Segmentation/VectorConfidenceConnected.cxx, Examples/Segmentation/WatershedSegmentation1.cxx, Examples/Segmentation/WatershedSegmentation2.cxx, Examples/Statistics/ImageHistogram3.cxx, Examples/Statistics/ImageHistogram4.cxx, SphinxExamples/src/Bridge/VtkGlue/ConvertAnRGBitkImageTovtkImageData/Code.cxx, SphinxExamples/src/Bridge/VtkGlue/ConvertRGBvtkImageDataToAnitkImage/Code.cxx, SphinxExamples/src/Core/Common/CreateAnRGBImage/Code.cxx, SphinxExamples/src/Core/Common/ImageRegionOverlap/Code.cxx, SphinxExamples/src/Filtering/Colormap/ApplyAColorMapToAnImage/Code.cxx, SphinxExamples/src/Filtering/Colormap/CreateACustomColorMap/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/ResampleAVectorImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/ConvertRGBImageToGrayscaleImage/Code.cxx, SphinxExamples/src/Filtering/Smoothing/MedianFilteringOfAnRGBImage/Code.cxx, SphinxExamples/src/Segmentation/Watersheds/SegmentWithWatershedImageFilter/Code.cxx, WikiExamples/ImageProcessing/ConnectedComponentImageFilter.cxx, WikiExamples/ImageProcessing/CropImageFilter.cxx, WikiExamples/ImageProcessing/LabelGeometryImageFilter.cxx, WikiExamples/ImageProcessing/LabelMapOverlayImageFilter.cxx, WikiExamples/ImageProcessing/LabelOverlayImageFilter.cxx, WikiExamples/ImageProcessing/LabelShapeKeepNObjectsImageFilter.cxx, WikiExamples/ImageProcessing/ObjectByObjectLabelMapFilter.cxx, WikiExamples/ImageProcessing/RelabelComponentImageFilter.cxx, WikiExamples/ImageProcessing/ResampleSegmentedImage.cxx, WikiExamples/ImageProcessing/ScalarConnectedComponentImageFilter.cxx, WikiExamples/ImageProcessing/ShapeOpeningLabelMapFilter.cxx, WikiExamples/Images/ConvertPixelBuffer.cxx, WikiExamples/Images/FlipImageFilter.cxx, WikiExamples/ImageSegmentation/LabelContourImageFilter.cxx, WikiExamples/Inspection/CheckerBoardImageFilter.cxx, WikiExamples/Iterators/LineIterator.cxx, WikiExamples/Segmentation/ConnectedComponentImageFilterDemo.cxx, WikiExamples/Segmentation/LabelMapContourOverlayImageFilter.cxx, WikiExamples/Segmentation/OtsuMultipleThresholdsImageFilter.cxx, WikiExamples/Segmentation/WatershedImageFilter.cxx, WikiExamples/SimpleOperations/CustomColormap.cxx, WikiExamples/SimpleOperations/ParaviewColormap.cxx, WikiExamples/SimpleOperations/RegionOverlap.cxx, WikiExamples/SimpleOperations/RGBPixel.cxx, WikiExamples/SimpleOperations/ScalarToRGBColormapImageFilter.cxx, WikiExamples/Smoothing/RGBCurvatureFlowImageFilter.cxx, WikiExamples/Smoothing/RGBMedianImageFilter.cxx, WikiExamples/Smoothing/RGBMinMaxCurvatureFlowImageFilter.cxx, WikiExamples/Smoothing/VectorMeanImageFilter.cxx, WikiExamples/Smoothing/VectorMedianImageFilter.cxx, and WikiExamples/Statistics/ImageToHistogramFilterRGB.cxx.

Definition at line 58 of file itkRGBPixel.h.

Public Types

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

Public Member Functions

const ComponentTypeGetBlue (void) const
 
const ComponentTypeGetGreen (void) const
 
LuminanceType GetLuminance () const
 
ComponentType GetNthComponent (int c) const
 
const ComponentTypeGetRed (void) const
 
ComponentType GetScalarValue () 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
 
Selfoperator= (const ComponentType r[3])
 
bool operator== (const Self &vec) const
 
 RGBPixel ()
 
 RGBPixel (const ComponentType &r)
 
void SetBlue (ComponentType blue)
 
void SetGreen (ComponentType green)
 
void SetNthComponent (int c, const ComponentType &v)
 
void SetRed (ComponentType red)
 
template<typename TRGBPixelValueType >
 RGBPixel (const RGBPixel< TRGBPixelValueType > &r)
 
 RGBPixel (const ComponentType r[3])
 
template<typename TRGBPixelValueType >
Selfoperator= (const RGBPixel< TRGBPixelValueType > &r)
 
void Set (ComponentType red, ComponentType green, ComponentType blue)
 
- Public Member Functions inherited from itk::FixedArray< TComponent, 3 >
Iterator Begin ()
 
ConstIterator Begin () const
 
Iterator End ()
 
ConstIterator End () const
 
void Fill (const ValueType &)
 
 FixedArray (const TScalarValue *r)
 
ValueTypeGetDataPointer ()
 
const ValueTypeGetDataPointer () const
 
bool operator!= (const FixedArray &r) const
 
FixedArrayoperator= (const ValueType r[VLength])
 
bool operator== (const FixedArray &r) const
 
ReverseIterator rBegin ()
 
ConstReverseIterator rBegin () const
 
ReverseIterator rEnd ()
 
ConstReverseIterator rEnd () const
 
SizeType Size () const
 
void swap (FixedArray &other)
 
 FixedArray ()
 
 FixedArray (const ValueType r[VLength])
 
 FixedArray (const ValueType &r)
 
 FixedArray (const FixedArray< TFixedArrayValueType, VLength > &r)
 
FixedArrayoperator= (const FixedArray< TFixedArrayValueType, VLength > &r)
 
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
 
void SetElement (unsigned short index, const_reference value)
 
const_reference GetElement (unsigned short index) const
 

Static Public Member Functions

static unsigned int GetNumberOfComponents ()
 
- Static Public Member Functions inherited from itk::FixedArray< TComponent, 3 >
static FixedArray Filled (const ValueType &)
 

Static Public Attributes

static const unsigned int Dimension = 3
 
static const unsigned int Length = 3
 
- Static Public Attributes inherited from itk::FixedArray< TComponent, 3 >
static const unsigned int Dimension
 
static const unsigned int Length
 

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.

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

Define the component type.

Definition at line 75 of file itkRGBPixel.h.

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

Definition at line 76 of file itkRGBPixel.h.

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

Standard class typedefs.

Definition at line 62 of file itkRGBPixel.h.

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

Definition at line 63 of file itkRGBPixel.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 82 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 86 of file itkRGBPixel.h.

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

Pass-through constructor for the Array base class.

Definition at line 87 of file itkRGBPixel.h.

Member Function Documentation

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

Get the Blue component.

Definition at line 162 of file itkRGBPixel.h.

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

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

Get the Green component.

Definition at line 159 of file itkRGBPixel.h.

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

template<typename TComponent = unsigned short>
LuminanceType itk::RGBPixel< TComponent >::GetLuminance ( ) const

Get Luminance out of RGB

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

Return the value for the Nth component.

Definition at line 120 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 117 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 156 of file itkRGBPixel.h.

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

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

Return the Euclidean norm of the vector defined by the RGB components.

Definition at line 123 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
Self itk::RGBPixel< TComponent >::operator* ( const ComponentType f) const
template<typename TComponent = unsigned short>
Self itk::RGBPixel< TComponent >::operator+ ( const Self vec) const

Aritmetic operations between pixels. Return a new RGBPixel.

template<typename TComponent = unsigned short>
const Self& itk::RGBPixel< TComponent >::operator+= ( const Self vec)
template<typename TComponent = unsigned short>
Self itk::RGBPixel< TComponent >::operator- ( const Self vec) const
template<typename TComponent = unsigned short>
const Self& itk::RGBPixel< TComponent >::operator-= ( const Self vec)
template<typename TComponent = unsigned short>
bool itk::RGBPixel< TComponent >::operator< ( const Self vec) const
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 92 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
Self& itk::RGBPixel< TComponent >::operator= ( const ComponentType  r[3])
template<typename TComponent = unsigned short>
bool itk::RGBPixel< TComponent >::operator== ( const Self vec) const
template<typename TComponent = unsigned short>
void itk::RGBPixel< TComponent >::Set ( ComponentType  red,
ComponentType  green,
ComponentType  blue 
)
inline

Set the three components.

Definition at line 147 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
void itk::RGBPixel< TComponent >::SetBlue ( ComponentType  blue)
inline

Set the Blue component.

Definition at line 144 of file itkRGBPixel.h.

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

template<typename TComponent = unsigned short>
void itk::RGBPixel< TComponent >::SetGreen ( ComponentType  green)
inline

Set the Green component.

Definition at line 141 of file itkRGBPixel.h.

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

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 135 of file itkRGBPixel.h.

template<typename TComponent = unsigned short>
void itk::RGBPixel< TComponent >::SetRed ( ComponentType  red)
inline

Set the Red component.

Definition at line 138 of file itkRGBPixel.h.

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

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 file: