18 #ifndef itkRGBAPixel_h
19 #define itkRGBAPixel_h
58 template<
typename TComponent =
unsigned short >
70 static constexpr
unsigned int Length = 4;
89 template<
typename TRGBAPixelValueType >
96 RGBAPixel & operator=(
const ComponentType r[4]);
101 Self
operator *(
const ComponentType & f)
const;
102 Self operator /(
const ComponentType & f)
const;
106 const Self & operator+=(
const Self & vec);
107 const Self & operator-=(
const Self & vec);
108 const Self & operator*=(
const ComponentType & f);
109 const Self & operator/=(
const ComponentType & f);
127 static_cast< double >( this->
operator[](0) )
128 * static_cast< double >( this->
operator[](0) )
129 + static_cast< double >( this->
operator[](1) )
130 * static_cast< double >( this->
operator[](1) )
131 + static_cast< double >( this->
operator[](2) )
132 * static_cast< double >( this->
operator[](2) ) ) );
153 this->operator[](0) = red;
154 this->operator[](1) = green;
155 this->operator[](2) = blue;
156 this->operator[](3) = alpha;
173 LuminanceType GetLuminance()
const;
176 template<
typename TComponent >
178 const RGBAPixel< TComponent > & c);
180 template<
typename TComponent >
182 RGBAPixel< TComponent > & c);
202 #ifndef ITK_MANUAL_INSTANTIATION
203 #include "itkRGBAPixel.hxx"
RGBAPixel(const ComponentType &r)
void swap(FixedArray &other)
void Set(ComponentType red, ComponentType green, ComponentType blue, ComponentType alpha)
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
RGBAPixel(const ComponentType r[4])
ConstNeighborhoodIterator< TImage > operator-(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
Define numeric traits for std::vector.
Represent Red, Green, Blue and Alpha components for color images.
std::istream & operator>>(std::istream &is, Point< T, NPointDimension > &v)
const ComponentType & GetAlpha() const
CovariantVector< T, NVectorDimension > operator*(const T &scalar, const CovariantVector< T, NVectorDimension > &v)
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
const ComponentType & GetGreen() const
void SetRed(ComponentType red)
constexpr unsigned int Dimension
Simulate a standard C array with copy semnatics.
void swap(Array< T > &a, Array< T > &b)
const ComponentType & GetBlue() const
ConstNeighborhoodIterator< TImage > operator+(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
void SetGreen(ComponentType green)
void SetBlue(ComponentType blue)
ComponentType GetScalarValue() const
typename NumericTraits< ComponentType >::RealType LuminanceType
void SetAlpha(ComponentType alpha)
bool operator<(const Index< VDimension > &one, const Index< VDimension > &two)
static unsigned int GetNumberOfComponents()
RGBAPixel(const RGBAPixel< TRGBAPixelValueType > &r)
ComponentType GetNthComponent(int c) const
void SetNthComponent(int c, const ComponentType &v)
const ComponentType & GetRed() const