diff options
| author | Antonin Descampe <antonin@gmail.com> | 2011-05-18 11:02:27 +0000 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2011-05-18 11:02:27 +0000 |
| commit | 88f43b15fab0c75c10635c9e3d6381e5d716b8e9 (patch) | |
| tree | dd05218cd57a6d2de5bfc10db1e777f84e31d314 /applications/codec | |
| parent | 0c9f6a3ac9ede04eb6faf96b7d7a9586c551a9c2 (diff) | |
defined new type "opj_bool", and new constants OPJ_FALSE and OPJ_TRUE, to avoid having to deal with "stdbool.h" (patch from Winfried)
Diffstat (limited to 'applications/codec')
| -rw-r--r-- | applications/codec/convert.c | 10 | ||||
| -rw-r--r-- | applications/codec/convert.h | 2 | ||||
| -rw-r--r-- | applications/codec/image_to_j2k.c | 12 | ||||
| -rw-r--r-- | applications/codec/j2k_to_image.c | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/applications/codec/convert.c b/applications/codec/convert.c index d9a45b9a..8c40b0ac 100644 --- a/applications/codec/convert.c +++ b/applications/codec/convert.c @@ -140,7 +140,7 @@ int tga_readheader(FILE *fp, unsigned int *bits_per_pixel, } int tga_writeheader(FILE *fp, int bits_per_pixel, int width, int height, - bool flip_image) + opj_bool flip_image) { tga_header tga; @@ -173,8 +173,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; - bool mono ; - bool save_alpha; + opj_bool mono ; + opj_bool save_alpha; int subsampling_dx, subsampling_dy; int i; @@ -282,7 +282,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; - bool write_alpha; + opj_bool write_alpha; int i; unsigned int alpha_channel; float r,g,b,a; @@ -313,7 +313,7 @@ int imagetotga(opj_image_t * image, const char *outfile) { // Write TGA header bpp = write_alpha ? 32 : 24; - if (!tga_writeheader(fdest, bpp, width , height, true)) + if (!tga_writeheader(fdest, bpp, width , height, OPJ_TRUE)) return 1; alpha_channel = image->numcomps-1; diff --git a/applications/codec/convert.h b/applications/codec/convert.h index 1dc58d72..d2f82fcf 100644 --- a/applications/codec/convert.h +++ b/applications/codec/convert.h @@ -43,7 +43,7 @@ typedef struct raw_cparameters { /** bit depth of the raw image */ int rawBitDepth; /** signed/unsigned raw image */ - bool rawSigned; + opj_bool rawSigned; /*@}*/ } raw_cparameters_t; diff --git a/applications/codec/image_to_j2k.c b/applications/codec/image_to_j2k.c index 66d2bf4a..1e1cfbf4 100644 --- a/applications/codec/image_to_j2k.c +++ b/applications/codec/image_to_j2k.c @@ -454,7 +454,7 @@ static int initialise_4K_poc(opj_poc_t *POC, int numres){ } void cinema_parameters(opj_cparameters_t *parameters){ - parameters->tile_size_on = false; + parameters->tile_size_on = OPJ_FALSE; parameters->cp_tdx=1; parameters->cp_tdy=1; @@ -694,11 +694,11 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters, char *s = optarg; if (sscanf(s, "%d,%d,%d,%d,%c", &raw_cp->rawWidth, &raw_cp->rawHeight, &raw_cp->rawComp, &raw_cp->rawBitDepth, &signo) == 5) { if (signo == 's') { - raw_cp->rawSigned = true; + raw_cp->rawSigned = OPJ_TRUE; fprintf(stdout,"\nRaw file parameters: %d,%d,%d,%d Signed\n", raw_cp->rawWidth, raw_cp->rawHeight, raw_cp->rawComp, raw_cp->rawBitDepth); } else if (signo == 'u') { - raw_cp->rawSigned = false; + raw_cp->rawSigned = OPJ_FALSE; fprintf(stdout,"\nRaw file parameters: %d,%d,%d,%d Unsigned\n", raw_cp->rawWidth, raw_cp->rawHeight, raw_cp->rawComp, raw_cp->rawBitDepth); } else { @@ -791,7 +791,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters, case 't': /* tiles */ { sscanf(optarg, "%d,%d", ¶meters->cp_tdx, ¶meters->cp_tdy); - parameters->tile_size_on = true; + parameters->tile_size_on = OPJ_TRUE; } break; @@ -1363,7 +1363,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters, /* some info */ fprintf(stdout, "Info: JPWL capabilities enabled\n"); - parameters->jpwl_epc_on = true; + parameters->jpwl_epc_on = OPJ_TRUE; } break; @@ -1475,7 +1475,7 @@ void info_callback(const char *msg, void *client_data) { /* -------------------------------------------------------------------------- */ int main(int argc, char **argv) { - bool bSuccess; + opj_bool bSuccess; opj_cparameters_t parameters; /* compression parameters */ img_fol_t img_fol; opj_event_mgr_t event_mgr; /* event manager */ diff --git a/applications/codec/j2k_to_image.c b/applications/codec/j2k_to_image.c index ff6141ee..bc9ef7dd 100644 --- a/applications/codec/j2k_to_image.c +++ b/applications/codec/j2k_to_image.c @@ -443,7 +443,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters,i /* next token or bust */ token = strtok(NULL, ","); }; - parameters->jpwl_correct = true; + parameters->jpwl_correct = OPJ_TRUE; fprintf(stdout, "JPWL correction capability activated\n"); fprintf(stdout, "- expecting %d components\n", parameters->jpwl_exp_comps); } |
