defined new type "opj_bool", and new constants OPJ_FALSE and OPJ_TRUE, to avoid having to deal with "stdbool.h" (patch from Winfried)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user