21 #ifndef otbImageFileReader_h
22 #define otbImageFileReader_h
24 #if defined(__GNUC__) || defined(__clang__)
25 #pragma GCC diagnostic push
26 #pragma GCC diagnostic ignored "-Wunused-parameter"
27 #include "itkImageSource.h"
28 #pragma GCC diagnostic pop
30 #include "itkImageSource.h"
33 #include "itkExceptionObject.h"
34 #include "itkImageRegion.h"
35 #include "OTBImageIOExport.h"
67 template <
class TOutputImage,
class ConvertPixelTraits = DefaultConvertPixelTraits<
typename TOutputImage::IOPixelType>>
68 class OTBImageIO_EXPORT_TEMPLATE
ImageFileReader :
public itk::ImageSource<TOutputImage>
83 typedef typename TOutputImage::SizeType
SizeType;
98 void GenerateOutputInformation(
void)
override;
101 void GenerateData()
override;
108 void EnlargeOutputRequestedRegion(itk::DataObject* output)
override;
120 virtual void SetFileName(
const std::string& extendedFileName);
122 virtual const char* GetFileName()
const;
126 unsigned int GetOverviewsCount();
131 std::vector<std::string> GetOverviewsInfo();
134 static std::string GetDerivedDatasetSourceFileName(
const std::string& filename);
139 void PrintSelf(std::ostream& os, itk::Indent indent)
const override;
142 void DoConvertBuffer(
void* buffer,
size_t numberOfPixels);
148 void TestValidImageIO();
153 bool GetGdalReadImageFileName(
const std::string& filename, std::string& GdalFileName);
156 void operator=(
const Self&) =
delete;
186 #ifndef OTB_MANUAL_INSTANTIATION
199 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<unsigned int, 2>>;
200 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<int, 2>>;
201 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<unsigned char, 2>>;
202 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<char, 2>>;
203 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<unsigned short, 2>>;
204 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<short, 2>>;
205 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<float, 2>>;
206 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<double, 2>>;
207 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<std::complex<int>, 2>>;
208 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<std::complex<short>, 2>>;
209 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<std::complex<float>, 2>>;
210 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<std::complex<double>, 2>>;
211 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<unsigned int, 2>>;
212 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<int, 2>>;
213 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<unsigned char, 2>>;
214 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<char, 2>>;
215 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<unsigned short, 2>>;
216 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<short, 2>>;
217 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<float, 2>>;
218 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<double, 2>>;
219 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<std::complex<int>, 2>>;
220 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<std::complex<short>, 2>>;
221 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<std::complex<float>, 2>>;
222 extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<std::complex<double>, 2>>;
225 #endif // otbImageFileReader_h