ITK  5.2.0
Insight Toolkit
Public Types | 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 >:

Public Types

using BaseArray = FixedArray< TComponent, 3 >
 
using ComponentType = TComponent
 
using LuminanceType = typename NumericTraits< ComponentType >::RealType
 
using Self = RGBPixel
 
using Superclass = FixedArray< TComponent, 3 >
 
- Public Types inherited from itk::FixedArray< TComponent, 3 >
using CArray = ValueType[VLength]
 
using const_iterator = const ValueType *
 
using const_pointer = const ValueType *
 
using const_reference = const ValueType &
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using ConstIterator = const ValueType *
 
using Iterator = ValueType *
 
using iterator = ValueType *
 
using pointer = ValueType *
 
using reference = ValueType &
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using SizeType = unsigned int
 
using ValueType = TComponent
 

Static Public Attributes

static constexpr unsigned int Dimension = 3
 
static constexpr unsigned int Length = 3
 
- Static Public Attributes inherited from itk::FixedArray< TComponent, 3 >
static constexpr unsigned int Dimension
 
static constexpr unsigned int Length
 
 RGBPixel ()
 
 RGBPixel (const RGBPixel &)=default
 
 RGBPixel (RGBPixel &&)=default
 
RGBPixeloperator= (const RGBPixel &)=default
 
RGBPixeloperator= (RGBPixel &&)=default
 
 ~RGBPixel ()=default
 
 RGBPixel (const ComponentType &r)
 
template<typename TRGBPixelValueType >
 RGBPixel (const RGBPixel< TRGBPixelValueType > &r)
 
 RGBPixel (const ComponentType r[3])
 
template<typename TRGBPixelValueType >
Selfoperator= (const RGBPixel< TRGBPixelValueType > &r)
 
Selfoperator= (const ComponentType r[3])
 
Self operator+ (const Self &r) const
 
Self operator- (const Self &r) const
 
Self operator* (const ComponentType &r) const
 
Self operator/ (const ComponentType &r) const
 
const Selfoperator+= (const Self &r)
 
const Selfoperator-= (const Self &r)
 
const Selfoperator*= (const ComponentType &r)
 
const Selfoperator/= (const ComponentType &r)
 
bool operator< (const Self &r) const
 
bool operator== (const Self &r) const
 
ComponentType GetNthComponent (int c) const
 
ComponentType GetScalarValue () const
 
void SetNthComponent (int c, const ComponentType &v)
 
void SetRed (ComponentType red)
 
void SetGreen (ComponentType green)
 
void SetBlue (ComponentType blue)
 
void Set (ComponentType red, ComponentType green, ComponentType blue)
 
const ComponentTypeGetRed () const
 
const ComponentTypeGetGreen () const
 
const ComponentTypeGetBlue () const
 
LuminanceType GetLuminance () const
 
static unsigned int GetNumberOfComponents ()
 

Additional Inherited Members

- Public Member Functions inherited from itk::FixedArray< TComponent, 3 >
 FixedArray ()=default
 
 FixedArray (const FixedArray &)=default
 
 FixedArray (FixedArray &&)=default
 
 FixedArray (const ValueType r[VLength])
 
 FixedArray (const ValueType &)
 
 FixedArray (const std::array< ValueType, VLength > &stdArray)
 
 FixedArray (const FixedArray< TFixedArrayValueType, VLength > &r)
 
 FixedArray (const TScalarValue *r)
 
FixedArrayoperator= (const FixedArray &)=default
 
FixedArrayoperator= (FixedArray &&)=default
 
FixedArrayoperator= (const FixedArray< TFixedArrayValueType, VLength > &r)
 
FixedArrayoperator= (const ValueType r[VLength])
 
 ~FixedArray ()=default
 
bool operator== (const FixedArray &r) 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
 
void SetElement (unsigned int index, const_reference value)
 
const_reference GetElement (unsigned int index) const
 
ValueTypeGetDataPointer ()
 
const ValueTypeGetDataPointer () const
 
ValueTypedata ()
 
const ValueTypedata () const
 
Iterator Begin ()
 
ConstIterator Begin () const
 
Iterator End ()
 
ConstIterator End () const
 
 itkLegacyMacro (ReverseIterator rBegin())
 
 itkLegacyMacro (ConstReverseIterator rBegin() const)
 
 itkLegacyMacro (ReverseIterator rEnd())
 
 itkLegacyMacro (ConstReverseIterator rEnd() const)
 
const_iterator cbegin () const noexcept
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
const_iterator cend () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator crbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
const_reverse_iterator crend () const
 
SizeType Size () const
 
constexpr SizeType size () const
 
void Fill (const ValueType &)
 
void swap (FixedArray &other)
 
- Static Public Member Functions inherited from itk::FixedArray< TComponent, 3 >
static FixedArray Filled (const ValueType &)
 

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]

