#include <itkRGBAPixel.h>
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:
Since RGBAPixel is a subclass of Array, you can access its components as: pixel[0], pixel[1], pixel[2], pixel[3]
Definition at line 59 of file itkRGBAPixel.h.
Inheritance diagram for itk::RGBAPixel< TComponent >:
Collaboration diagram for itk::RGBAPixel< TComponent >: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< unsigned short, 4 > | |
| using | CArray |
| using | const_iterator |
| using | const_pointer |
| using | const_reference |
| using | const_reverse_iterator |
| using | ConstIterator |
| using | Iterator |
| using | iterator |
| using | pointer |
| using | reference |
| using | reverse_iterator |
| using | SizeType |
| using | value_type |
| using | ValueType |
Public Member Functions | |
| const ComponentType & | GetAlpha () const |
| const ComponentType & | GetBlue () const |
| const ComponentType & | GetGreen () const |
| LuminanceType | GetLuminance () const |
| ComponentType | GetNthComponent (int c) const |
| const ComponentType & | GetRed () const |
| ComponentType | GetScalarValue () const |
| bool | operator< (const Self &r) const |
| RGBAPixel & | operator= (const ComponentType r[4]) |
| bool | operator== (const Self &r) const |
| RGBAPixel ()=default | |
| RGBAPixel (const ComponentType &r) | |
| RGBAPixel (std::nullptr_t)=delete | |
| void | Set (ComponentType red, ComponentType green, ComponentType blue, ComponentType alpha) |
| void | SetAlpha (ComponentType alpha) |
| void | SetBlue (ComponentType blue) |
| void | SetGreen (ComponentType green) |
| void | SetNthComponent (int c, const ComponentType &v) |
| void | SetRed (ComponentType red) |
| template<typename TRGBAPixelValueType> | |
| RGBAPixel (const RGBAPixel< TRGBAPixelValueType > &r) | |
| RGBAPixel (const ComponentType r[4]) | |
| 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 Self & | operator+= (const Self &r) |
| const Self & | operator-= (const Self &r) |
| const Self & | operator*= (const ComponentType &r) |
| const Self & | operator/= (const ComponentType &r) |
Public Member Functions inherited from itk::FixedArray< unsigned short, 4 > | |
| Iterator | Begin () |
| ConstIterator | Begin () const |
| constexpr const_iterator | begin () const noexcept |
| constexpr iterator | begin () noexcept |
| constexpr const_iterator | cbegin () const noexcept |
| constexpr const_iterator | cend () const noexcept |
| const_reverse_iterator | crbegin () const |
| const_reverse_iterator | crend () const |
| ValueType * | data () |
| const ValueType * | data () const |
| Iterator | End () |
| ConstIterator | End () const |
| constexpr const_iterator | end () const noexcept |
| constexpr iterator | end () noexcept |
| void | Fill (const ValueType &) |
| FixedArray ()=default | |
| FixedArray (const FixedArray< TFixedArrayValueType, VLength > &r) | |
| FixedArray (const std::array< ValueType, VLength > &stdArray) | |
| FixedArray (const TScalarValue *r) | |
| ValueType * | GetDataPointer () |
| const ValueType * | GetDataPointer () const |
| ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION (FixedArray) | |
| FixedArray & | operator= (const FixedArray< TFixedArrayValueType, VLength > &r) |
| FixedArray & | operator= (const ValueType r[VLength]) |
| bool | operator== (const FixedArray &r) const |
| ReverseIterator | rBegin () |
| ConstReverseIterator | rBegin () const |
| reverse_iterator | rbegin () |
| const_reverse_iterator | rbegin () const |
| ReverseIterator | rEnd () |
| ConstReverseIterator | rEnd () const |
| reverse_iterator | rend () |
| const_reverse_iterator | rend () const |
| SizeType | Size () const |
| constexpr SizeType | size () const |
| void | swap (FixedArray &other) noexcept |
| FixedArray (const ValueType r[VLength]) | |
| FixedArray (const ValueType &) | |
| ITK_GCC_PRAGMA_PUSH ITK_GCC_SUPPRESS_Warray_bounds constexpr reference | operator[] (unsigned int index) |
| constexpr const_reference | operator[] (unsigned int index) const |
| ITK_GCC_PRAGMA_POP void | SetElement (unsigned int index, const_reference value) |
| const_reference | GetElement (unsigned int index) const |
Static Public Member Functions | |
| static unsigned int | GetNumberOfComponents () |
Static Public Member Functions inherited from itk::FixedArray< unsigned short, 4 > | |
| static constexpr FixedArray | Filled (const ValueType &value) |
Static Public Attributes | |
| static constexpr unsigned int | Dimension = 4 |
| static constexpr unsigned int | Length = 4 |
Static Public Attributes inherited from itk::FixedArray< unsigned short, 4 > | |
| static constexpr unsigned int | Dimension |
| static constexpr unsigned int | Length |
| using itk::RGBAPixel< TComponent >::BaseArray = FixedArray<TComponent, 4> |
Convenience type alias.
Definition at line 73 of file itkRGBAPixel.h.
| using itk::RGBAPixel< TComponent >::ComponentType = TComponent |
Define the component type.
Definition at line 76 of file itkRGBAPixel.h.
| using itk::RGBAPixel< TComponent >::LuminanceType = typename NumericTraits<ComponentType>::RealType |
Definition at line 77 of file itkRGBAPixel.h.
| using itk::RGBAPixel< TComponent >::Self = RGBAPixel |
Standard class type aliases.
Definition at line 63 of file itkRGBAPixel.h.
| using itk::RGBAPixel< TComponent >::Superclass = FixedArray<TComponent, 4> |
Definition at line 64 of file itkRGBAPixel.h.
|
default |
Default-constructor.
|
inline |
Pass-through constructor for the Array base class.
Definition at line 96 of file itkRGBAPixel.h.
|
inline |
Pass-through constructor for the Array base class.
Definition at line 99 of file itkRGBAPixel.h.
|
delete |
Prevents copy-initialization from nullptr, as well as from 0 (NULL).
|
inlineexplicit |
Explicit constructor
Definition at line 109 of file itkRGBAPixel.h.
|
inlinenodiscard |
Get the Alpha component.
Definition at line 241 of file itkRGBAPixel.h.
|
inlinenodiscard |
Get the Blue component.
Definition at line 234 of file itkRGBAPixel.h.
|
inlinenodiscard |
Get the Green component.
Definition at line 227 of file itkRGBAPixel.h.
|
nodiscard |
|
inlinenodiscard |
Return the value for the Nth component.
Definition at line 158 of file itkRGBAPixel.h.
|
inlinestatic |
Return the number of components.
Definition at line 151 of file itkRGBAPixel.h.
|
inlinenodiscard |
Get the Red component.
Definition at line 220 of file itkRGBAPixel.h.
|
inlinenodiscard |
Return the Euclidean norm of the vector defined by the RGB components. Alpha is not used.
Definition at line 165 of file itkRGBAPixel.h.
| Self itk::RGBAPixel< TComponent >::operator* | ( | const ComponentType & | r | ) | const |
Arithmetic operations between pixels. Return a new RGBAPixel.
| const Self & itk::RGBAPixel< TComponent >::operator*= | ( | const ComponentType & | r | ) |
Arithmetic-assignment operators.
| Self itk::RGBAPixel< TComponent >::operator+ | ( | const Self & | r | ) | const |
Arithmetic operations between pixels. Return a new RGBAPixel.
| const Self & itk::RGBAPixel< TComponent >::operator+= | ( | const Self & | r | ) |
Arithmetic-assignment operators.
| Self itk::RGBAPixel< TComponent >::operator- | ( | const Self & | r | ) | const |
Arithmetic operations between pixels. Return a new RGBAPixel.
| const Self & itk::RGBAPixel< TComponent >::operator-= | ( | const Self & | r | ) |
Arithmetic-assignment operators.
| Self itk::RGBAPixel< TComponent >::operator/ | ( | const ComponentType & | r | ) | const |
Arithmetic operations between pixels. Return a new RGBAPixel.
| const Self & itk::RGBAPixel< TComponent >::operator/= | ( | const ComponentType & | r | ) |
Arithmetic-assignment operators.
| bool itk::RGBAPixel< TComponent >::operator< | ( | const Self & | r | ) | const |
Implements strict weak ordering. For use in STL, e.g. std::map.
| RGBAPixel & itk::RGBAPixel< TComponent >::operator= | ( | const ComponentType | r[4] | ) |
Pass-through assignment operator for the Array base class.
| bool itk::RGBAPixel< TComponent >::operator== | ( | const Self & | r | ) | const |
|
inline |
Set the four components.
Definition at line 210 of file itkRGBAPixel.h.
|
inline |
Set the Alpha component.
Definition at line 203 of file itkRGBAPixel.h.
|
inline |
Set the Blue component.
Definition at line 196 of file itkRGBAPixel.h.
|
inline |
Set the Green component.
Definition at line 189 of file itkRGBAPixel.h.
|
inline |
Set the Nth component to v.
Definition at line 175 of file itkRGBAPixel.h.
|
inline |
Set the Red component.
Definition at line 182 of file itkRGBAPixel.h.
|
staticconstexpr |
Dimension of the vector space.
Definition at line 67 of file itkRGBAPixel.h.
|
staticconstexpr |
Length of the pixel.
Definition at line 70 of file itkRGBAPixel.h.