OTB  6.7.0
Orfeo Toolbox
otbRGBAPixelConverter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 
22 #ifndef otbRGBAPixelConverter_h
23 #define otbRGBAPixelConverter_h
24 
25 #include "itkProcessObject.h"
26 #include "itkRGBAPixel.h"
27 #include "itkRGBPixel.h"
28 
29 namespace otb
30 {
44 //RGBA to Scalar
45 template <class TInternalInputPixelType, class TOutputPixelType>
46 class ITK_EXPORT RGBAPixelConverter :
47 public itk::ProcessObject
48 {
49 public:
55 
57  itkTypeMacro(RGBAPixelConverter, ProcessObject);
58 
60  itkNewMacro(Self);
61 
63  typedef TOutputPixelType OutputPixelType;
64 
65  OutputPixelType Convert (InputPixelType input);
66 
67 protected:
69  ~RGBAPixelConverter() override{}
70  void PrintSelf(std::ostream& os, itk::Indent indent) const override
71  {
72  Superclass::PrintSelf(os, indent);
73  }
74 
75 private:
76  RGBAPixelConverter(const Self&) = delete;
77  void operator=(const Self&) = delete;
78 };
79 
80 //RGBA to RGBA
81 template <class TInternalInputPixelType, class TInternalOutputPixelType>
82 class ITK_EXPORT RGBAPixelConverter<TInternalInputPixelType,
83  typename itk::RGBAPixel<TInternalOutputPixelType> > :
84 public itk::ProcessObject
85 {
86 public:
92 
94  itkTypeMacro(RGBAPixelConverter, ProcessObject);
95 
97  itkNewMacro(Self);
98 
101 
102  OutputPixelType Convert (InputPixelType input);
103 
104 protected:
106  ~RGBAPixelConverter() override{}
107  void PrintSelf(std::ostream& os, itk::Indent indent) const override
108  {
109  Superclass::PrintSelf(os, indent);
110  }
111 
112 private:
113  RGBAPixelConverter(const Self&) = delete;
114  void operator=(const Self&) = delete;
115 };
116 
117 //RGBA to RGB
118 template <class TInternalInputPixelType, class TInternalOutputPixelType>
119 class ITK_EXPORT RGBAPixelConverter<TInternalInputPixelType,
120  typename itk::RGBPixel<TInternalOutputPixelType> > :
121 public itk::ProcessObject
122 {
123 public:
129 
131  itkTypeMacro(RGBAPixelConverter, ProcessObject);
132 
134  itkNewMacro(Self);
135 
138 
139  OutputPixelType Convert (InputPixelType input);
140 
141 protected:
143  ~RGBAPixelConverter() override{}
144  void PrintSelf(std::ostream& os, itk::Indent indent) const override
145  {
146  Superclass::PrintSelf(os, indent);
147  }
148 
149 private:
150  RGBAPixelConverter(const Self&) = delete;
151  void operator=(const Self&) = delete;
152 };
153 
154 } // end namespace otb
155 
156 #ifndef OTB_MANUAL_INSTANTIATION
157 #include "otbRGBAPixelConverter.hxx"
158 #endif
159 
160 #endif
itk::SmartPointer< const Self > ConstPointer
Convert an itk::RGBApixel<InternalType> into another pixel type.
TOutputPixelType OutputPixelType
itk::ProcessObject Superclass
void PrintSelf(std::ostream &os, itk::Indent indent) const override
itk::SmartPointer< Self > Pointer
itk::RGBAPixel< TInternalInputPixelType > InputPixelType