|
ITK
6.0.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;
81 #ifdef ITK_FUTURE_LEGACY_REMOVE
94 template <
typename TRGBAPixelValueType>
103 #if defined(ITK_LEGACY_REMOVE)
110 RGBAPixel(
const ComponentType & r) { this->Fill(r); }
116 operator=(
const ComponentType r[4]);
124 operator*(
const ComponentType & r)
const;
126 operator/(
const ComponentType & r)
const;
131 operator+=(
const Self & r);
133 operator-=(
const Self & r);
135 operator*=(
const ComponentType & r);
137 operator/=(
const ComponentType & r);
158 return this->operator[](c);
165 return static_cast<ComponentType>(
166 std::sqrt(static_cast<double>(this->
operator[](0)) * static_cast<double>(this->
operator[](0)) +
167 static_cast<double>(this->
operator[](1)) * static_cast<double>(this->
operator[](1)) +
168 static_cast<double>(this->
operator[](2)) * static_cast<double>(this->
operator[](2))));
175 this->operator[](c) = v;
182 this->operator[](0) = red;
189 this->operator[](1) = green;
196 this->operator[](2) = blue;
203 this->operator[](3) = alpha;
210 this->operator[](0) = red;
211 this->operator[](1) = green;
212 this->operator[](2) = blue;
213 this->operator[](3) = alpha;
218 const ComponentType &
221 return this->operator[](0);
225 const ComponentType &
228 return this->operator[](1);
232 const ComponentType &
235 return this->operator[](2);
239 const ComponentType &
242 return this->operator[](3);
247 GetLuminance()
const;
250 template <
typename TComponent>
252 operator<<(std::ostream & os,
const RGBAPixel<TComponent> & c);
254 template <
typename TComponent>
256 operator>>(std::istream & is, RGBAPixel<TComponent> & c);
258 template <
typename T>
277 #ifndef ITK_MANUAL_INSTANTIATION
278 # include "itkRGBAPixel.hxx"
bool operator<(const Index< VDimension > &one, const Index< VDimension > &two)
const ComponentType & GetBlue() const
void SetGreen(ComponentType green)
ComponentType GetScalarValue() const
CovariantVector< T, VVectorDimension > operator*(const T &scalar, const CovariantVector< T, VVectorDimension > &v)
RGBAPixel(const RGBAPixel< TRGBAPixelValueType > &r)
void SetNthComponent(int c, const ComponentType &v)
ConstNeighborhoodIterator< TImage > operator-(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
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.
void swap(Array< T > &a, Array< T > &b) noexcept
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
const ComponentType & GetGreen() const
ComponentType GetNthComponent(int c) const
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