Commit 0a4ef44a authored by Guillaume Pasero's avatar Guillaume Pasero

Merge branch '1649-extern-templates-take3' into 'develop'

Start usage of extern templates

See merge request orfeotoolbox/otb!377
parents 67c782b6 d92282d4
This diff is collapsed.
......@@ -37,7 +37,7 @@ elseif(APPLE)
set( USE_COMPILER_HIDDEN_VISIBILITY OFF CACHE INTERNAL "" )
endif()
include(GenerateExportHeader)
include(GenerateExportHeaderCustom)
if(OTB_CPPCHECK_TEST)
include(${_OTBModuleMacros_DIR}/OTBModuleCPPCheckTest.cmake)
......
#ifndef @INCLUDE_GUARD_NAME@
#define @INCLUDE_GUARD_NAME@
#ifdef @STATIC_DEFINE@
# define @EXPORT_MACRO_NAME@
# define @NO_EXPORT_MACRO_NAME@
# define @EXPORT_TEMPLATE_MACRO_NAME@
# define @EXPORT_EXPLICIT_TEMPLATE_MACRO_NAME@
#else
# ifndef @EXPORT_MACRO_NAME@
# ifdef @EXPORT_IMPORT_CONDITION@
/* We are building this library */
# define @EXPORT_MACRO_NAME@ @DEFINE_EXPORT@
# else
/* We are using this library */
# define @EXPORT_MACRO_NAME@ @DEFINE_IMPORT@
# endif
# endif
# ifndef @EXPORT_TEMPLATE_MACRO_NAME@
/* We are building this library */
# define @EXPORT_TEMPLATE_MACRO_NAME@ @DEFINE_TEMPLATE_EXPORT@
# else
/* We are using this library */
# define @EXPORT_TEMPLATE_MACRO_NAME@ @DEFINE_TEMPLATE_IMPORT@
# endif
# ifndef @EXPORT_EXPLICIT_TEMPLATE_MACRO_NAME@
/* We are building this library */
# define @EXPORT_EXPLICIT_TEMPLATE_MACRO_NAME@ @DEFINE_EXPLICIT_TEMPLATE_EXPORT@
# else
/* We are using this library */
# define @EXPORT_EXPLICIT_TEMPLATE_MACRO_NAME@ @DEFINE_EXPLICIT_TEMPLATE_IMPORT@
# endif
# ifndef @NO_EXPORT_MACRO_NAME@
# define @NO_EXPORT_MACRO_NAME@ @DEFINE_NO_EXPORT@
# endif
#endif
#ifndef @DEPRECATED_MACRO_NAME@
# define @DEPRECATED_MACRO_NAME@ @DEFINE_DEPRECATED@
#endif
#ifndef @DEPRECATED_MACRO_NAME@_EXPORT
# define @DEPRECATED_MACRO_NAME@_EXPORT @EXPORT_MACRO_NAME@ @DEPRECATED_MACRO_NAME@
#endif
#ifndef @DEPRECATED_MACRO_NAME@_NO_EXPORT
# define @DEPRECATED_MACRO_NAME@_NO_EXPORT @NO_EXPORT_MACRO_NAME@ @DEPRECATED_MACRO_NAME@
#endif
#if @DEFINE_NO_DEPRECATED@ /* DEFINE_NO_DEPRECATED */
# ifndef @NO_DEPRECATED_MACRO_NAME@
# define @NO_DEPRECATED_MACRO_NAME@
# endif
#endif
@CUSTOM_CONTENT@
#endif /* @INCLUDE_GUARD_NAME@ */
......@@ -24,6 +24,7 @@
#include <complex>
#include "itkObject.h"
#include "OTBImageBaseExport.h"
namespace otb
{
......@@ -46,7 +47,7 @@ template <
typename OutputPixelType,
class OutputConvertTraits
>
class ConvertPixelBuffer
class OTBImageBase_EXPORT_TEMPLATE ConvertPixelBuffer
{
public:
/** Determine the output data type. */
......
......@@ -22,13 +22,14 @@
#define otbDefaultConvertPixelTraits_h
#include "itkDefaultConvertPixelTraits.h"
#include "OTBImageBaseExport.h"
namespace otb
{
template < typename PixelType>
class DefaultConvertPixelTraits
class OTBImageBase_EXPORT_TEMPLATE DefaultConvertPixelTraits
: public itk::DefaultConvertPixelTraits < PixelType >
{
public:
......
......@@ -24,6 +24,7 @@
#include "otbExtractROIBase.h"
#include "otbImage.h"
#include "itkMacro.h"
#include "OTBImageBaseExport.h"
namespace otb
{
......@@ -39,7 +40,7 @@ namespace otb
* \ingroup OTBImageBase
*/
template <class TInputPixel, class TOutputPixel>
class ITK_EXPORT ExtractROI :
class OTBImageBase_EXPORT_TEMPLATE ExtractROI :
public ExtractROIBase<Image<TInputPixel, 2>, Image<TOutputPixel, 2> >
{
public:
......
......@@ -45,7 +45,7 @@ namespace otb
* \ingroup OTBImageBase
*/
template <class TInputImage, class TOutputImage>
class ITK_EXPORT ExtractROIBase :
class ExtractROIBase :
public itk::ImageToImageFilter<TInputImage, TOutputImage>
{
public:
......
......@@ -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,4 +275,25 @@ 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 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>;
}
#endif
......@@ -24,7 +24,7 @@
#include "itkImageFunction.h"
#include "otbVariableLengthVectorConverter.h"
#include "OTBImageBaseExport.h"
#include <complex>
......@@ -46,7 +46,7 @@ namespace otb
*/
template< class TInternalImageFunctionType, class TOutputPrecision = double >
class ITK_EXPORT ImageFunctionAdaptor :
class OTBImageBase_EXPORT_TEMPLATE ImageFunctionAdaptor :
public itk::ImageFunction< typename TInternalImageFunctionType::InputImageType,
itk::VariableLengthVector<TOutputPrecision>,
typename TInternalImageFunctionType::CoordRepType >
......
......@@ -24,6 +24,7 @@
#include "otbExtractROIBase.h"
#include "otbImage.h"
#include "otbVectorImage.h"
#include "OTBImageBaseExport.h"
#include "itkMacro.h"
......@@ -37,7 +38,7 @@ namespace otb
* \ingroup OTBImageBase
*/
template <class TInputImage, class TOutputImage>
class ITK_EXPORT ImageOfVectorsToMonoChannelExtractROI :
class OTBImageBase_EXPORT_TEMPLATE ImageOfVectorsToMonoChannelExtractROI :
public ExtractROIBase<TInputImage, TOutputImage>
{
public:
......
......@@ -24,6 +24,7 @@
#include "itkFunctionBase.h"
#include "itkPoint.h"
#include "itkVariableLengthVector.h"
#include "OTBImageBaseExport.h"
#include <vector>
......@@ -44,7 +45,7 @@ namespace otb
* \ingroup OTBImageBase
*/
template <class TOutputPrecision = double, class TCoordRep = double>
class ITK_EXPORT MetaImageFunction
class OTBImageBase_EXPORT_TEMPLATE MetaImageFunction
: public itk::FunctionBase<itk::Point<TCoordRep, 2>,
itk::VariableLengthVector<TOutputPrecision> >
{
......
......@@ -23,6 +23,7 @@
#include "otbExtractROIBase.h"
#include "otbVectorImage.h"
#include "OTBImageBaseExport.h"
#include "itkMacro.h"
#include <vector>
......@@ -43,7 +44,7 @@ namespace otb
* \ingroup OTBImageBase
*/
template <class TInputPixelType, class TOutputPixelType>
class ITK_EXPORT MultiChannelExtractROI :
class OTBImageBase_EXPORT_TEMPLATE MultiChannelExtractROI :
public ExtractROIBase<VectorImage<TInputPixelType, 2>, VectorImage<TOutputPixelType, 2> >
{
public:
......
......@@ -24,6 +24,7 @@
#include "otbExtractROIBase.h"
#include "otbImage.h"
#include "otbVectorImage.h"
#include "OTBImageBaseExport.h"
#include "itkMacro.h"
......@@ -42,7 +43,7 @@ namespace otb
* \ingroup OTBImageBase
*/
template <class TInputPixelType, class TOutputPixelType>
class ITK_EXPORT MultiToMonoChannelExtractROI :
class OTBImageBase_EXPORT_TEMPLATE MultiToMonoChannelExtractROI :
// public ExtractROIBase< itk::VectorImage<TInputPixelType, 2> , itk::Image<TOutputPixelType, 2> >
public ExtractROIBase<VectorImage<TInputPixelType, 2>, Image<TOutputPixelType, 2> >
{
......
......@@ -24,7 +24,7 @@
#include <algorithm>
#include <iomanip>
#include "OTBImageBaseExport.h"
#include "otbImageKeywordlist.h"
#include "itkImageRegion.h"
#include <string>
......@@ -56,7 +56,7 @@ namespace otb
*/
template <class TType>
class ITK_EXPORT RemoteSensingRegion : public itk::Region
class OTBImageBase_EXPORT_TEMPLATE RemoteSensingRegion : public itk::Region
{
public:
/** Standard class typedefs. */
......
......@@ -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,4 +216,25 @@ 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 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>;
}
#endif
......@@ -20,6 +20,8 @@
set(OTBImageBase_SRC
otbImageIOBase.cxx
otbImage.cxx
otbVectorImage.cxx
)
add_library(OTBImageBase ${OTBImageBase_SRC})
......
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbImage.h"
namespace otb {
// Explicit instanciation of common types
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>;
}
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbVectorImage.h"
namespace otb {
// Explicit instanciation of common types
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>;
}
......@@ -180,7 +180,6 @@ public:
void Set(ObjectPointerType element)
{
(*m_Iter) = element;
this->Modified();
}
/**
* Increment.
......
......@@ -247,7 +247,7 @@ ObjectList<TObject>
::Insert(ReverseIterator position, ObjectPointerType element)
{
ReverseIterator iter(
InternalContainerType::reverse_iterator(
(typename InternalContainerType::reverse_iterator)(
m_InternalContainer.insert(position.GetIter().base(), element)
)
);
......
......@@ -32,39 +32,17 @@
#include "otbImageIOBase.h"
#include "itkExceptionObject.h"
#include "itkImageRegion.h"
#include "OTBImageIOExport.h"
#include "otbDefaultConvertPixelTraits.h"
#include "otbImageKeywordlist.h"
#include "otbExtendedFilenameToReaderOptions.h"
#include "otbImageFileReaderException.h"
#include <string>
namespace otb
{
/** \class ImageFileReaderException
*
* \brief Base exception class for IO conflicts.
*
* \ingroup OTBImageIO
*/
class ImageFileReaderException : public itk::ExceptionObject
{
public:
/** Run-time information. */
itkTypeMacro( ImageFileReaderException, ExceptionObject );
/** Constructor. */
ImageFileReaderException(const char *file, unsigned int line,
const std::string& desc = "",
const std::string& filename = "") :
ExceptionObject(file, line, desc),
m_Filename(filename)
{
}
std::string m_Filename;
};
/** \class ImageFileReader
* \brief Reads image data.
*
......@@ -89,7 +67,7 @@ public:
template <class TOutputImage,
class ConvertPixelTraits=DefaultConvertPixelTraits<
typename TOutputImage::IOPixelType > >
class ITK_EXPORT ImageFileReader : public itk::ImageSource<TOutputImage>
class OTBImageIO_EXPORT_TEMPLATE ImageFileReader : public itk::ImageSource<TOutputImage>
{
public:
/** Standard class typedefs. */
......@@ -212,4 +190,39 @@ private:
#include "otbImageFileReader.hxx"
#endif
#include "otbImage.h"
#include "otbVectorImage.h"
#include <complex>
namespace otb {
// Prevent implicit instanciation of common types to improve build performance
// Explicit instanciations are provided in the .cxx
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<unsigned int, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<int, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<unsigned char, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<char, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<unsigned short, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<short, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<float, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<double, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<std::complex<int>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<std::complex<short>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<std::complex<float>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<Image<std::complex<double>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<unsigned int, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<int, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<unsigned char, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<char, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<unsigned short, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<short, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<float, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<double, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<std::complex<int>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<std::complex<short>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<std::complex<float>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileReader<VectorImage<std::complex<double>, 2>>;
}
#endif // otbImageFileReader_h
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbImageFileReaderException_h
#define otbImageFileReaderException_h
#include "itkMacro.h"
#include "OTBImageIOExport.h"
namespace otb
{
/** \class ImageFileReaderException
*
* \brief Base exception class for IO conflicts.
*
* \ingroup OTBImageIO
*/
class OTBImageIO_EXPORT ImageFileReaderException : public itk::ExceptionObject
{
public:
/** Run-time information. */
itkTypeMacro( ImageFileReaderException, ExceptionObject );
/** Constructor. */
ImageFileReaderException(const char *file, unsigned int line,
const std::string& desc = "",
const std::string& filename = "");
/** Destructor. */
~ImageFileReaderException();
std::string m_Filename;
};
}
#endif
......@@ -27,6 +27,7 @@
#include "otbExtendedFilenameToWriterOptions.h"
#include "itkFastMutexLock.h"
#include <string>
#include "OTBImageIOExport.h"
namespace otb
{
......@@ -61,7 +62,7 @@ namespace otb
* \ingroup OTBImageIO
*/
template <class TInputImage>
class ITK_EXPORT ImageFileWriter : public itk::ProcessObject
class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter : public itk::ProcessObject
{
public:
/** Standard class typedefs. */
......@@ -290,4 +291,39 @@ private:
#include "otbImageFileWriter.hxx"
#endif
#include "otbImage.h"
#include "otbVectorImage.h"
#include <complex>
namespace otb {
// Prevent implicit instanciation of common types to improve build performance
// Explicit instanciations are provided in the .cxx
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<unsigned int, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<int, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<unsigned char, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<char, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<unsigned short, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<short, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<float, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<double, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<std::complex<int>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<std::complex<short>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<std::complex<float>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<Image<std::complex<double>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<unsigned int, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<int, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<unsigned char, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<char, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<unsigned short, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<short, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<float, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<double, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<std::complex<int>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<std::complex<short>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<std::complex<float>, 2>>;
extern template class OTBImageIO_EXPORT_TEMPLATE ImageFileWriter<VectorImage<std::complex<double>, 2>>;
}
#endif
......@@ -30,6 +30,7 @@
#include "otbExtractROI.h"
#include "otbMultiChannelExtractROI.h"
#include "otbMultiToMonoChannelExtractROI.h"
#include "OTBImageIOExport.h"
namespace otb {
......@@ -47,7 +48,7 @@ namespace otb {
* \ingroup OTBImageIO
*/
template <class TImage, class TInternalImage = TImage>
class ITK_EXPORT ImageSeriesFileReader
class OTBImageIO_EXPORT_TEMPLATE ImageSeriesFileReader
: public ImageSeriesFileReaderBase<TImage, TInternalImage>
{
public:
......
......@@ -64,7 +64,7 @@ public:
*/
template <class TImage, class TInternalImage = TImage>
class ITK_EXPORT ImageSeriesFileReaderBase
class ImageSeriesFileReaderBase
: public ImageListSource<TImage>
{
public:
......
......@@ -24,6 +24,7 @@
#include "otbVectorImage.h"
#include "otbImageFileWriter.h"
#include "OTBImageIOExport.h"
namespace otb
{
......@@ -39,7 +40,7 @@ namespace otb
*/
template <class TBufferType, class TOutputPixelType=TBufferType>
class ITK_EXPORT ScalarBufferToImageFileWriter : public itk::ProcessObject
class OTBImageIO_EXPORT_TEMPLATE ScalarBufferToImageFileWriter : public itk::ProcessObject
{
public:
......
......@@ -21,6 +21,9 @@
set(OTBImageIO_SRC
otbImageIOFactory.cxx
otbMultiImageFileWriter.cxx
otbImageFileReader.cxx
otbImageFileWriter.cxx
otbImageFileReaderException.cxx
)
add_library(OTBImageIO ${OTBImageIO_SRC})
......
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "otbImageFileReader.h"
namespace otb {