21 #ifndef otbChannelSelectorFunctor_h
22 #define otbChannelSelectorFunctor_h
25 #include "itkVariableLengthVector.h"
26 #include "itkRGBPixel.h"
27 #include "itkRGBAPixel.h"
28 #include "itkObject.h"
29 #include "itkObjectFactory.h"
44 template <
class TInputPixel>
61 using ScalarType =
typename itk::NumericTraits<PixelType>::ValueType;
70 return "Channel Selection";
96 outPixel[0] = inPixel;
155 itkExceptionMacro(<<
"Can't get channel " << channelPosition <<
", there is only " <<
m_ChannelList.size() <<
" element in the list");
225 if (std::string(
typeid(
PixelType).name()).
find(
"RGBAPixel") != std::string::npos)
232 else if (std::string(
typeid(
PixelType).name()).
find(
"RGBPixel") != std::string::npos)
238 else if (std::string(
typeid(
PixelType).name()).
find(
"VariableLengthVector") != std::string::npos)
Base class for pixel representation functions.
virtual unsigned int GetGreenChannelIndex() const
virtual unsigned int GetRedChannelIndex() const
itk::SmartPointer< const Self > ConstPointer
virtual unsigned int GetBlueChannelIndex() const
virtual unsigned int GetChannelIndex(unsigned int channelPosition) const
virtual std::vector< unsigned int > GetChannelList() const
itk::SmartPointer< Self > Pointer
virtual void SetAllChannels(unsigned int channel)
ChannelListType m_ChannelList
typename itk::NumericTraits< PixelType >::ValueType ScalarType
virtual void SetRedChannelIndex(unsigned int channel)
itk::VariableLengthVector< ScalarType > VectorPixelType
bool usingDefaultParameters
virtual void SetChannelIndex(unsigned int channelPosition, unsigned int channel)
virtual void SetGreenChannelIndex(unsigned int channel)
const char * GetDescription() const
itk::RGBPixel< ScalarType > RGBPixelType
virtual void SetChannelList(std::vector< unsigned int > channels)
virtual void SetBlueChannelIndex(unsigned int channel)
virtual OutputPixelType operator()(const RGBAPixelType &inPixel) const
virtual OutputPixelType operator()(const VectorPixelType &inPixel) const
virtual OutputPixelType operator()(const RGBPixelType &inPixel) const
virtual bool IsUsingDefaultParameters()
virtual OutputPixelType operator()(ScalarType inPixel) const
itk::RGBAPixel< ScalarType > RGBAPixelType
VectorPixelType OutputPixelType
virtual unsigned int GetOutputSize() const
~ChannelSelectorFunctor()=default
std::vector< unsigned int > ChannelListType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
string_view find(string_view const &haystack, string_view const &needle)