| openjpeg.h (2.0) | | openjpeg.h (2.0.1) | |
| /* | | /* | |
|
| * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, U | | * The copyright in this software is being made available under the 2-claus | |
| niversite catholique de Louvain (UCL), Belgium | | es | |
| * Copyright (c) 2002-2007, Professor Benoit Macq | | * BSD License, included below. This software may be subject to other third | |
| | | * party and contributor rights, including patent rights, and no such right | |
| | | s | |
| | | * are granted under this license. | |
| | | * | |
| | | * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium | |
| | | * Copyright (c) 2002-2014, Professor Benoit Macq | |
| * Copyright (c) 2001-2003, David Janssens | | * Copyright (c) 2001-2003, David Janssens | |
| * Copyright (c) 2002-2003, Yannick Verschueren | | * Copyright (c) 2002-2003, Yannick Verschueren | |
|
| * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe | | * Copyright (c) 2003-2007, Francois-Olivier Devaux | |
| | | * Copyright (c) 2003-2014, Antonin Descampe | |
| * Copyright (c) 2005, Herve Drolon, FreeImage Team | | * Copyright (c) 2005, Herve Drolon, FreeImage Team | |
| * Copyright (c) 2006-2007, Parvatha Elangovan | | * Copyright (c) 2006-2007, Parvatha Elangovan | |
| * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fime
s@c-s.fr> | | * Copyright (c) 2008, Jerome Fimes, Communications & Systemes <jerome.fime
s@c-s.fr> | |
| * Copyright (c) 2010-2011, Kaori Hagihara | | * Copyright (c) 2010-2011, Kaori Hagihara | |
| * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), Fran
ce | | * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), Fran
ce | |
| * Copyright (c) 2012, CS Systemes d'Information, France | | * Copyright (c) 2012, CS Systemes d'Information, France | |
| * All rights reserved. | | * All rights reserved. | |
| * | | * | |
| * Redistribution and use in source and binary forms, with or without | | * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions | | * modification, are permitted provided that the following conditions | |
| | | | |
| skipping to change at line 45 | | skipping to change at line 51 | |
| */ | | */ | |
| #ifndef OPENJPEG_H | | #ifndef OPENJPEG_H | |
| #define OPENJPEG_H | | #define OPENJPEG_H | |
| | | | |
| /* | | /* | |
| ========================================================== | | ========================================================== | |
| Compiler directives | | Compiler directives | |
| ========================================================== | | ========================================================== | |
| */ | | */ | |
| | | | |
|
| | | /* | |
| | | The inline keyword is supported by C99 but not by C90. | |
| | | Most compilers implement their own version of this keyword ... | |
| | | */ | |
| | | #ifndef INLINE | |
| | | #if defined(_MSC_VER) | |
| | | #define INLINE __forceinline | |
| | | #elif defined(__GNUC__) | |
| | | #define INLINE __inline__ | |
| | | #elif defined(__MWERKS__) | |
| | | #define INLINE inline | |
| | | #else | |
| | | /* add other compilers here ... */ | |
| | | #define INLINE | |
| | | #endif /* defined(<Compiler>) */ | |
| | | #endif /* INLINE */ | |
| | | | |
| /* deprecated attribute */ | | /* deprecated attribute */ | |
| #ifdef __GNUC__ | | #ifdef __GNUC__ | |
|
| #define DEPRECATED(func) func __attribute__ ((deprecated)) | | #define OPJ_DEPRECATED(func) func __attribute__ ((deprecated)) | |
| #elif defined(_MSC_VER) | | #elif defined(_MSC_VER) | |
|
| #define DEPRECATED(func) __declspec(deprecated) func | | #define OPJ_DEPRECATED(func) __declspec(deprecated) func | |
| #else | | #else | |
| #pragma message("WARNING: You need to implement DEPRECATED for this
compiler") | | #pragma message("WARNING: You need to implement DEPRECATED for this
compiler") | |
|
| #define DEPRECATED(func) func | | #define OPJ_DEPRECATED(func) func | |
| #endif | | #endif | |
| | | | |
| #if defined(OPJ_STATIC) || !defined(_WIN32) | | #if defined(OPJ_STATIC) || !defined(_WIN32) | |
| /* http://gcc.gnu.org/wiki/Visibility */ | | /* http://gcc.gnu.org/wiki/Visibility */ | |
| #if __GNUC__ >= 4 | | #if __GNUC__ >= 4 | |
| #define OPJ_API __attribute__ ((visibility ("default"))) | | #define OPJ_API __attribute__ ((visibility ("default"))) | |
| #define OPJ_LOCAL __attribute__ ((visibility ("hidden"))) | | #define OPJ_LOCAL __attribute__ ((visibility ("hidden"))) | |
| #else | | #else | |
| #define OPJ_API | | #define OPJ_API | |
| #define OPJ_LOCAL | | #define OPJ_LOCAL | |
| | | | |
| skipping to change at line 82 | | skipping to change at line 105 | |
| OPJ_API functions as being imported from a DLL, wheras this DLL sees symbol
s | | OPJ_API functions as being imported from a DLL, wheras this DLL sees symbol
s | |
| defined with this macro as being exported. | | defined with this macro as being exported. | |
| */ | | */ | |
| #if defined(OPJ_EXPORTS) || defined(DLL_EXPORT) | | #if defined(OPJ_EXPORTS) || defined(DLL_EXPORT) | |
| #define OPJ_API __declspec(dllexport) | | #define OPJ_API __declspec(dllexport) | |
| #else | | #else | |
| #define OPJ_API __declspec(dllimport) | | #define OPJ_API __declspec(dllimport) | |
| #endif /* OPJ_EXPORTS */ | | #endif /* OPJ_EXPORTS */ | |
| #endif /* !OPJ_STATIC || !_WIN32 */ | | #endif /* !OPJ_STATIC || !_WIN32 */ | |
| | | | |
|
| typedef int OPJ_BOOL; /*FIXME it should be to follow the name of others OPJ
_TYPE -> OPJ_BOOL*/ | | typedef int OPJ_BOOL; | |
| #define OPJ_TRUE 1 | | #define OPJ_TRUE 1 | |
| #define OPJ_FALSE 0 | | #define OPJ_FALSE 0 | |
| | | | |
| typedef char OPJ_CHAR; | | typedef char OPJ_CHAR; | |
| typedef float OPJ_FLOAT32; | | typedef float OPJ_FLOAT32; | |
| typedef double OPJ_FLOAT64; | | typedef double OPJ_FLOAT64; | |
| typedef unsigned char OPJ_BYTE; | | typedef unsigned char OPJ_BYTE; | |
| | | | |
| #include "opj_stdint.h" | | #include "opj_stdint.h" | |
| | | | |
| typedef int8_t OPJ_INT8; | | typedef int8_t OPJ_INT8; | |
| typedef uint8_t OPJ_UINT8; | | typedef uint8_t OPJ_UINT8; | |
| typedef int16_t OPJ_INT16; | | typedef int16_t OPJ_INT16; | |
| typedef uint16_t OPJ_UINT16; | | typedef uint16_t OPJ_UINT16; | |
| typedef int32_t OPJ_INT32; | | typedef int32_t OPJ_INT32; | |
| typedef uint32_t OPJ_UINT32; | | typedef uint32_t OPJ_UINT32; | |
| typedef int64_t OPJ_INT64; | | typedef int64_t OPJ_INT64; | |
| typedef uint64_t OPJ_UINT64; | | typedef uint64_t OPJ_UINT64; | |
| | | | |
|
| | | typedef int64_t OPJ_OFF_T; /* 64-bit file offset type */ | |
| | | | |
| | | #include <stdio.h> | |
| | | typedef size_t OPJ_SIZE_T; | |
| | | | |
| /* Avoid compile-time warning because parameter is not used */ | | /* Avoid compile-time warning because parameter is not used */ | |
| #define OPJ_ARG_NOT_USED(x) (void)(x) | | #define OPJ_ARG_NOT_USED(x) (void)(x) | |
| | | | |
| /* | | /* | |
| ========================================================== | | ========================================================== | |
| Useful constant definitions | | Useful constant definitions | |
| ========================================================== | | ========================================================== | |
| */ | | */ | |
| | | | |
| #define OPJ_PATH_LEN 4096 /**< Maximum allowed size for filenames */ | | #define OPJ_PATH_LEN 4096 /**< Maximum allowed size for filenames */ | |
| | | | |
| skipping to change at line 140 | | skipping to change at line 168 | |
| #define JPWL_MAXIMUM_EPB_ROOM 65450 /**< Expect this maximum number of byte
s for composition of EPBs */ | | #define JPWL_MAXIMUM_EPB_ROOM 65450 /**< Expect this maximum number of byte
s for composition of EPBs */ | |
| /* <<UniPG */ | | /* <<UniPG */ | |
| | | | |
| /** | | /** | |
| * EXPERIMENTAL FOR THE MOMENT | | * EXPERIMENTAL FOR THE MOMENT | |
| * Supported options about file information used only in j2k_dump | | * Supported options about file information used only in j2k_dump | |
| */ | | */ | |
| #define OPJ_IMG_INFO 1 /**< Basic image information provide
d to the user */ | | #define OPJ_IMG_INFO 1 /**< Basic image information provide
d to the user */ | |
| #define OPJ_J2K_MH_INFO 2 /**< Codestream information
based only on the main header */ | | #define OPJ_J2K_MH_INFO 2 /**< Codestream information
based only on the main header */ | |
| #define OPJ_J2K_TH_INFO 4 /**< Tile information based
on the current tile header */ | | #define OPJ_J2K_TH_INFO 4 /**< Tile information based
on the current tile header */ | |
|
| /*FIXME #define OPJ_J2K_CSTR_INFO 6*/ /**< */ | | #define OPJ_J2K_TCH_INFO 8 /**< Tile/Component information of a
ll tiles */ | |
| #define OPJ_J2K_MH_IND 16 /**< Codestream index based only on
the main header */ | | #define OPJ_J2K_MH_IND 16 /**< Codestream index based only on
the main header */ | |
| #define OPJ_J2K_TH_IND 32 /**< Tile index based on the current
tile */ | | #define OPJ_J2K_TH_IND 32 /**< Tile index based on the current
tile */ | |
| /*FIXME #define OPJ_J2K_CSTR_IND 48*/ /**< */ | | /*FIXME #define OPJ_J2K_CSTR_IND 48*/ /**< */ | |
| #define OPJ_JP2_INFO 128 /**< JP2 file information */ | | #define OPJ_JP2_INFO 128 /**< JP2 file information */ | |
| #define OPJ_JP2_IND 256 /**< JP2 file index */ | | #define OPJ_JP2_IND 256 /**< JP2 file index */ | |
| | | | |
| /* | | /* | |
| ========================================================== | | ========================================================== | |
| enum definitions | | enum definitions | |
| ========================================================== | | ========================================================== | |
| | | | |
| skipping to change at line 189 | | skipping to change at line 217 | |
| OPJ_RPCL = 2, /**< resolution-precinct-component-l
ayer order */ | | OPJ_RPCL = 2, /**< resolution-precinct-component-l
ayer order */ | |
| OPJ_PCRL = 3, /**< precinct-component-resolution-l
ayer order */ | | OPJ_PCRL = 3, /**< precinct-component-resolution-l
ayer order */ | |
| OPJ_CPRL = 4 /**< component-precinct-resolution-l
ayer order */ | | OPJ_CPRL = 4 /**< component-precinct-resolution-l
ayer order */ | |
| } OPJ_PROG_ORDER; | | } OPJ_PROG_ORDER; | |
| | | | |
| /** | | /** | |
| * Supported image color spaces | | * Supported image color spaces | |
| */ | | */ | |
| typedef enum COLOR_SPACE { | | typedef enum COLOR_SPACE { | |
| OPJ_CLRSPC_UNKNOWN = -1, /**< not supported by the library */ | | OPJ_CLRSPC_UNKNOWN = -1, /**< not supported by the library */ | |
|
| OPJ_CLRSPC_UNSPECIFIED = 0, /**< not specified in the codestream */ | | OPJ_CLRSPC_UNSPECIFIED = 0, /**< not specified in the codestream
*/ | |
| OPJ_CLRSPC_SRGB = 1, /**< sRGB */ | | OPJ_CLRSPC_SRGB = 1, /**< sRGB */ | |
| OPJ_CLRSPC_GRAY = 2, /**< grayscale */ | | OPJ_CLRSPC_GRAY = 2, /**< grayscale */ | |
|
| OPJ_CLRSPC_SYCC = 3 /**< YUV */ | | OPJ_CLRSPC_SYCC = 3 /**< YUV */ | |
| } OPJ_COLOR_SPACE; | | } OPJ_COLOR_SPACE; | |
| | | | |
| /** | | /** | |
| * Supported codec | | * Supported codec | |
| */ | | */ | |
| typedef enum CODEC_FORMAT { | | typedef enum CODEC_FORMAT { | |
| OPJ_CODEC_UNKNOWN = -1, /**< place-holder */ | | OPJ_CODEC_UNKNOWN = -1, /**< place-holder */ | |
| OPJ_CODEC_J2K = 0, /**< JPEG-2000 codestream : read/wri
te */ | | OPJ_CODEC_J2K = 0, /**< JPEG-2000 codestream : read/wri
te */ | |
| OPJ_CODEC_JPT = 1, /**< JPT-stream (JPEG 2000, JPIP) :
read only */ | | OPJ_CODEC_JPT = 1, /**< JPT-stream (JPEG 2000, JPIP) :
read only */ | |
| OPJ_CODEC_JP2 = 2 /**< JPEG-2000 file format : read/wr
ite */ | | OPJ_CODEC_JP2 = 2 /**< JPEG-2000 file format : read/wr
ite */ | |
| | | | |
| skipping to change at line 382 | | skipping to change at line 410 | |
| /** Profile name*/ | | /** Profile name*/ | |
| OPJ_RSIZ_CAPABILITIES cp_rsiz; | | OPJ_RSIZ_CAPABILITIES cp_rsiz; | |
| /** Tile part generation*/ | | /** Tile part generation*/ | |
| char tp_on; | | char tp_on; | |
| /** Flag for Tile part generation*/ | | /** Flag for Tile part generation*/ | |
| char tp_flag; | | char tp_flag; | |
| /** MCT (multiple component transform) */ | | /** MCT (multiple component transform) */ | |
| char tcp_mct; | | char tcp_mct; | |
| /** Enable JPIP indexing*/ | | /** Enable JPIP indexing*/ | |
| OPJ_BOOL jpip_on; | | OPJ_BOOL jpip_on; | |
|
| /** Naive implementation of MCT restricted to a single reversible ar | | /** Naive implementation of MCT restricted to a single reversible ar | |
| ray based encoding without offset concerning all the components. */ | | ray based | |
| | | encoding without offset concerning all the components. */ | |
| void * mct_data; | | void * mct_data; | |
| } opj_cparameters_t; | | } opj_cparameters_t; | |
| | | | |
| #define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG 0x0001 | | #define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG 0x0001 | |
| | | | |
| /** | | /** | |
| * Decompression parameters | | * Decompression parameters | |
| * */ | | * */ | |
| typedef struct opj_dparameters { | | typedef struct opj_dparameters { | |
| /** | | /** | |
| | | | |
| skipping to change at line 1204 | | skipping to change at line 1233 | |
| * @return true if success, otherwise f
alse | | * @return true if success, otherwise f
alse | |
| */ | | */ | |
| OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(opj_codec_t
*p_codec, OPJ_UINT32 res_factor); | | OPJ_API OPJ_BOOL OPJ_CALLCONV opj_set_decoded_resolution_factor(opj_codec_t
*p_codec, OPJ_UINT32 res_factor); | |
| | | | |
| /** | | /** | |
| * Writes a tile with the given data. | | * Writes a tile with the given data. | |
| * | | * | |
| * @param p_codec the jpeg2000 codec. | | * @param p_codec the jpeg2000 codec. | |
| * @param p_tile_index the index of the tile to write. At t
he moment, the tiles must be written from 0 to n-1 in sequence. | | * @param p_tile_index the index of the tile to write. At t
he moment, the tiles must be written from 0 to n-1 in sequence. | |
| * @param p_data pointer to the data to write
. Data is arranged in sequence, data_comp0, then data_comp1, then ... NO IN
TERLEAVING should be set. | | * @param p_data pointer to the data to write
. Data is arranged in sequence, data_comp0, then data_comp1, then ... NO IN
TERLEAVING should be set. | |
|
| * @param p_data_size this value os used to make s | | * @param p_data_size this value os used to make s | |
| ure the data being written is correct. The size must be equal to the sum fo | | ure the data being written is correct. The size must be equal to the sum fo | |
| r each component of tile_width * tile_height * component_size. component_si | | r each component of | |
| ze can be 1,2 or 4 bytes, depending on the precision of the given component | | * tile_width * tile_height * component_size. | |
| . | | component_size can be 1,2 or 4 bytes, depending on the precision of the giv | |
| | | en component. | |
| * @param p_stream the stream to write data to. | | * @param p_stream the stream to write data to. | |
| * | | * | |
| * @return true if the data could be written. | | * @return true if the data could be written. | |
| */ | | */ | |
| OPJ_API OPJ_BOOL OPJ_CALLCONV opj_write_tile ( opj_codec_t *p_codec, | | OPJ_API OPJ_BOOL OPJ_CALLCONV opj_write_tile ( opj_codec_t *p_codec, | |
|
OPJ_UINT32 p_tile_index, | |
OPJ_UINT32 p_tile_index, | |
|
OPJ_BYTE * p_data, | |
OPJ_BYTE * p_data, | |
|
OPJ_UINT32 p_data_size, | |
OPJ_UINT32 p_data_size, | |
|
opj_stream_t *p_stream ); | |
opj_stream_t *p_stream ); | |
| | | | |
| | | | |
End of changes. 13 change blocks. |
| 18 lines changed or deleted | | 49 lines changed or added | |
|
| opj_stdint.h (2.0) | | opj_stdint.h (2.0.1) | |
| /* | | /* | |
|
| | | * The copyright in this software is being made available under the 2-claus | |
| | | es | |
| | | * BSD License, included below. This software may be subject to other third | |
| | | * party and contributor rights, including patent rights, and no such right | |
| | | s | |
| | | * are granted under this license. | |
| | | * | |
| * Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre@gmail.com> | | * Copyright (c) 2012, Mathieu Malaterre <mathieu.malaterre@gmail.com> | |
| * All rights reserved. | | * All rights reserved. | |
| * | | * | |
| * Redistribution and use in source and binary forms, with or without | | * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions | | * modification, are permitted provided that the following conditions | |
| * are met: | | * are met: | |
| * 1. Redistributions of source code must retain the above copyright | | * 1. Redistributions of source code must retain the above copyright | |
| * notice, this list of conditions and the following disclaimer. | | * notice, this list of conditions and the following disclaimer. | |
| * 2. Redistributions in binary form must reproduce the above copyright | | * 2. Redistributions in binary form must reproduce the above copyright | |
| * notice, this list of conditions and the following disclaimer in the | | * notice, this list of conditions and the following disclaimer in the | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 35 | |
| * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
| * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
| * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
| * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF T
HE | | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF T
HE | |
| * POSSIBILITY OF SUCH DAMAGE. | | * POSSIBILITY OF SUCH DAMAGE. | |
| */ | | */ | |
| #ifndef OPJ_STDINT_H | | #ifndef OPJ_STDINT_H | |
| #define OPJ_STDINT_H | | #define OPJ_STDINT_H | |
| | | | |
| #include "opj_config.h" | | #include "opj_config.h" | |
|
| #ifdef HAVE_STDINT_H | | #ifdef OPJ_HAVE_STDINT_H | |
| #include <stdint.h> | | #include <stdint.h> | |
| #else | | #else | |
| #if defined(_WIN32) | | #if defined(_WIN32) | |
| typedef signed __int8 int8_t; | | typedef signed __int8 int8_t; | |
| typedef unsigned __int8 uint8_t; | | typedef unsigned __int8 uint8_t; | |
| typedef signed __int16 int16_t; | | typedef signed __int16 int16_t; | |
| typedef unsigned __int16 uint16_t; | | typedef unsigned __int16 uint16_t; | |
| typedef signed __int32 int32_t; | | typedef signed __int32 int32_t; | |
| typedef unsigned __int32 uint32_t; | | typedef unsigned __int32 uint32_t; | |
| typedef signed __int64 int64_t; | | typedef signed __int64 int64_t; | |
| typedef unsigned __int64 uint64_t; | | typedef unsigned __int64 uint64_t; | |
| #else | | #else | |
| #error unsupported platform | | #error unsupported platform | |
| #endif | | #endif | |
| #endif | | #endif | |
|
| typedef size_t OPJ_SIZE_T; | | | |
| | | | |
| /* 64-bit file offset type */ | | | |
| typedef int64_t OPJ_OFF_T; | | | |
| | | | |
| #ifndef HAVE_SSIZE_T | | | |
| #if defined(_WIN32) | | | |
| #include <BaseTsd.h> | | | |
| typedef SSIZE_T ssize_t; | | | |
| #else | | | |
| #error SSIZE_T is undefined | | | |
| #endif /* _WIN32 */ | | | |
| #endif | | | |
| | | | |
| #endif /* OPJ_STDINT_H */ | | #endif /* OPJ_STDINT_H */ | |
| | | | |
End of changes. 3 change blocks. |
| 14 lines changed or deleted | | 8 lines changed or added | |
|