Orfeo Toolbox  3.16
otbImageLayerGenerator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbImageLayerGenerator_h
19 #define __otbImageLayerGenerator_h
20 
21 #include "itkObject.h"
22 #include "itkObjectFactory.h"
24 
25 namespace otb
26 {
48 template <class TImageLayer>
50  : public itk::Object
51 {
52 public:
58 
60  itkNewMacro(Self);
61 
63  itkTypeMacro(ImageLayerGenerator, Object);
64 
66  typedef TImageLayer ImageLayerType;
67  typedef typename ImageLayerType::Pointer ImageLayerPointerType;
68 
70  typedef typename ImageLayerType::ImageType ImageType;
71  typedef typename ImageType::Pointer ImagePointerType;
72 
77 
79  typedef typename ImageLayerType::RenderingFunctionType RenderingFunctionType;
80 // typedef typename ImageLayerType::DefaultRenderingFunctionType DefaultRenderingFunctionType;
81  typedef typename RenderingFunctionType::Pointer RenderingFunctionPointerType;
82 
84  typedef typename ImageLayerType::OutputPixelType OutputPixelType;
85  typedef typename ImageLayerType::BlendingFunctionType BlendingFunctionType;
86  typedef typename BlendingFunctionType::Pointer BlendingFunctionPointerType;
87 
89  typedef typename ImageLayerType::ScalarType ScalarType;
90  typedef typename ImageLayerType::VectorPixelType VectorPixelType;
91  typedef typename ImageLayerType::RGBPixelType RGBPixelType;
92  typedef typename ImageLayerType::RGBAPixelType RGBAPixelType;
93 
95  itkGetObjectMacro(Layer, ImageLayerType);
96 
100  virtual void GenerateLayer();
101 
106  virtual unsigned int GetOptimalSubSamplingRate();
107 
109  itkSetObjectMacro(Image, ImageType);
110  itkGetObjectMacro(Image, ImageType);
111 
113  itkSetObjectMacro(Quicklook, ImageType);
114  itkGetObjectMacro(Quicklook, ImageType);
115 
117  itkSetMacro(SubsamplingRate, unsigned int);
118  itkGetMacro(SubsamplingRate, unsigned int);
119 
121  itkSetMacro(GenerateQuicklook, bool);
122  itkBooleanMacro(GenerateQuicklook);
123 
125  itkSetMacro(ScreenRatio, double);
126  itkGetMacro(ScreenRatio, double);
127 
129 // itkSetObjectMacro(RenderingFunction, RenderingFunctionType);
130 // itkGetObjectMacro(RenderingFunction, RenderingFunctionType);
132  {
133  if (this->m_Layer.IsNull())
134  {
135  itkExceptionMacro(<< "Layer is not set");
136  }
137  if (this->m_Layer->GetRenderingFunction() != func)
138  {
139  this->m_Layer->SetRenderingFunction(func);
140  this->Modified();
141  }
142  }
143 
145  {
146  if (this->m_Layer.IsNull())
147  {
148  itkExceptionMacro(<< "Layer is not set");
149  }
150  return this->m_Layer->GetRenderingFunction();
151  }
152 
154 // itkSetObjectMacro(BlendingFunction, BlendingFunctionType);
155 // itkGetObjectMacro(BlendingFunction, BlendingFunctionType);
157  {
158  if (this->m_Layer.IsNull())
159  {
160  itkExceptionMacro(<< "Layer is not set");
161  }
162  if (this->m_Layer->GetBlendingFunction() != func)
163  {
164  this->m_Layer->SetBlendingFunction(func);
165  this->Modified();
166  }
167  }
168 
170  {
171  if (this->m_Layer.IsNull())
172  {
173  itkExceptionMacro(<< "Layer is not set");
174  }
175  return this->m_Layer->GetBlendingFunction();
176  }
177 
180  {
181  return m_Resampler->GetStreamer();
182  }
183 
184 protected:
188  virtual ~ImageLayerGenerator();
190  void PrintSelf(std::ostream& os, itk::Indent indent) const;
191 
193  virtual void GenerateLayerInformation();
194 
198  virtual void GenerateQuicklook();
199 
201  unsigned int PixelSize(ImagePointerType image, ScalarType* v) const;
202  unsigned int PixelSize(ImagePointerType image, VectorPixelType* v) const;
203  unsigned int PixelSize(ImagePointerType image, RGBPixelType* v) const;
204  unsigned int PixelSize(ImagePointerType image, RGBAPixelType* v) const;
205 
206 private:
207  ImageLayerGenerator(const Self&); // purposely not implemented
208  void operator =(const Self&); // purposely not implemented
209 
212 
214 // RenderingFunctionPointerType m_RenderingFunction;
215 
217 // BlendingFunctionPointerType m_BlendingFunction;
218 
221 
224 
228  unsigned int m_SubsamplingRate;
229 
232 
235 
238 
239 }; // end class
240 } // end namespace otb
241 
242 #ifndef OTB_MANUAL_INSTANTIATION
244 #endif
245 
246 #endif

Generated at Sun Jun 16 2013 00:28:04 for Orfeo Toolbox with doxygen 1.8.3.1