1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #11417 from Turim:imgcodecs_cmake_decoders_customize_formats

* imgcodecs cmake: the option to customize supported formats list (WITH_IMGCODEC_HDR, WITH_IMGCODEC_SUNRASTER, WITH_IMGCODEC_PXM)

* imgcodecs: fixes

- fixed CMake scripts (=OFF doesn't really work)
- restore dropped GDCM block
- added _IMGCODEC_ prefix
- fixed tests
- include PAM format under WITH_IMGCODEC_PXM option
This commit is contained in:
Alexander Enaldiev
2018-05-22 18:10:15 +03:00
committed by Alexander Alekhin
parent 573e790107
commit 84584002f2
14 changed files with 100 additions and 4 deletions
+4
View File
@@ -44,6 +44,8 @@
#include "grfmt_hdr.hpp"
#include "rgbe.hpp"
#ifdef HAVE_IMGCODEC_HDR
namespace cv
{
@@ -166,3 +168,5 @@ bool HdrEncoder::isFormatSupported( int depth ) const {
}
}
#endif // HAVE_IMGCODEC_HDR
+4
View File
@@ -45,6 +45,8 @@
#include "grfmt_base.hpp"
#ifdef HAVE_IMGCODEC_HDR
namespace cv
{
@@ -85,4 +87,6 @@ protected:
}
#endif // HAVE_IMGCODEC_HDR
#endif/*_GRFMT_HDR_H_*/
+6 -1
View File
@@ -46,10 +46,13 @@
//
//M*/
#include "precomp.hpp"
#ifdef HAVE_IMGCODEC_PXM
#include <cerrno>
#include "precomp.hpp"
#include "utils.hpp"
#include "grfmt_pam.hpp"
@@ -720,3 +723,5 @@ bool PAMEncoder::write( const Mat& img, const std::vector<int>& params )
}
}
#endif
+4
View File
@@ -53,6 +53,8 @@
#ifndef _OPENCV_PAM_HPP_
#define _OPENCV_PAM_HPP_
#ifdef HAVE_IMGCODEC_PXM
#include "grfmt_base.hpp"
#include "bitstrm.hpp"
@@ -96,4 +98,6 @@ public:
}
#endif
#endif /* _OPENCV_PAM_HPP_ */
+4
View File
@@ -45,6 +45,8 @@
#include "grfmt_pxm.hpp"
#include <iostream>
#ifdef HAVE_IMGCODEC_PXM
namespace cv
{
@@ -619,3 +621,5 @@ bool PxMEncoder::write(const Mat& img, const std::vector<int>& params)
}
}
#endif // HAVE_IMGCODEC_PXM
+4
View File
@@ -46,6 +46,8 @@
#include "grfmt_base.hpp"
#include "bitstrm.hpp"
#ifdef HAVE_IMGCODEC_PXM
namespace cv
{
@@ -101,4 +103,6 @@ public:
}
#endif // HAVE_IMGCODEC_PXM
#endif/*_GRFMT_PxM_H_*/
+4
View File
@@ -43,6 +43,8 @@
#include "precomp.hpp"
#include "grfmt_sunras.hpp"
#ifdef HAVE_IMGCODEC_SUNRASTER
namespace cv
{
@@ -427,3 +429,5 @@ bool SunRasterEncoder::write( const Mat& img, const std::vector<int>& )
}
}
#endif // HAVE_IMGCODEC_SUNRASTER
+4
View File
@@ -45,6 +45,8 @@
#include "grfmt_base.hpp"
#ifdef HAVE_IMGCODEC_SUNRASTER
namespace cv
{
@@ -102,4 +104,6 @@ public:
}
#endif // HAVE_IMGCODEC_SUNRASTER
#endif/*_GRFMT_SUNRAS_H_*/
+8 -2
View File
@@ -131,8 +131,10 @@ struct ImageCodecInitializer
decoders.push_back( makePtr<BmpDecoder>() );
encoders.push_back( makePtr<BmpEncoder>() );
#ifdef HAVE_IMGCODEC_HDR
decoders.push_back( makePtr<HdrDecoder>() );
encoders.push_back( makePtr<HdrEncoder>() );
#endif
#ifdef HAVE_JPEG
decoders.push_back( makePtr<JpegDecoder>() );
encoders.push_back( makePtr<JpegEncoder>() );
@@ -141,13 +143,19 @@ struct ImageCodecInitializer
decoders.push_back( makePtr<WebPDecoder>() );
encoders.push_back( makePtr<WebPEncoder>() );
#endif
#ifdef HAVE_IMGCODEC_SUNRASTER
decoders.push_back( makePtr<SunRasterDecoder>() );
encoders.push_back( makePtr<SunRasterEncoder>() );
#endif
#ifdef HAVE_IMGCODEC_PXM
decoders.push_back( makePtr<PxMDecoder>() );
encoders.push_back( makePtr<PxMEncoder>(PXM_TYPE_AUTO) );
encoders.push_back( makePtr<PxMEncoder>(PXM_TYPE_PBM) );
encoders.push_back( makePtr<PxMEncoder>(PXM_TYPE_PGM) );
encoders.push_back( makePtr<PxMEncoder>(PXM_TYPE_PPM) );
decoders.push_back( makePtr<PAMDecoder>() );
encoders.push_back( makePtr<PAMEncoder>() );
#endif
#ifdef HAVE_TIFF
decoders.push_back( makePtr<TiffDecoder>() );
encoders.push_back( makePtr<TiffEncoder>() );
@@ -172,8 +180,6 @@ struct ImageCodecInitializer
/// Attach the GDAL Decoder
decoders.push_back( makePtr<GdalDecoder>() );
#endif/*HAVE_GDAL*/
decoders.push_back( makePtr<PAMDecoder>() );
encoders.push_back( makePtr<PAMEncoder>() );
}
std::vector<ImageDecoder> decoders;