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::RGBAPixel< TComponent > Class Template Reference

#include <itkRGBAPixel.h>

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

Detailed Description

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

Represent Red, Green, Blue and Alpha 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:

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

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

Wiki Examples:
Examples:
SphinxExamples/src/Core/Common/UseParallelizeImageRegion/Code.cxx, WikiExamples/Images/ConvertPixelBuffer.cxx, and WikiExamples/SimpleOperations/Transparency.cxx.

Definition at line 59 of file itkRGBAPixel.h.

Public Types

using BaseArray = FixedArray< TComponent, 4 >
 
using ComponentType = TComponent
 
using LuminanceType = typename NumericTraits< ComponentType >::RealType
 
using Self = RGBAPixel
 
using Superclass = FixedArray< TComponent, 4 >
 
- Public Types inherited from itk::FixedArray< TComponent, 4 >
typedef ValueType CArray [VLength]
 
using const_pointer = const ValueType *
 
using const_reference = const ValueType &
 
using ConstIterator = const ValueType *
 
using Iterator = ValueType *
 
using pointer = ValueType *
 
using reference = ValueType &
 
using SizeType = unsigned int
 
using ValueType = TComponent
 

Public Member Functions

const ComponentTypeGetAlpha () const
 
const ComponentTypeGetBlue () const
 
const ComponentTypeGetGreen () const
 
LuminanceType GetLuminance () const
 
ComponentType GetNthComponent (int c) const
 
const ComponentTypeGetRed () const
 
ComponentType GetScalarValue () const
 
bool operator< (const Self &vec) const
 
RGBAPixeloperator= (const ComponentType r[4])
 
bool operator== (const Self &vec) const
 
void SetAlpha (ComponentType alpha)
 
void SetBlue (ComponentType blue)
 
void SetGreen (ComponentType green)
 
void SetNthComponent (int c, const ComponentType &v)
 
void SetRed (ComponentType red)
 
 RGBAPixel ()
 
 RGBAPixel (const RGBAPixel &)=default
 
RGBAPixeloperator= (const RGBAPixel &)=default
 
 RGBAPixel (RGBAPixel &&)=default
 
RGBAPixeloperator= (RGBAPixel &&)=default
 
 ~RGBAPixel ()=default
 
template<typename TRGBAPixelValueType >
 RGBAPixel (const RGBAPixel< TRGBAPixelValueType > &r)
 
 RGBAPixel (const ComponentType r[4])
 
 RGBAPixel (const ComponentType &r)
 
Self operator+ (const Self &vec) const
 
Self operator- (const Self &vec) const
 
Self operator* (const ComponentType &f) const
 
Self operator/ (const ComponentType &f) const
 
const Selfoperator+= (const Self &vec)
 
const Selfoperator-= (const Self &vec)
 
const Selfoperator*= (const ComponentType &f)
 
const Selfoperator/= (const ComponentType &f)
 
void Set (ComponentType red, ComponentType green, ComponentType blue, ComponentType alpha)
 
- Public Member Functions inherited from itk::FixedArray< TComponent, 4 >
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 ()=default
 
 FixedArray (const FixedArray &)=default
 
 FixedArray (FixedArray &&)=default
 
FixedArrayoperator= (const FixedArray &)=default
 
FixedArrayoperator= (FixedArray &&)=default
 
 ~FixedArray ()=default
 
 FixedArray (const ValueType r[VLength])
 
 FixedArray (const ValueType &)
 
 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, 4 >
static FixedArray Filled (const ValueType &)
 

Static Public Attributes

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

Member Typedef Documentation

template<typename TComponent = unsigned short>
using itk::RGBAPixel< TComponent >::BaseArray = FixedArray< TComponent, 4 >

Convenience type alias.

Definition at line 73 of file itkRGBAPixel.h.

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

Define the component type.

Definition at line 76 of file itkRGBAPixel.h.

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

Definition at line 77 of file itkRGBAPixel.h.

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

Standard class type aliases.

Definition at line 63 of file itkRGBAPixel.h.

template<typename TComponent = unsigned short>
using itk::RGBAPixel< TComponent >::Superclass = FixedArray< TComponent, 4 >

Definition at line 64 of file itkRGBAPixel.h.

Constructor & Destructor Documentation

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

Default constructors

Definition at line 80 of file itkRGBAPixel.h.

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

Default constructors

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

Default constructors

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

Default constructors

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

Pass-through constructor for the Array base class.

Definition at line 90 of file itkRGBAPixel.h.

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

Pass-through constructor for the Array base class.

Definition at line 91 of file itkRGBAPixel.h.

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

Pass-through constructor for the Array base class.

Definition at line 92 of file itkRGBAPixel.h.

Member Function Documentation

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

Get the Alpha component.

Definition at line 170 of file itkRGBAPixel.h.

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

Get the Blue component.

Definition at line 167 of file itkRGBAPixel.h.

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

Get the Green component.

Definition at line 164 of file itkRGBAPixel.h.

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

Get Luminance out of RGB

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

Return the value for the Nth component.

Definition at line 121 of file itkRGBAPixel.h.

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

Return the number of components.

Definition at line 118 of file itkRGBAPixel.h.

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

Get the Red component.

Definition at line 161 of file itkRGBAPixel.h.

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

Return the Euclidean norm of the vector defined by the RGB components. Alpha is not used.

Definition at line 124 of file itkRGBAPixel.h.

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

Aritmetic operations between pixels. Return a new RGBAPixel.

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

Arithmetic-assigment operators.

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

Aritmetic operations between pixels. Return a new RGBAPixel.

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

Arithmetic-assigment operators.

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

Aritmetic operations between pixels. Return a new RGBAPixel.

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

Arithmetic-assigment operators.

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

Aritmetic operations between pixels. Return a new RGBAPixel.

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

Arithmetic-assigment operators.

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

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

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

Default constructors

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

Default constructors

template<typename TComponent = unsigned short>
RGBAPixel& itk::RGBAPixel< TComponent >::operator= ( const ComponentType  r[4])

Pass-through assignment operator for the Array base class.

template<typename TComponent = unsigned short>
bool itk::RGBAPixel< TComponent >::operator== ( const Self vec) const
template<typename TComponent = unsigned short>
void itk::RGBAPixel< TComponent >::Set ( ComponentType  red,
ComponentType  green,
ComponentType  blue,
ComponentType  alpha 
)
inline

Set the four components.

Definition at line 151 of file itkRGBAPixel.h.

template<typename TComponent = unsigned short>
void itk::RGBAPixel< TComponent >::SetAlpha ( ComponentType  alpha)
inline

Set the Alpha component.

Definition at line 148 of file itkRGBAPixel.h.

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

Set the Blue component.

Definition at line 145 of file itkRGBAPixel.h.

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

Set the Green component.

Definition at line 142 of file itkRGBAPixel.h.

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

Set the Nth component to v.

Definition at line 136 of file itkRGBAPixel.h.

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

Set the Red component.

Definition at line 139 of file itkRGBAPixel.h.

Member Data Documentation

template<typename TComponent = unsigned short>
constexpr unsigned int itk::RGBAPixel< TComponent >::Dimension = 4
static

Dimension of the vector space.

Definition at line 67 of file itkRGBAPixel.h.

template<typename TComponent = unsigned short>
constexpr unsigned int itk::RGBAPixel< TComponent >::Length = 4
static

Length of the pixel.

Definition at line 70 of file itkRGBAPixel.h.


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