mirror of https://github.com/ecmwf/eccodes.git
ECC-396: Support for Jasper 2.0
This commit is contained in:
parent
3dd428aa4f
commit
073c35418c
|
@ -148,6 +148,8 @@ if( ENABLE_JPG )
|
||||||
list( APPEND ECCODES_TPLS Jasper )
|
list( APPEND ECCODES_TPLS Jasper )
|
||||||
set( HAVE_JPEG 1 )
|
set( HAVE_JPEG 1 )
|
||||||
set( HAVE_LIBJASPER 1 )
|
set( HAVE_LIBJASPER 1 )
|
||||||
|
# Extract Jasper's major version number to enable conditional code. See ECC-396
|
||||||
|
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" JASPER_VERSION_MAJOR "${JASPER_VERSION_STRING}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( OPENJPEG_FOUND )
|
if( OPENJPEG_FOUND )
|
||||||
|
|
|
@ -107,4 +107,8 @@
|
||||||
#define ECCODES_IFS_SAMPLES_PATH "/MEMFS/ifs_samples"
|
#define ECCODES_IFS_SAMPLES_PATH "/MEMFS/ifs_samples"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBJASPER
|
||||||
|
#define JASPER_VERSION_MAJOR @JASPER_VERSION_MAJOR@
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* eccodes_config_h */
|
#endif /* eccodes_config_h */
|
||||||
|
|
|
@ -110,7 +110,13 @@ int grib_jasper_encode(grib_context *c, j2k_encode_helper *helper)
|
||||||
image.maxcmpts_ = 1;
|
image.maxcmpts_ = 1;
|
||||||
image.clrspc_ = JAS_CLRSPC_SGRAY;
|
image.clrspc_ = JAS_CLRSPC_SGRAY;
|
||||||
image.cmprof_ = 0;
|
image.cmprof_ = 0;
|
||||||
|
|
||||||
|
#if JASPER_VERSION_MAJOR == 1
|
||||||
|
/* ECC-396: Support for Jasper 2.0
|
||||||
|
* Jasper version 1 had the 'inmem_' data member but
|
||||||
|
* version 2 removed it from the interface */
|
||||||
image.inmem_ = 1;
|
image.inmem_ = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
cmpt.tlx_ = 0;
|
cmpt.tlx_ = 0;
|
||||||
cmpt.tly_ = 0;
|
cmpt.tly_ = 0;
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#undef PACKAGE_STRING
|
#undef PACKAGE_STRING
|
||||||
#undef PACKAGE_TARNAME
|
#undef PACKAGE_TARNAME
|
||||||
#undef PACKAGE_VERSION
|
#undef PACKAGE_VERSION
|
||||||
#include "jasper/jasper.h"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FLOATING_POINT_EXCEPTIONS
|
#ifdef ENABLE_FLOATING_POINT_EXCEPTIONS
|
||||||
|
|
Loading…
Reference in New Issue