22 #ifndef __otbPrintableImageFilter_h
23 #define __otbPrintableImageFilter_h
41 template<
class TInputPixel,
class TMaskPixel,
class TOutputPixel>
47 m_BackgroundValue = 0;
48 m_ObjectColor.SetSize(3);
49 m_ObjectColor.Fill(255);
60 return m_BackgroundValue;
64 m_BackgroundValue = val;
79 if (maskPix == m_BackgroundValue)
81 outPix.SetSize(inPix.Size());
82 for (
unsigned int i = 0; i < outPix.Size(); ++i)
89 outPix = m_ObjectColor;
116 template <
class TInputImage,
class TMaskImage = otb::Image<
unsigned char, 2> >
159 void PrintSelf(std::ostream& os,
itk::Indent indent)
const;
161 void SetChannel(
unsigned int channel);
183 itkSetMacro(UseMask,
bool);
184 itkGetMacro(UseMask,
bool);
188 return m_ChannelList;
193 if (chList.size() != 3)
195 itkExceptionMacro(<<
"Invalid channel list, size is " << chList.size() <<
" instead of 3");
197 m_ChannelList = chList;
206 itkExceptionMacro(<<
"Invalid object color, size is " << val.
Size() <<
" instead of 3");
209 m_MaskFilter->GetFunctor().SetObjectColor(val);
212 itkGetMacro(ObjectColor, OutputPixelType);
216 m_BackgroundMaskValue = val;
217 m_MaskFilter->GetFunctor().SetBackgroundValue(val);
220 itkGetMacro(BackgroundMaskValue, MaskPixelType);
230 virtual void GenerateOutputInformation();
236 void BeforeGenerateData();
242 void operator =(
const Self&);
263 #ifndef OTB_MANUAL_INSTANTIATION