Commit 1c476443 authored by Guillaume Pasero's avatar Guillaume Pasero

ENH: fix export macros for Image and VectorImage, add complex

parent 1c00fe21
......@@ -31,6 +31,7 @@
#endif
#include "otbImageMetadataInterfaceBase.h"
#include "OTBImageBaseExport.h"
namespace otb
{
......@@ -85,7 +86,7 @@ namespace otb
*/
template <class TPixel, unsigned int VImageDimension = 2>
class ITK_EXPORT Image : public itk::Image<TPixel, VImageDimension>
class OTBImageBase_EXPORT_TEMPLATE Image : public itk::Image<TPixel, VImageDimension>
{
public:
/** Standard class typedefs. */
......@@ -274,18 +275,24 @@ private:
#include "otbImage.hxx"
#endif
#include <complex>
namespace otb {
// Prevent implicit instanciation of common types to improve build performance
// Explicit instanciations are provided in the .cxx
extern template class Image<unsigned int, 2>;
extern template class Image<int, 2>;
extern template class Image<unsigned char, 2>;
extern template class Image<char, 2>;
extern template class Image<unsigned short, 2>;
extern template class Image<short, 2>;
extern template class Image<float, 2>;
extern template class Image<double, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<unsigned int, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<int, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<unsigned char, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<char, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<unsigned short, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<short, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<float, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<double, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<std::complex<int> , 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<std::complex<short> , 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<std::complex<float> , 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE Image<std::complex<double> , 2>;
}
......
......@@ -30,6 +30,7 @@
#include "itkVectorImage.h"
#endif
#include "otbImageMetadataInterfaceBase.h"
#include "OTBImageBaseExport.h"
namespace otb
{
......@@ -40,7 +41,7 @@ namespace otb
* \ingroup OTBImageBase
*/
template <class TPixel, unsigned int VImageDimension = 2>
class ITK_EXPORT VectorImage : public itk::VectorImage<TPixel, VImageDimension>
class OTBImageBase_EXPORT_TEMPLATE VectorImage : public itk::VectorImage<TPixel, VImageDimension>
{
public:
......@@ -215,18 +216,24 @@ private:
#include "otbVectorImage.hxx"
#endif
#include <complex>
namespace otb {
// Prevent implicit instanciation of common types to improve build performance
// Explicit instanciations are provided in the .cxx
extern template class VectorImage<unsigned int, 2>;
extern template class VectorImage<int, 2>;
extern template class VectorImage<unsigned char, 2>;
extern template class VectorImage<char, 2>;
extern template class VectorImage<unsigned short, 2>;
extern template class VectorImage<short, 2>;
extern template class VectorImage<float, 2>;
extern template class VectorImage<double, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<unsigned int, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<int, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<unsigned char, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<char, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<unsigned short, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<short, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<float, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<double, 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<std::complex<int> , 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<std::complex<short> , 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<std::complex<float> , 2>;
extern template class OTBImageBase_EXPORT_TEMPLATE VectorImage<std::complex<double> , 2>;
}
......
......@@ -23,12 +23,16 @@
namespace otb {
// Explicit instanciation of common types
template class Image<unsigned int, 2>;
template class Image<int, 2>;
template class Image<unsigned char, 2>;
template class Image<char, 2>;
template class Image<unsigned short, 2>;
template class Image<short, 2>;
template class Image<float, 2>;
template class Image<double, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<unsigned int, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<int, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<unsigned char, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<char, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<unsigned short, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<short, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<float, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<double, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<std::complex<int>, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<std::complex<short>, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<std::complex<float>, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE Image<std::complex<double>, 2>;
}
......@@ -23,14 +23,18 @@
namespace otb {
// Explicit instanciation of common types
template class VectorImage<unsigned int, 2>;
template class VectorImage<int, 2>;
template class VectorImage<unsigned char, 2>;
template class VectorImage<char, 2>;
template class VectorImage<unsigned short, 2>;
template class VectorImage<short, 2>;
template class VectorImage<float, 2>;
template class VectorImage<double, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<unsigned int, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<int, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<unsigned char, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<char, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<unsigned short, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<short, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<float, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<double, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<std::complex<int>, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<std::complex<short>, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<std::complex<float>, 2>;
template class OTBImageBase_EXPORT_EXPLICIT_TEMPLATE VectorImage<std::complex<double>, 2>;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment