summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMickael Savinaud <savmickael@users.noreply.github.com>2012-11-15 13:38:35 +0000
committerMickael Savinaud <savmickael@users.noreply.github.com>2012-11-15 13:38:35 +0000
commite212154d8d43ec583cb6dc8f963b97988a54c11d (patch)
tree074b1b8b459ce72933177247b3d9a891fa00e5c2
parentec0fe091380c2de75584fdfc3d914eee5b89e731 (diff)
[trunk]extend last commits to apps
-rw-r--r--src/bin/common/color.c10
-rw-r--r--src/bin/jp2/convert.c36
-rw-r--r--src/bin/jp2/convert.h2
-rw-r--r--src/bin/jp2/index.c8
-rw-r--r--src/bin/jp2/opj_compress.c62
-rw-r--r--src/bin/jp2/opj_decompress.c8
-rw-r--r--src/bin/jp2/opj_dump.c8
-rw-r--r--tests/comparePGXimages.c6
-rw-r--r--tests/j2k_random_tile_access.c6
-rw-r--r--tests/test_tile_decoder.c6
-rw-r--r--tests/test_tile_encoder.c14
-rw-r--r--tests/unit/testempty1.c6
-rw-r--r--tests/unit/testempty2.c8
13 files changed, 90 insertions, 90 deletions
diff --git a/src/bin/common/color.c b/src/bin/common/color.c
index 21b02156..13b1337e 100644
--- a/src/bin/common/color.c
+++ b/src/bin/common/color.c
@@ -217,7 +217,7 @@ void color_sycc_to_rgb(opj_image_t *img)
{
if(img->numcomps < 3)
{
- img->color_space = CLRSPC_GRAY;
+ img->color_space = OPJ_CLRSPC_GRAY;
return;
}
@@ -256,7 +256,7 @@ void color_sycc_to_rgb(opj_image_t *img)
__FILE__,__LINE__);
return;
}
- img->color_space = CLRSPC_SRGB;
+ img->color_space = OPJ_CLRSPC_SRGB;
}/* color_sycc_to_rgb() */
@@ -306,7 +306,7 @@ void color_apply_icc_profile(opj_image_t *image)
in_type = TYPE_RGB_16;
out_type = TYPE_RGB_16;
out_prof = cmsCreate_sRGBProfile();
- image->color_space = CLRSPC_SRGB;
+ image->color_space = OPJ_CLRSPC_SRGB;
}
else
if(out_space == cmsSigGrayData) /* enumCS 17 */
@@ -314,7 +314,7 @@ void color_apply_icc_profile(opj_image_t *image)
in_type = TYPE_GRAY_8;
out_type = TYPE_RGB_8;
out_prof = cmsCreate_sRGBProfile();
- image->color_space = CLRSPC_SRGB;
+ image->color_space = OPJ_CLRSPC_SRGB;
}
else
if(out_space == cmsSigYCbCrData) /* enumCS 18 */
@@ -322,7 +322,7 @@ void color_apply_icc_profile(opj_image_t *image)
in_type = TYPE_YCbCr_16;
out_type = TYPE_RGB_16;
out_prof = cmsCreate_sRGBProfile();
- image->color_space = CLRSPC_SRGB;
+ image->color_space = OPJ_CLRSPC_SRGB;
}
else
{
diff --git a/src/bin/jp2/convert.c b/src/bin/jp2/convert.c
index 6cfa663c..dad3f8b0 100644
--- a/src/bin/jp2/convert.c
+++ b/src/bin/jp2/convert.c
@@ -190,7 +190,7 @@ static inline int16_t swap16(int16_t x)
#endif
static int tga_writeheader(FILE *fp, int bits_per_pixel, int width, int height,
- opj_bool flip_image)
+ OPJ_BOOL flip_image)
{
unsigned short image_w, image_h, us0;
unsigned char uc0, image_type;
@@ -260,8 +260,8 @@ opj_image_t* tgatoimage(const char *filename, opj_cparameters_t *parameters) {
opj_image_cmptparm_t cmptparm[4]; /* maximum 4 components */
int numcomps;
OPJ_COLOR_SPACE color_space;
- opj_bool mono ;
- opj_bool save_alpha;
+ OPJ_BOOL mono ;
+ OPJ_BOOL save_alpha;
int subsampling_dx, subsampling_dy;
int i;
@@ -285,12 +285,12 @@ opj_image_t* tgatoimage(const char *filename, opj_cparameters_t *parameters) {
save_alpha = (pixel_bit_depth == 16) || (pixel_bit_depth == 32); /* Mono with alpha, or RGB with alpha */
if (mono) {
- color_space = CLRSPC_GRAY;
+ color_space = OPJ_CLRSPC_GRAY;
numcomps = save_alpha ? 2 : 1;
}
else {
numcomps = save_alpha ? 4 : 3;
- color_space = CLRSPC_SRGB;
+ color_space = OPJ_CLRSPC_SRGB;
}
subsampling_dx = parameters->subsampling_dx;
@@ -405,7 +405,7 @@ opj_image_t* tgatoimage(const char *filename, opj_cparameters_t *parameters) {
int imagetotga(opj_image_t * image, const char *outfile) {
int width, height, bpp, x, y;
- opj_bool write_alpha;
+ OPJ_BOOL write_alpha;
int i, adjustR, adjustG, adjustB;
unsigned int alpha_channel;
float r,g,b,a;
@@ -657,7 +657,7 @@ opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
if (Info_h.biBitCount == 24)
{
numcomps = 3;
- color_space = CLRSPC_SRGB;
+ color_space = OPJ_CLRSPC_SRGB;
/* initialize image components */
memset(&cmptparm[0], 0, 3 * sizeof(opj_image_cmptparm_t));
for(i = 0; i < numcomps; i++)
@@ -757,7 +757,7 @@ opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
W++;
numcomps = gray_scale ? 1 : 3;
- color_space = gray_scale ? CLRSPC_GRAY : CLRSPC_SRGB;
+ color_space = gray_scale ? OPJ_CLRSPC_GRAY : OPJ_CLRSPC_SRGB;
/* initialize image components */
memset(&cmptparm[0], 0, 3 * sizeof(opj_image_cmptparm_t));
for(i = 0; i < numcomps; i++)
@@ -867,7 +867,7 @@ opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
gray_scale = 0;
numcomps = gray_scale ? 1 : 3;
- color_space = gray_scale ? CLRSPC_GRAY : CLRSPC_SRGB;
+ color_space = gray_scale ? OPJ_CLRSPC_GRAY : OPJ_CLRSPC_SRGB;
/* initialize image components */
memset(&cmptparm[0], 0, 3 * sizeof(opj_image_cmptparm_t));
for (i = 0; i < numcomps; i++)
@@ -1278,7 +1278,7 @@ opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters) {
opj_image_comp_t *comp = NULL;
numcomps = 1;
- color_space = CLRSPC_GRAY;
+ color_space = OPJ_CLRSPC_GRAY;
memset(&cmptparm, 0, sizeof(opj_image_cmptparm_t));
@@ -1747,9 +1747,9 @@ opj_image_t* pnmtoimage(const char *filename, opj_cparameters_t *parameters) {
default: fclose(fp); return NULL;
}
if(numcomps < 3)
- color_space = CLRSPC_GRAY;/* GRAY, GRAYA */
+ color_space = OPJ_CLRSPC_GRAY;/* GRAY, GRAYA */
else
- color_space = CLRSPC_SRGB;/* RGB, RGBA */
+ color_space = OPJ_CLRSPC_SRGB;/* RGB, RGBA */
prec = has_prec(header_info.maxval);
@@ -2538,7 +2538,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
if(tiPhoto == PHOTOMETRIC_RGB) /* RGB(A) */
{
numcomps = 3 + has_alpha;
- color_space = CLRSPC_SRGB;
+ color_space = OPJ_CLRSPC_SRGB;
/*#define USETILEMODE*/
for(j = 0; j < numcomps; j++)
@@ -2702,7 +2702,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
if(tiPhoto == PHOTOMETRIC_MINISBLACK) /* GRAY(A) */
{
numcomps = 1 + has_alpha;
- color_space = CLRSPC_GRAY;
+ color_space = OPJ_CLRSPC_GRAY;
for(j = 0; j < numcomps; ++j)
{
@@ -2802,7 +2802,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
RAW IMAGE FORMAT
<<-- <<-- <<-- <<-- */
-static opj_image_t* rawtoimage_common(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp, opj_bool big_endian) {
+static opj_image_t* rawtoimage_common(const char *filename, opj_cparameters_t *parameters, raw_cparameters_t *raw_cp, OPJ_BOOL big_endian) {
int subsampling_dx = parameters->subsampling_dx;
int subsampling_dy = parameters->subsampling_dy;
@@ -2830,7 +2830,7 @@ static opj_image_t* rawtoimage_common(const char *filename, opj_cparameters_t *p
return NULL;
}
numcomps = raw_cp->rawComp;
- color_space = CLRSPC_SRGB;
+ color_space = OPJ_CLRSPC_SRGB;
w = raw_cp->rawWidth;
h = raw_cp->rawHeight;
cmptparm = (opj_image_cmptparm_t*) malloc(numcomps * sizeof(opj_image_cmptparm_t));
@@ -2921,7 +2921,7 @@ opj_image_t* rawtoimage(const char *filename, opj_cparameters_t *parameters, raw
return rawtoimage_common(filename, parameters, raw_cp, OPJ_TRUE);
}
-static int imagetoraw_common(opj_image_t * image, const char *outfile, opj_bool big_endian)
+static int imagetoraw_common(opj_image_t * image, const char *outfile, OPJ_BOOL big_endian)
{
FILE *rawFile = NULL;
size_t res;
@@ -3216,7 +3216,7 @@ opj_image_t *pngtoimage(const char *read_idf, opj_cparameters_t * params)
cmptparm[i].h = height;
}
- image = opj_image_create(nr_comp, &cmptparm[0], CLRSPC_SRGB);
+ image = opj_image_create(nr_comp, &cmptparm[0], OPJ_CLRSPC_SRGB);
if(image == NULL) goto fin;
diff --git a/src/bin/jp2/convert.h b/src/bin/jp2/convert.h
index 72ed981d..11bc31ee 100644
--- a/src/bin/jp2/convert.h
+++ b/src/bin/jp2/convert.h
@@ -43,7 +43,7 @@ typedef struct raw_cparameters {
/** bit depth of the raw image */
int rawBitDepth;
/** signed/unsigned raw image */
- opj_bool rawSigned;
+ OPJ_BOOL rawSigned;
/*@}*/
} raw_cparameters_t;
diff --git a/src/bin/jp2/index.c b/src/bin/jp2/index.c
index c71730fe..f7d6ce23 100644
--- a/src/bin/jp2/index.c
+++ b/src/bin/jp2/index.c
@@ -143,7 +143,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
cstr_info->tile[tileno].tp[tilepartno].tp_end_pos
);
- if (cstr_info->prog == LRCP) { /* LRCP */
+ if (cstr_info->prog == OPJ_LRCP) { /* LRCP */
fprintf(stream, "LRCP\npack_nb tileno layno resno compno precno start_pos end_ph_pos end_pos");
if (disto_on)
fprintf(stream, " disto");
@@ -174,7 +174,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
}
} /* LRCP */
- else if (cstr_info->prog == RLCP) { /* RLCP */
+ else if (cstr_info->prog == OPJ_RLCP) { /* RLCP */
fprintf(stream, "RLCP\npack_nb tileno resno layno compno precno start_pos end_ph_pos end_pos\n");
if (disto_on)
fprintf(stream, " disto");
@@ -205,7 +205,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
}
} /* RLCP */
- else if (cstr_info->prog == RPCL) { /* RPCL */
+ else if (cstr_info->prog == OPJ_RPCL) { /* RPCL */
fprintf(stream, "RPCL\npack_nb tileno resno precno compno layno start_pos end_ph_pos end_pos");
if (disto_on)
@@ -254,7 +254,7 @@ int write_index_file(opj_codestream_info_t *cstr_info, char *index) {
} /* resno */
} /* RPCL */
- else if (cstr_info->prog == PCRL) { /* PCRL */
+ else if (cstr_info->prog == OPJ_PCRL) { /* PCRL */
/* I suppose components have same XRsiz, YRsiz */
int x0 = cstr_info->tile_Ox + tileno - (int)floor( (float)tileno/(float)cstr_info->tw ) * cstr_info->tw * cstr_info->tile_x;
int y0 = cstr_info->tile_Ox + (int)floor( (float)tileno/(float)cstr_info->tw ) * cstr_info->tile_y;
diff --git a/src/bin/jp2/opj_compress.c b/src/bin/jp2/opj_compress.c
index d5736c1e..63ed3fc7 100644
--- a/src/bin/jp2/opj_compress.c
+++ b/src/bin/jp2/opj_compress.c
@@ -149,10 +149,10 @@ static void encode_help_display(void) {
fprintf(stdout,"\n");
fprintf(stdout,"-h : display the help information \n ");
fprintf(stdout,"\n");
- fprintf(stdout,"-cinema2K : Digital Cinema 2K profile compliant codestream for 2K resolution.(-cinema2k 24 or 48) \n");
+ fprintf(stdout,"-OPJ_CINEMA2K : Digital Cinema 2K profile compliant codestream for 2K resolution.(-OPJ_CINEMA2K 24 or 48) \n");
fprintf(stdout," Need to specify the frames per second for a 2K resolution. Only 24 or 48 fps is allowed\n");
fprintf(stdout,"\n");
- fprintf(stdout,"-cinema4K : Digital Cinema 4K profile compliant codestream for 4K resolution \n");
+ fprintf(stdout,"-OPJ_CINEMA4K : Digital Cinema 4K profile compliant codestream for 4K resolution \n");
fprintf(stdout," Frames per second not required. Default value is 24fps\n");
fprintf(stdout,"\n");
fprintf(stdout,"-r : different compression ratios for successive layers (-r 20,10,5)\n ");
@@ -327,22 +327,22 @@ static void encode_help_display(void) {
static OPJ_PROG_ORDER give_progression(const char progression[4]) {
if(strncmp(progression, "LRCP", 4) == 0) {
- return LRCP;
+ return OPJ_LRCP;
}
if(strncmp(progression, "RLCP", 4) == 0) {
- return RLCP;
+ return OPJ_RLCP;
}
if(strncmp(progression, "RPCL", 4) == 0) {
- return RPCL;
+ return OPJ_RPCL;
}
if(strncmp(progression, "PCRL", 4) == 0) {
- return PCRL;
+ return OPJ_PCRL;
}
if(strncmp(progression, "CPRL", 4) == 0) {
- return CPRL;
+ return OPJ_CPRL;
}
- return PROG_UNKNOWN;
+ return OPJ_PROG_UNKNOWN;
}
static unsigned int get_num_images(char *imgdirpath){
@@ -451,14 +451,14 @@ static int initialise_4K_poc(opj_poc_t *POC, int numres){
POC[0].layno1 = 1;
POC[0].resno1 = numres-1;
POC[0].compno1 = 3;
- POC[0].prg1 = CPRL;
+ POC[0].prg1 = OPJ_CPRL;
POC[1].tile = 1;
POC[1].resno0 = numres-1;
POC[1].compno0 = 0;
POC[1].layno1 = 1;
POC[1].resno1 = numres;
POC[1].compno1 = 3;
- POC[1].prg1 = CPRL;
+ POC[1].prg1 = OPJ_CPRL;
return 2;
}
@@ -483,7 +483,7 @@ static void cinema_parameters(opj_cparameters_t *parameters){
parameters->csty |= 0x01;
/*The progression order shall be CPRL*/
- parameters->prog_order = CPRL;
+ parameters->prog_order = OPJ_CPRL;
/* No ROI */
parameters->roi_compno = -1;
@@ -500,8 +500,8 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
float temp_rate;
switch (parameters->cp_cinema){
- case CINEMA2K_24:
- case CINEMA2K_48:
+ case OPJ_CINEMA2K_24:
+ case OPJ_CINEMA2K_48:
if(parameters->numresolution > 6){
parameters->numresolution = 6;
}
@@ -509,11 +509,11 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
fprintf(stdout,"Image coordinates %d x %d is not 2K compliant.\nJPEG Digital Cinema Profile-3 "
"(2K profile) compliance requires that at least one of coordinates match 2048 x 1080\n",
image->comps[0].w,image->comps[0].h);
- parameters->cp_rsiz = STD_RSIZ;
+ parameters->cp_rsiz = OPJ_STD_RSIZ;
}
break;
- case CINEMA4K_24:
+ case OPJ_CINEMA4K_24:
if(parameters->numresolution < 1){
parameters->numresolution = 1;
}else if(parameters->numresolution > 7){
@@ -523,7 +523,7 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
fprintf(stdout,"Image coordinates %d x %d is not 4K compliant.\nJPEG Digital Cinema Profile-4"
"(4K profile) compliance requires that at least one of coordinates match 4096 x 2160\n",
image->comps[0].w,image->comps[0].h);
- parameters->cp_rsiz = STD_RSIZ;
+ parameters->cp_rsiz = OPJ_STD_RSIZ;
}
parameters->numpocs = initialise_4K_poc(parameters->POC,parameters->numresolution);
break;
@@ -532,8 +532,8 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
}
switch (parameters->cp_cinema){
- case CINEMA2K_24:
- case CINEMA4K_24:
+ case OPJ_CINEMA2K_24:
+ case OPJ_CINEMA4K_24:
for(i=0 ; i<parameters->tcp_numlayers ; i++){
temp_rate = 0 ;
if (img_fol->rates[i]== 0){
@@ -553,7 +553,7 @@ static void cinema_setup_encoder(opj_cparameters_t *parameters,opj_image_t *imag
parameters->max_comp_size = COMP_24_CS;
break;
- case CINEMA2K_48:
+ case OPJ_CINEMA2K_48:
for(i=0 ; i<parameters->tcp_numlayers ; i++){
temp_rate = 0 ;
if (img_fol->rates[i]== 0){
@@ -584,8 +584,8 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
img_fol_t *img_fol, raw_cparameters_t *raw_cp, char *indexfilename) {
int i, j, totlen, c;
opj_option_t long_option[]={
- {"cinema2K",REQ_ARG, NULL ,'w'},
- {"cinema4K",NO_ARG, NULL ,'y'},
+ {"OPJ_CINEMA2K",REQ_ARG, NULL ,'w'},
+ {"OPJ_CINEMA4K",NO_ARG, NULL ,'y'},
{"ImgDir",REQ_ARG, NULL ,'z'},
{"TP",REQ_ARG, NULL ,'u'},
{"SOP",NO_ARG, NULL ,'S'},
@@ -1036,15 +1036,15 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
int fps=0;
sscanf(opj_optarg,"%d",&fps);
if(fps == 24){
- parameters->cp_cinema = CINEMA2K_24;
+ parameters->cp_cinema = OPJ_CINEMA2K_24;
}else if(fps == 48 ){
- parameters->cp_cinema = CINEMA2K_48;
+ parameters->cp_cinema = OPJ_CINEMA2K_48;
}else {
fprintf(stderr,"Incorrect value!! must be 24 or 48\n");
return 1;
}
fprintf(stdout,"CINEMA 2K compliant codestream\n");
- parameters->cp_rsiz = CINEMA2K;
+ parameters->cp_rsiz = OPJ_CINEMA2K;
}
break;
@@ -1053,9 +1053,9 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
case 'y': /* Digital Cinema 4K profile compliance*/
{
- parameters->cp_cinema = CINEMA4K_24;
+ parameters->cp_cinema = OPJ_CINEMA4K_24;
fprintf(stdout,"CINEMA 4K compliant codestream\n");
- parameters->cp_rsiz = CINEMA4K;
+ parameters->cp_rsiz = OPJ_CINEMA4K;
}
break;
@@ -1466,7 +1466,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
/* check for possible errors */
if (parameters->cp_cinema){
if(parameters->tcp_numlayers > 1){
- parameters->cp_rsiz = STD_RSIZ;
+ parameters->cp_rsiz = OPJ_STD_RSIZ;
fprintf(stdout,"Warning: DC profiles do not allow more than one quality layer. The codestream created will not be compliant with the DC profile\n");
}
}
@@ -1601,8 +1601,8 @@ int main(int argc, char **argv) {
img_fol_t img_fol;
dircnt_t *dirptr = NULL;
- opj_bool bSuccess;
- opj_bool bUseTiles = OPJ_FALSE; /* OPJ_TRUE */
+ OPJ_BOOL bSuccess;
+ OPJ_BOOL bUseTiles = OPJ_FALSE; /* OPJ_TRUE */
OPJ_UINT32 l_nb_tiles = 4;
/* set encoding parameters to default values */
@@ -1793,13 +1793,13 @@ int main(int argc, char **argv) {
case J2K_CFMT: /* JPEG-2000 codestream */
{
/* Get a decoder handle */
- l_codec = opj_create_compress(CODEC_J2K);
+ l_codec = opj_create_compress(OPJ_CODEC_J2K);
break;
}
case JP2_CFMT: /* JPEG 2000 compressed image data */
{
/* Get a decoder handle */
- l_codec = opj_create_compress(CODEC_JP2);
+ l_codec = opj_create_compress(OPJ_CODEC_JP2);
break;
}
default:
diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c
index ac5e79c3..c8f87671 100644
--- a/src/bin/jp2/opj_decompress.c
+++ b/src/bin/jp2/opj_decompress.c
@@ -764,19 +764,19 @@ int main(int argc, char **argv)
case J2K_CFMT: /* JPEG-2000 codestream */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_J2K);
+ l_codec = opj_create_decompress(OPJ_CODEC_J2K);
break;
}
case JP2_CFMT: /* JPEG 2000 compressed image data */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_JP2);
+ l_codec = opj_create_decompress(OPJ_CODEC_JP2);
break;
}
case JPT_CFMT: /* JPEG 2000, JPIP */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_JPT);
+ l_codec = opj_create_decompress(OPJ_CODEC_JPT);
break;
}
default:
@@ -859,7 +859,7 @@ int main(int argc, char **argv)
opj_stream_destroy(l_stream);
fclose(fsrc);
- if(image->color_space == CLRSPC_SYCC){
+ if(image->color_space == OPJ_CLRSPC_SYCC){
color_sycc_to_rgb(image); /* FIXME */
}
diff --git a/src/bin/jp2/opj_dump.c b/src/bin/jp2/opj_dump.c
index ca801d5a..c7223e40 100644
--- a/src/bin/jp2/opj_dump.c
+++ b/src/bin/jp2/opj_dump.c
@@ -414,7 +414,7 @@ int main(int argc, char *argv[])
dircnt_t *dirptr = NULL;
#ifdef MSD
- opj_bool l_go_on = OPJ_TRUE;
+ OPJ_BOOL l_go_on = OPJ_TRUE;
OPJ_UINT32 l_max_data_size = 1000;
OPJ_BYTE * l_data = (OPJ_BYTE *) malloc(1000);
#endif
@@ -505,19 +505,19 @@ int main(int argc, char *argv[])
case J2K_CFMT: /* JPEG-2000 codestream */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_J2K);
+ l_codec = opj_create_decompress(OPJ_CODEC_J2K);
break;
}
case JP2_CFMT: /* JPEG 2000 compressed image data */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_JP2);
+ l_codec = opj_create_decompress(OPJ_CODEC_JP2);
break;
}
case JPT_CFMT: /* JPEG 2000, JPIP */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_JPT);
+ l_codec = opj_create_decompress(OPJ_CODEC_JPT);
break;
}
default:
diff --git a/tests/comparePGXimages.c b/tests/comparePGXimages.c
index be741141..13cbd3cb 100644
--- a/tests/comparePGXimages.c
+++ b/tests/comparePGXimages.c
@@ -446,7 +446,7 @@ opj_image_t* readImageFromFilePGX(char* filename, int nbFilenamePGX, char *separ
free(filenameComponentPGX);
}
- image = opj_image_create(nbFilenamePGX, param_image_read, CLRSPC_UNSPECIFIED);
+ image = opj_image_create(nbFilenamePGX, param_image_read, OPJ_CLRSPC_UNSPECIFIED);
for (it_file = 0; it_file < nbFilenamePGX; it_file++)
{
/* Copy data into output image and free memory*/
@@ -480,7 +480,7 @@ int imageToPNG(const opj_image_t* image, const char* filename, int num_comp_sele
param_image_write.prec = image->comps[num_comp_select].prec;
param_image_write.sgnd = image->comps[num_comp_select].sgnd;
- image_write = opj_image_create(1, &param_image_write, CLRSPC_GRAY);
+ image_write = opj_image_create(1, &param_image_write, OPJ_CLRSPC_GRAY);
memcpy(image_write->comps->data, image->comps[num_comp_select].data, param_image_write.h * param_image_write.w * sizeof(int));
imagetopng(image_write, filename);
@@ -678,7 +678,7 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
- imageDiff = opj_image_create(imageBase->numcomps, param_image_diff, CLRSPC_UNSPECIFIED);
+ imageDiff = opj_image_create(imageBase->numcomps, param_image_diff, OPJ_CLRSPC_UNSPECIFIED);
/* Free memory*/
free(param_image_diff);
diff --git a/tests/j2k_random_tile_access.c b/tests/j2k_random_tile_access.c
index f87c36ea..23420f4e 100644
--- a/tests/j2k_random_tile_access.c
+++ b/tests/j2k_random_tile_access.c
@@ -196,19 +196,19 @@ int main(int argc, char **argv)
case J2K_CFMT: /* JPEG-2000 codestream */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_J2K);
+ l_codec = opj_create_decompress(OPJ_CODEC_J2K);
break;
}
case JP2_CFMT: /* JPEG 2000 compressed image data */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_JP2);
+ l_codec = opj_create_decompress(OPJ_CODEC_JP2);
break;
}
case JPT_CFMT: /* JPEG 2000, JPIP */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_JPT);
+ l_codec = opj_create_decompress(OPJ_CODEC_JPT);
break;
}
default:
diff --git a/tests/test_tile_decoder.c b/tests/test_tile_decoder.c
index 6691cd4e..81f791cb 100644
--- a/tests/test_tile_decoder.c
+++ b/tests/test_tile_decoder.c
@@ -185,7 +185,7 @@ int main (int argc, char *argv[])
OPJ_UINT32 l_max_data_size = 1000;
OPJ_UINT32 l_tile_index;
OPJ_BYTE * l_data = (OPJ_BYTE *) malloc(1000);
- opj_bool l_go_on = OPJ_TRUE;
+ OPJ_BOOL l_go_on = OPJ_TRUE;
OPJ_INT32 l_tile_x0=0, l_tile_y0=0 ;
OPJ_UINT32 l_tile_width=0, l_tile_height=0, l_nb_tiles_x=0, l_nb_tiles_y=0, l_nb_comps=0 ;
OPJ_INT32 l_current_tile_x0,l_current_tile_y0,l_current_tile_x1,l_current_tile_y1;
@@ -256,13 +256,13 @@ int main (int argc, char *argv[])
case J2K_CFMT: /* JPEG-2000 codestream */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_J2K);
+ l_codec = opj_create_decompress(OPJ_CODEC_J2K);
break;
}
case JP2_CFMT: /* JPEG 2000 compressed image data */
{
/* Get a decoder handle */
- l_codec = opj_create_decompress(CODEC_JP2);
+ l_codec = opj_create_decompress(OPJ_CODEC_JP2);
break;
}
default:
diff --git a/tests/test_tile_encoder.c b/tests/test_tile_encoder.c
index a405d86e..22ecb348 100644
--- a/tests/test_tile_encoder.c
+++ b/tests/test_tile_encoder.c
@@ -175,7 +175,7 @@ int main (int argc, char *argv[])
l_param.irreversible = irreversible;
/* do not bother with mct, the rsiz is set when calling opj_set_MCT*/
- /*l_param.cp_rsiz = STD_RSIZ;*/
+ /*l_param.cp_rsiz = OPJ_STD_RSIZ;*/
/* no cinema */
/*l_param.cp_cinema = 0;*/
@@ -203,8 +203,8 @@ int main (int argc, char *argv[])
l_param.numresolution = 6;
/** progression order to use*/
- /** LRCP, RLCP, RPCL, PCRL, CPRL */
- l_param.prog_order = LRCP;
+ /** OPJ_LRCP, OPJ_RLCP, OPJ_RPCL, PCRL, CPRL */
+ l_param.prog_order = OPJ_LRCP;
/** no "region" of interest, more precisally component */
/* l_param.roi_compno = -1; */
@@ -244,11 +244,11 @@ int main (int argc, char *argv[])
len = strlen( output_file );
if( strcmp( output_file + len - 4, ".jp2" ) == 0 )
{
- l_codec = opj_create_compress(CODEC_JP2);
+ l_codec = opj_create_compress(OPJ_CODEC_JP2);
}
else
{
- l_codec = opj_create_compress(CODEC_J2K);
+ l_codec = opj_create_compress(OPJ_CODEC_J2K);
}
if (!l_codec) {
return 1;
@@ -259,7 +259,7 @@ int main (int argc, char *argv[])
opj_set_warning_handler(l_codec, warning_callback,00);
opj_set_error_handler(l_codec, error_callback,00);
- l_image = opj_image_tile_create(num_comps,l_params,CLRSPC_SRGB);
+ l_image = opj_image_tile_create(num_comps,l_params,OPJ_CLRSPC_SRGB);
if (! l_image) {
opj_destroy_codec(l_codec);
return 1;
@@ -269,7 +269,7 @@ int main (int argc, char *argv[])
l_image->y0 = 0;
l_image->x1 = image_width;
l_image->y1 = image_height;
- l_image->color_space = CLRSPC_SRGB;
+ l_image->color_space = OPJ_CLRSPC_SRGB;
if (! opj_setup_encoder(l_codec,&l_param,l_image)) {
fprintf(stderr, "ERROR -> test_tile_encoder: failed to setup the codec!\n");
diff --git a/tests/unit/testempty1.c b/tests/unit/testempty1.c
index 110b8c6b..add522a6 100644
--- a/tests/unit/testempty1.c
+++ b/tests/unit/testempty1.c
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
{
const char * v = opj_version();
- const OPJ_COLOR_SPACE color_space = CLRSPC_GRAY;
+ const OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_GRAY;
int numcomps = 1;
int i;
int image_width = 256;
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
opj_image_cmptparm_t cmptparm;
opj_image_t *image;
opj_codec_t* l_codec = 00;
- opj_bool bSuccess;
+ OPJ_BOOL bSuccess;
FILE *f;
opj_stream_t *l_stream = 00;
(void)argc;
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
opj_set_warning_handler(l_codec, warning_callback,00);
opj_set_error_handler(l_codec, error_callback,00);
- l_codec = opj_create_compress(CODEC_J2K);
+ l_codec = opj_create_compress(OPJ_CODEC_J2K);
opj_set_info_handler(l_codec, info_callback,00);
opj_set_warning_handler(l_codec, warning_callback,00);
opj_set_error_handler(l_codec, error_callback,00);
diff --git a/tests/unit/testempty2.c b/tests/unit/testempty2.c
index 6e317755..47ef4cc2 100644
--- a/tests/unit/testempty2.c
+++ b/tests/unit/testempty2.c
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
{
const char * v = opj_version();
- const OPJ_COLOR_SPACE color_space = CLRSPC_GRAY;
+ const OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_GRAY;
int numcomps = 1;
int i;
int image_width = 256;
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
opj_image_cmptparm_t cmptparm;
opj_image_t *image;
opj_codec_t* l_codec = 00;
- opj_bool bSuccess;
+ OPJ_BOOL bSuccess;
FILE *f;
opj_stream_t *l_stream = 00;
(void)argc;
@@ -106,7 +106,7 @@ int main(int argc, char *argv[])
opj_set_warning_handler(l_codec, warning_callback,00);
opj_set_error_handler(l_codec, error_callback,00);
- l_codec = opj_create_compress(CODEC_J2K);
+ l_codec = opj_create_compress(OPJ_CODEC_J2K);
opj_set_info_handler(l_codec, info_callback,00);
opj_set_warning_handler(l_codec, warning_callback,00);
opj_set_error_handler(l_codec, error_callback,00);
@@ -141,7 +141,7 @@ int main(int argc, char *argv[])
opj_dparameters_t dparameters;
assert( fsrc );
- d_codec = opj_create_decompress(CODEC_J2K);
+ d_codec = opj_create_decompress(OPJ_CODEC_J2K);
opj_set_info_handler(d_codec, info_callback,00);
opj_set_warning_handler(d_codec, warning_callback,00);
opj_set_error_handler(d_codec, error_callback,00);