ITK Sphinx 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/Core/Common/IterateLineThroughImage/Code.cxx, SphinxExamples/src/Filtering/Colormap/ApplyAColormapToAnImage/Code.cxx, SphinxExamples/src/Filtering/Colormap/CreateACustomColormap/Code.cxx, SphinxExamples/src/Filtering/Colormap/MapScalarsIntoJetColormap/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothRGBImageUsingCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/CurvatureFlow/SmoothRGBImageUsingMinMaxCurvatureFlow/Code.cxx, SphinxExamples/src/Filtering/ImageFusion/ColorBoundariesOfRegions/Code.cxx, SphinxExamples/src/Filtering/ImageFusion/ColorLabeledRegions/Code.cxx, SphinxExamples/src/Filtering/ImageFusion/OverlayLabelMapOnImage/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/CropImageBySpecifyingRegion2/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/ResampleAVectorImage/Code.cxx, SphinxExamples/src/Filtering/ImageIntensity/ConvertRGBImageToGrayscaleImage/Code.cxx, SphinxExamples/src/Filtering/ImageLabel/LabelContoursOfConnectComponent/Code.cxx, SphinxExamples/src/Filtering/LabelMap/KeepRegionsAboveLevel/Code.cxx, SphinxExamples/src/Filtering/LabelMap/KeepRegionsThatMeetSpecific/Code.cxx, SphinxExamples/src/Filtering/Smoothing/MedianFilteringOfAnRGBImage/Code.cxx, SphinxExamples/src/IO/ImageBase/ConvertImageToAnotherType/Code.cxx, SphinxExamples/src/Nonunit/Review/GeometricPropertiesOfRegion/Code.cxx, SphinxExamples/src/Numerics/Statistics/ComputeHistogramOfMaskedRegion/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/AssignContiguousLabelsToConnectedRegions/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/LabelConnectComponentsInBinaryImage/Code.cxx, SphinxExamples/src/Segmentation/ConnectedComponents/LabelConnectComponentsInGrayscaleImage/Code.cxx, SphinxExamples/src/Segmentation/Watersheds/MorphologicalWatershedSegmentation/Code.cxx, and SphinxExamples/src/Segmentation/Watersheds/SegmentWithWatershedImageFilter/Code.cxx.

Definition at line 58 of file itkRGBPixel.h.

Member Typedef Documentation

◆ BaseArray

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

Convenience type alias.

Definition at line 66 of file itkRGBPixel.h.

◆ ComponentType

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

Define the component type.

Definition at line 75 of file itkRGBPixel.h.

◆ LuminanceType

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

Definition at line 76 of file itkRGBPixel.h.

◆ Self

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

Standard class type aliases.

Definition at line 62 of file itkRGBPixel.h.

◆ Superclass

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

Definition at line 63 of file itkRGBPixel.h.

Constructor & Destructor Documentation

◆ RGBPixel() [1/6]

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

Default constructors

Definition at line 79 of file itkRGBPixel.h.

◆ RGBPixel() [2/6]

template<typename TComponent = unsigned short>
itk::RGBPixel< TComponent >::RGBPixel ( const RGBPixel< TComponent > &  )
default

Default constructors

◆ RGBPixel() [3/6]

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

Default constructors

◆ ~RGBPixel()

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

Default constructors

◆ RGBPixel() [4/6]

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

Constructor to fill Red=Blug=Green= r.

Definition at line 90 of file itkRGBPixel.h.

◆ RGBPixel() [5/6]

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

◆ RGBPixel() [6/6]

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

Default constructors

Definition at line 97 of file itkRGBPixel.h.

Member Function Documentation

◆ GetBlue()

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

Get the Blue component.

Definition at line 221 of file itkRGBPixel.h.

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

◆ GetGreen()

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

Get the Green component.

Definition at line 214 of file itkRGBPixel.h.

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

◆ GetLuminance()

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

◆ GetNthComponent()

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

Return the value for the Nth component.

Definition at line 152 of file itkRGBPixel.h.

◆ GetNumberOfComponents()

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

Return the number of components.

Definition at line 145 of file itkRGBPixel.h.

◆ GetRed()

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

Get the Red component.

Definition at line 207 of file itkRGBPixel.h.

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

◆ GetScalarValue()

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

◆ operator*()

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

Default constructors

◆ operator*=()

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

Default constructors

◆ operator+()

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

Aritmetic operations between pixels. Return a new RGBPixel.

◆ operator+=()

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

Arithmetic-assignment operators.

◆ operator-()

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

Default constructors

◆ operator-=()

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

Default constructors

◆ operator/()

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

Default constructors

◆ operator/=()

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

Default constructors

◆ operator<()

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

Implements strict weak ordering. For use in STL, e.g. std::map.

◆ operator=() [1/4]

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

Default constructors

◆ operator=() [2/4]

template<typename TComponent = unsigned short>
RGBPixel& itk::RGBPixel< TComponent >::operator= ( const RGBPixel< TComponent > &  )
default

Default constructors

◆ operator=() [3/4]

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

◆ operator=() [4/4]

template<typename TComponent = unsigned short>
RGBPixel& itk::RGBPixel< TComponent >::operator= ( RGBPixel< TComponent > &&  )
default

Default constructors

◆ operator==()

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

Default constructors

◆ Set()

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

Set the three components.

Definition at line 197 of file itkRGBPixel.h.

◆ SetBlue()

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

Set the Blue component.

Definition at line 190 of file itkRGBPixel.h.

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

◆ SetGreen()

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

Set the Green component.

Definition at line 183 of file itkRGBPixel.h.

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

◆ SetNthComponent()

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

◆ SetRed()

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

Set the Red component.

Definition at line 176 of file itkRGBPixel.h.

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

Member Data Documentation

◆ Dimension

template<typename TComponent = unsigned short>
constexpr unsigned int itk::RGBPixel< TComponent >::Dimension = 3
staticconstexpr

Dimension of the vector space.

Definition at line 69 of file itkRGBPixel.h.

◆ Length

template<typename TComponent = unsigned short>
constexpr unsigned int itk::RGBPixel< TComponent >::Length = 3
staticconstexpr

Length of the pixel.

Definition at line 72 of file itkRGBPixel.h.


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