ABI
Tracker

(OpenJPEG)




Headers diff: 1.4 vs 1.5



 openjpeg.h (1.4)   openjpeg.h (1.5) 
/* /*
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, U niversite catholique de Louvain (UCL), Belgium * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, U niversite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2007, Professor Benoit Macq * Copyright (c) 2002-2007, 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 and 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) 2010-2011, Kaori Hagihara
* 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
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
skipping to change at line 61 skipping to change at line 62
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 */
#ifndef __cplusplus typedef int opj_bool;
#if defined(HAVE_STDBOOL_H) #define OPJ_TRUE 1
/* #define OPJ_FALSE 0
The C language implementation does correctly provide the standard header
file "stdbool.h".
*/
#include <stdbool.h>
#else
/*
The C language implementation does not provide the standard header file
"stdbool.h" as required by ISO/IEC 9899:1999. Try to compensate for this
braindamage below.
*/
#if !defined(bool)
#define bool int
#endif
#if !defined(true)
#define true 1
#endif
#if !defined(false)
#define false 0
#endif
#endif
#endif /* __cplusplus */
/* Avoid compile-time warning because parameter is not used */
#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 */
#define J2K_MAXRLVLS 33 /**< Number of maximum resolution level authorized */ #define J2K_MAXRLVLS 33 /**< Number of maximum resolution level authorized */
#define J2K_MAXBANDS (3*J2K_MAXRLVLS-2) /**< Number of maximum sub-b and linked to number of resolution level */ #define J2K_MAXBANDS (3*J2K_MAXRLVLS-2) /**< Number of maximum sub-b and linked to number of resolution level */
skipping to change at line 160 skipping to change at line 142
CLRSPC_SRGB = 1, /**< sRGB */ CLRSPC_SRGB = 1, /**< sRGB */
CLRSPC_GRAY = 2, /**< grayscale */ CLRSPC_GRAY = 2, /**< grayscale */
CLRSPC_SYCC = 3 /**< YUV */ CLRSPC_SYCC = 3 /**< YUV */
} OPJ_COLOR_SPACE; } OPJ_COLOR_SPACE;
/** /**
Supported codec Supported codec
*/ */
typedef enum CODEC_FORMAT { typedef enum CODEC_FORMAT {
CODEC_UNKNOWN = -1, /**< place-holder */ CODEC_UNKNOWN = -1, /**< place-holder */
CODEC_J2K = 0, /**< JPEG-2000 codestream : read/write */ CODEC_J2K = 0, /**< JPEG-2000 codestream : read/write */
CODEC_JPT = 1, /**< JPT-stream (JPEG 2000, JPIP) : read onl CODEC_JPT = 1, /**< JPT-stream (JPEG 2000, JPIP) : read onl
y */ y */
CODEC_JP2 = 2 /**< JPEG-2000 file format : read/write */ CODEC_JP2 = 2 /**< JPEG-2000 file format : read/write */
} OPJ_CODEC_FORMAT; } OPJ_CODEC_FORMAT;
/** /**
Limit decoding to certain portions of the codestream. Limit decoding to certain portions of the codestream.
*/ */
typedef enum LIMIT_DECODING { typedef enum LIMIT_DECODING {
NO_LIMITATION = 0, /**< No limitation for the decoding. The entire codestream will de decoded */ NO_LIMITATION = 0, /**< No limitation for the decoding. The entire codestream will de decoded */
LIMIT_TO_MAIN_HEADER = 1, /**< The decoding is limited to the Main Header */ LIMIT_TO_MAIN_HEADER = 1, /**< The decoding is limited to the Main Header */
DECODE_ALL_BUT_PACKETS = 2 /**< Decode everything except the JP EG 2000 packets */ DECODE_ALL_BUT_PACKETS = 2 /**< Decode everything except the JP EG 2000 packets */
} OPJ_LIMIT_DECODING; } OPJ_LIMIT_DECODING;
skipping to change at line 244 skipping to change at line 226
int txS,txE,tyS,tyE,dx,dy; int txS,txE,tyS,tyE,dx,dy;
/** Temporary values for Tile parts, initialised in pi_create_encode */ /** Temporary values for Tile parts, initialised in pi_create_encode */
int lay_t, res_t, comp_t, prc_t,tx0_t,ty0_t; int lay_t, res_t, comp_t, prc_t,tx0_t,ty0_t;
} opj_poc_t; } opj_poc_t;
/** /**
Compression parameters Compression parameters
*/ */
typedef struct opj_cparameters { typedef struct opj_cparameters {
/** size of tile: tile_size_on = false (not in argument) or = true ( in argument) */ /** size of tile: tile_size_on = false (not in argument) or = true ( in argument) */
bool tile_size_on; opj_bool tile_size_on;
/** XTOsiz */ /** XTOsiz */
int cp_tx0; int cp_tx0;
/** YTOsiz */ /** YTOsiz */
int cp_ty0; int cp_ty0;
/** XTsiz */ /** XTsiz */
int cp_tdx; int cp_tdx;
/** YTsiz */ /** YTsiz */
int cp_tdy; int cp_tdy;
/** allocation by rate/distortion */ /** allocation by rate/distortion */
int cp_disto_alloc; int cp_disto_alloc;
skipping to change at line 326 skipping to change at line 308
/** input file format 0: PGX, 1: PxM, 2: BMP 3:TIF*/ /** input file format 0: PGX, 1: PxM, 2: BMP 3:TIF*/
int decod_format; int decod_format;
/** output file format 0: J2K, 1: JP2, 2: JPT */ /** output file format 0: J2K, 1: JP2, 2: JPT */
int cod_format; int cod_format;
/*@}*/ /*@}*/
/* UniPG>> */ /* UniPG>> */
/**@name JPWL encoding parameters */ /**@name JPWL encoding parameters */
/*@{*/ /*@{*/
/** enables writing of EPC in MH, thus activating JPWL */ /** enables writing of EPC in MH, thus activating JPWL */
bool jpwl_epc_on; opj_bool jpwl_epc_on;
/** error protection method for MH (0,1,16,32,37-128) */ /** error protection method for MH (0,1,16,32,37-128) */
int jpwl_hprot_MH; int jpwl_hprot_MH;
/** tile number of header protection specification (>=0) */ /** tile number of header protection specification (>=0) */
int jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS]; int jpwl_hprot_TPH_tileno[JPWL_MAX_NO_TILESPECS];
/** error protection methods for TPHs (0,1,16,32,37-128) */ /** error protection methods for TPHs (0,1,16,32,37-128) */
int jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS]; int jpwl_hprot_TPH[JPWL_MAX_NO_TILESPECS];
/** tile number of packet protection specification (>=0) */ /** tile number of packet protection specification (>=0) */
int jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS]; int jpwl_pprot_tileno[JPWL_MAX_NO_PACKSPECS];
/** packet number of packet protection specification (>=0) */ /** packet number of packet protection specification (>=0) */
int jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS]; int jpwl_pprot_packno[JPWL_MAX_NO_PACKSPECS];
skipping to change at line 366 skipping to change at line 348
/** Maximum rate for each component. If == 0, component size limitat ion is not considered */ /** Maximum rate for each component. If == 0, component size limitat ion is not considered */
int max_comp_size; int max_comp_size;
/** 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*/
opj_bool jpip_on;
} opj_cparameters_t; } opj_cparameters_t;
#define OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG 0x0001
/** /**
Decompression parameters Decompression parameters
*/ */
typedef struct opj_dparameters { typedef struct opj_dparameters {
/** /**
Set the number of highest resolution levels to be discarded. Set the number of highest resolution levels to be discarded.
The image resolution is effectively divided by 2 to the power of the number of discarded levels. The image resolution is effectively divided by 2 to the power of the number of discarded levels.
The reduce factor is limited by the smallest total number of decompo sition levels among tiles. The reduce factor is limited by the smallest total number of decompo sition levels among tiles.
if != 0, then original dimension divided by 2^(reduce); if != 0, then original dimension divided by 2^(reduce);
if == 0 or not used, image is decoded to the full resolution if == 0 or not used, image is decoded to the full resolution
skipping to change at line 404 skipping to change at line 390
/** input file format 0: J2K, 1: JP2, 2: JPT */ /** input file format 0: J2K, 1: JP2, 2: JPT */
int decod_format; int decod_format;
/** output file format 0: PGX, 1: PxM, 2: BMP */ /** output file format 0: PGX, 1: PxM, 2: BMP */
int cod_format; int cod_format;
/*@}*/ /*@}*/
/* UniPG>> */ /* UniPG>> */
/**@name JPWL decoding parameters */ /**@name JPWL decoding parameters */
/*@{*/ /*@{*/
/** activates the JPWL correction capabilities */ /** activates the JPWL correction capabilities */
bool jpwl_correct; opj_bool jpwl_correct;
/** expected number of components */ /** expected number of components */
int jpwl_exp_comps; int jpwl_exp_comps;
/** maximum number of tiles */ /** maximum number of tiles */
int jpwl_max_tiles; int jpwl_max_tiles;
/*@}*/ /*@}*/
/* <<UniPG */ /* <<UniPG */
/** /**
Specify whether the decoding should be done on the entire codestream , or be limited to the main header Specify whether the decoding should be done on the entire codestream , or be limited to the main header
Limiting the decoding to the main header makes it possible to extrac t the characteristics of the codestream Limiting the decoding to the main header makes it possible to extrac t the characteristics of the codestream
if == NO_LIMITATION, the entire codestream is decoded; if == NO_LIMITATION, the entire codestream is decoded;
if == LIMIT_TO_MAIN_HEADER, only the main header is decoded; if == LIMIT_TO_MAIN_HEADER, only the main header is decoded;
*/ */
OPJ_LIMIT_DECODING cp_limit_decoding; OPJ_LIMIT_DECODING cp_limit_decoding;
unsigned int flags;
} opj_dparameters_t; } opj_dparameters_t;
/** Common fields between JPEG-2000 compression and decompression master st ructs. */ /** Common fields between JPEG-2000 compression and decompression master st ructs. */
#define opj_common_fields \ #define opj_common_fields \
opj_event_mgr_t *event_mgr; /**< pointer to the event manager */ \ opj_event_mgr_t *event_mgr; /**< pointer to the event manager */ \
void * client_data; /**< Available for use by ap plication */\ void * client_data; /**< Available for use by ap plication */\
bool is_decompressor; /**< So common code can tell which i s which */\ opj_bool is_decompressor; /**< So common code can tell which i s which */\
OPJ_CODEC_FORMAT codec_format; /**< selected codec */\ OPJ_CODEC_FORMAT codec_format; /**< selected codec */\
void *j2k_handle; /**< pointer to the J2K code c */\ void *j2k_handle; /**< pointer to the J2K code c */\
void *jp2_handle; /**< pointer to the JP2 code c */\ void *jp2_handle; /**< pointer to the JP2 code c */\
void *mj2_handle /**< pointer to the MJ2 code c */ void *mj2_handle /**< pointer to the MJ2 code c */
/* Routines that are to be used by both halves of the library are declared /* Routines that are to be used by both halves of the library are declared
* to receive a pointer to this structure. There are no actual instances o f * to receive a pointer to this structure. There are no actual instances o f
* opj_common_struct_t, only of opj_cinfo_t and opj_dinfo_t. * opj_common_struct_t, only of opj_cinfo_t and opj_dinfo_t.
*/ */
typedef struct opj_common_struct { typedef struct opj_common_struct {
skipping to change at line 605 skipping to change at line 592
/** packet start position (including SOP marker if it exists) */ /** packet start position (including SOP marker if it exists) */
int start_pos; int start_pos;
/** end of packet header position (including EPH marker if it exists )*/ /** end of packet header position (including EPH marker if it exists )*/
int end_ph_pos; int end_ph_pos;
/** packet end position */ /** packet end position */
int end_pos; int end_pos;
/** packet distorsion */ /** packet distorsion */
double disto; double disto;
} opj_packet_info_t; } opj_packet_info_t;
/* UniPG>> */
/**
Marker structure
*/
typedef struct opj_marker_info_t {
/** marker type */
unsigned short int type;
/** position in codestream */
int pos;
/** length, marker val included */
int len;
} opj_marker_info_t;
/* <<UniPG */
/** /**
Index structure : Information concerning tile-parts Index structure : Information concerning tile-parts
*/ */
typedef struct opj_tp_info { typedef struct opj_tp_info {
/** start position of tile part */ /** start position of tile part */
int tp_start_pos; int tp_start_pos;
/** end position of tile part header */ /** end position of tile part header */
int tp_end_header; int tp_end_header;
/** end position of tile part */ /** end position of tile part */
int tp_end_pos; int tp_end_pos;
skipping to change at line 649 skipping to change at line 650
/** precinct size (in power of 2), in X for each resolution level */ /** precinct size (in power of 2), in X for each resolution level */
int pdx[33]; int pdx[33];
/** precinct size (in power of 2), in Y for each resolution level */ /** precinct size (in power of 2), in Y for each resolution level */
int pdy[33]; int pdy[33];
/** information concerning packets inside tile */ /** information concerning packets inside tile */
opj_packet_info_t *packet; opj_packet_info_t *packet;
/** add fixed_quality */ /** add fixed_quality */
int numpix; int numpix;
/** add fixed_quality */ /** add fixed_quality */
double distotile; double distotile;
/** number of markers */
int marknum;
/** list of markers */
opj_marker_info_t *marker;
/** actual size of markers array */
int maxmarknum;
/** number of tile parts */ /** number of tile parts */
int num_tps; int num_tps;
/** information concerning tile parts */ /** information concerning tile parts */
opj_tp_info_t *tp; opj_tp_info_t *tp;
} opj_tile_info_t; } opj_tile_info_t;
/* UniPG>> */
/**
Marker structure
*/
typedef struct opj_marker_info_t {
/** marker type */
unsigned short int type;
/** position in codestream */
int pos;
/** length, marker val included */
int len;
} opj_marker_info_t;
/* <<UniPG */
/** /**
Index structure of the codestream Index structure of the codestream
*/ */
typedef struct opj_codestream_info { typedef struct opj_codestream_info {
/** maximum distortion reduction on the whole image (add for Marcela ) */ /** maximum distortion reduction on the whole image (add for Marcela ) */
double D_max; double D_max;
/** packet number */ /** packet number */
int packno; int packno;
/** writing the packet in the index with t2_encode_packets */ /** writing the packet in the index with t2_encode_packets */
int index_write; int index_write;
skipping to change at line 886 skipping to change at line 879
OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameter s_t *parameters); OPJ_API void OPJ_CALLCONV opj_set_default_encoder_parameters(opj_cparameter s_t *parameters);
/** /**
Setup the encoder parameters using the current image and using user paramet ers. Setup the encoder parameters using the current image and using user paramet ers.
@param cinfo Compressor handle @param cinfo Compressor handle
@param parameters Compression parameters @param parameters Compression parameters
@param image Input filled image @param image Input filled image
*/ */
OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparame ters_t *parameters, opj_image_t *image); OPJ_API void OPJ_CALLCONV opj_setup_encoder(opj_cinfo_t *cinfo, opj_cparame ters_t *parameters, opj_image_t *image);
/** /**
Encode an image into a JPEG-2000 codestream Encode an image into a JPEG-2000 codestream
@param cinfo compressor handle 3@param cinfo compressor handle
@param cio Output buffer stream @param cio Output buffer stream
@param image Image to encode @param image Image to encode
@param index Depreacted -> Set to NULL. To extract index, used opj_encode_w ci() @param index Depreacted -> Set to NULL. To extract index, used opj_encode_w ci()
@return Returns true if successful, returns false otherwise @return Returns true if successful, returns false otherwise
*/ */
OPJ_API bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio, op j_image_t *image, char *index); OPJ_API opj_bool OPJ_CALLCONV opj_encode(opj_cinfo_t *cinfo, opj_cio_t *cio , opj_image_t *image, char *index);
/** /**
Encode an image into a JPEG-2000 codestream and extract the codestream info rmation Encode an image into a JPEG-2000 codestream and extract the codestream info rmation
@param cinfo compressor handle @param cinfo compressor handle
@param cio Output buffer stream @param cio Output buffer stream
@param image Image to encode @param image Image to encode
@param cstr_info Codestream information structure if needed afterwards, NUL L otherwise @param cstr_info Codestream information structure if needed afterwards, NUL L otherwise
@return Returns true if successful, returns false otherwise @return Returns true if successful, returns false otherwise
*/ */
OPJ_API bool OPJ_CALLCONV opj_encode_with_info(opj_cinfo_t *cinfo, opj_cio_ t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info); OPJ_API opj_bool OPJ_CALLCONV opj_encode_with_info(opj_cinfo_t *cinfo, opj_ cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
/** /**
Destroy Codestream information after compression or decompression Destroy Codestream information after compression or decompression
@param cstr_info Codestream information structure @param cstr_info Codestream information structure
*/ */
OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t *cstr _info); OPJ_API void OPJ_CALLCONV opj_destroy_cstr_info(opj_codestream_info_t *cstr _info);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 17 change blocks. 
49 lines changed or deleted 42 lines changed or added

This html diff was produced by rfcdiff 1.41.The latest version is available from http://tools.ietf.org/tools/rfcdiff/