ENH: Marking const char * what should be const char *. TODO need to fix code for imagetopgx.

This commit is contained in:
Mathieu Malaterre 2006-07-21 21:07:18 +00:00
parent f222743e19
commit abe8e93c21
2 changed files with 12 additions and 12 deletions

View File

@ -97,7 +97,7 @@ typedef struct {
DWORD biClrImportant; /* Number of important color (0: ALL) */ DWORD biClrImportant; /* Number of important color (0: ALL) */
} BITMAPINFOHEADER_t; } BITMAPINFOHEADER_t;
opj_image_t* bmptoimage(char *filename, opj_cparameters_t *parameters) { opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters) {
int subsampling_dx = parameters->subsampling_dx; int subsampling_dx = parameters->subsampling_dx;
int subsampling_dy = parameters->subsampling_dy; int subsampling_dy = parameters->subsampling_dy;
@ -460,7 +460,7 @@ opj_image_t* bmptoimage(char *filename, opj_cparameters_t *parameters) {
return image; return image;
} }
int imagetobmp(opj_image_t * image, char *outfile) { int imagetobmp(opj_image_t * image, const char *outfile) {
int w, wr, h, hr; int w, wr, h, hr;
int i, pad; int i, pad;
FILE *fdest = NULL; FILE *fdest = NULL;
@ -656,7 +656,7 @@ unsigned int readuint(FILE * f, int bigendian)
return (c4 << 24) + (c3 << 16) + (c2 << 8) + c1; return (c4 << 24) + (c3 << 16) + (c2 << 8) + c1;
} }
opj_image_t* pgxtoimage(char *filename, opj_cparameters_t *parameters) { opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters) {
FILE *f = NULL; FILE *f = NULL;
int w, h, prec; int w, h, prec;
int i, numcomps, max; int i, numcomps, max;
@ -833,7 +833,7 @@ PNM IMAGE FORMAT
<<-- <<-- <<-- <<-- */ <<-- <<-- <<-- <<-- */
opj_image_t* pnmtoimage(char *filename, opj_cparameters_t *parameters) { opj_image_t* pnmtoimage(const char *filename, opj_cparameters_t *parameters) {
int subsampling_dx = parameters->subsampling_dx; int subsampling_dx = parameters->subsampling_dx;
int subsampling_dy = parameters->subsampling_dy; int subsampling_dy = parameters->subsampling_dy;
@ -932,13 +932,13 @@ opj_image_t* pnmtoimage(char *filename, opj_cparameters_t *parameters) {
return image; return image;
} }
int imagetopnm(opj_image_t * image, char *outfile) { int imagetopnm(opj_image_t * image, const char *outfile) {
int w, wr, wrr, h, hr, hrr, max; int w, wr, wrr, h, hr, hrr, max;
int i, compno; int i, compno;
int adjust; int adjust;
FILE *fdest = NULL; FILE *fdest = NULL;
char S2; char S2;
char *tmp = outfile; const char *tmp = outfile;
while (*tmp) { while (*tmp) {
tmp++; tmp++;

View File

@ -30,9 +30,9 @@
#ifndef __J2K_CONVERT_H #ifndef __J2K_CONVERT_H
#define __J2K_CONVERT_H #define __J2K_CONVERT_H
opj_image_t* bmptoimage(char *filename, opj_cparameters_t *parameters); opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters);
int imagetobmp(opj_image_t *image, char *outfile); int imagetobmp(opj_image_t *image, const char *outfile);
/** /**
Load a single image component encoded in PGX file format Load a single image component encoded in PGX file format
@ -40,13 +40,13 @@ Load a single image component encoded in PGX file format
@param parameters *List ?* @param parameters *List ?*
@return Returns a greyscale image if successful, returns NULL otherwise @return Returns a greyscale image if successful, returns NULL otherwise
*/ */
opj_image_t* pgxtoimage(char *filename, opj_cparameters_t *parameters); opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters);
int imagetopgx(opj_image_t *image, char *outfile); int imagetopgx(opj_image_t *image, const char *outfile);
opj_image_t* pnmtoimage(char *filename, opj_cparameters_t *parameters); opj_image_t* pnmtoimage(const char *filename, opj_cparameters_t *parameters);
int imagetopnm(opj_image_t *image, char *outfile); int imagetopnm(opj_image_t *image, const char *outfile);
#endif /* __J2K_CONVERT_H */ #endif /* __J2K_CONVERT_H */