 |
ITK
5.4.0
Insight Toolkit
|
Go to the documentation of this file.
18 #ifndef itkRGBAPixel_h
19 #define itkRGBAPixel_h
58 template <
typename TComponent =
unsigned short>
70 static constexpr
unsigned int Length = 4;
84 template <
typename TRGBAPixelValueType>
93 #if defined(ITK_LEGACY_REMOVE)
100 RGBAPixel(
const ComponentType & r) { this->Fill(r); }
106 operator=(
const ComponentType r[4]);
115 operator/(
const ComponentType & r)
const;
120 operator+=(
const Self & r);
122 operator-=(
const Self & r);
124 operator*=(
const ComponentType & r);
126 operator/=(
const ComponentType & r);
147 return this->operator[](c);
154 return static_cast<ComponentType>(
155 std::sqrt(static_cast<double>(this->
operator[](0)) * static_cast<double>(this->
operator[](0)) +
156 static_cast<double>(this->
operator[](1)) * static_cast<double>(this->
operator[](1)) +
157 static_cast<double>(this->
operator[](2)) * static_cast<double>(this->
operator[](2))));
164 this->operator[](c) = v;
171 this->operator[](0) = red;
178 this->operator[](1) = green;
185 this->operator[](2) = blue;
192 this->operator[](3) = alpha;
199 this->operator[](0) = red;
200 this->operator[](1) = green;
201 this->operator[](2) = blue;
202 this->operator[](3) = alpha;
207 const ComponentType &
210 return this->operator[](0);
214 const ComponentType &
217 return this->operator[](1);
221 const ComponentType &
224 return this->operator[](2);
228 const ComponentType &
231 return this->operator[](3);
236 GetLuminance()
const;
239 template <
typename TComponent>
241 operator<<(std::ostream & os,
const RGBAPixel<TComponent> & c);
243 template <
typename TComponent>
245 operator>>(std::istream & is, RGBAPixel<TComponent> & c);
247 template <
typename T>
266 #ifndef ITK_MANUAL_INSTANTIATION
267 # include "itkRGBAPixel.hxx"
bool operator<(const Index< VDimension > &one, const Index< VDimension > &two)
const ComponentType & GetBlue() const
void SetGreen(ComponentType green)
ComponentType GetScalarValue() const
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
CovariantVector< T, VVectorDimension > operator*(const T &scalar, const CovariantVector< T, VVectorDimension > &v)
RGBAPixel(const RGBAPixel< TRGBAPixelValueType > &r)
void SetNthComponent(int c, const ComponentType &v)
void swap(Array< T > &a, Array< T > &b)
ConstNeighborhoodIterator< TImage > operator-(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
RGBAPixel(const ComponentType r[4])
static unsigned int GetNumberOfComponents()
void SetRed(ComponentType red)
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
RGBAPixel(const ComponentType &r)
const ComponentType & GetRed() const
Simulate a standard C array with copy semantics.
void Set(ComponentType red, ComponentType green, ComponentType blue, ComponentType alpha)
Represent Red, Green, Blue and Alpha components for color images.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
const ComponentType & GetGreen() const
ComponentType GetNthComponent(int c) const
void swap(FixedArray &other)
ConstNeighborhoodIterator< TImage > operator+(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
const ComponentType & GetAlpha() const
void SetAlpha(ComponentType alpha)
constexpr unsigned int Dimension
void SetBlue(ComponentType blue)
std::istream & operator>>(std::istream &is, Point< T, VPointDimension > &vct)
typename NumericTraits< ComponentType >::RealType LuminanceType