diff options
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/colorspace.c | 42 | ||||
-rw-r--r-- | source/fitz/function.c | 8 | ||||
-rw-r--r-- | source/fitz/hash.c | 16 |
3 files changed, 33 insertions, 33 deletions
diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c index 3426e26f..01a319de 100644 --- a/source/fitz/colorspace.c +++ b/source/fitz/colorspace.c @@ -41,14 +41,14 @@ fz_drop_colorspace(fz_context *ctx, fz_colorspace *cs) /* Device colorspace definitions */ -static void gray_to_rgb(fz_context *ctx, fz_colorspace *cs, float *gray, float *rgb) +static void gray_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *gray, float *rgb) { rgb[0] = gray[0]; rgb[1] = gray[0]; rgb[2] = gray[0]; } -static void rgb_to_gray(fz_context *ctx, fz_colorspace *cs, float *rgb, float *gray) +static void rgb_to_gray(fz_context *ctx, fz_colorspace *cs, const float *rgb, float *gray) { float r = rgb[0]; float g = rgb[1]; @@ -56,28 +56,28 @@ static void rgb_to_gray(fz_context *ctx, fz_colorspace *cs, float *rgb, float *g gray[0] = r * 0.3f + g * 0.59f + b * 0.11f; } -static void rgb_to_rgb(fz_context *ctx, fz_colorspace *cs, float *rgb, float *xyz) +static void rgb_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *rgb, float *xyz) { xyz[0] = rgb[0]; xyz[1] = rgb[1]; xyz[2] = rgb[2]; } -static void bgr_to_rgb(fz_context *ctx, fz_colorspace *cs, float *bgr, float *rgb) +static void bgr_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *bgr, float *rgb) { rgb[0] = bgr[2]; rgb[1] = bgr[1]; rgb[2] = bgr[0]; } -static void rgb_to_bgr(fz_context *ctx, fz_colorspace *cs, float *rgb, float *bgr) +static void rgb_to_bgr(fz_context *ctx, fz_colorspace *cs, const float *rgb, float *bgr) { bgr[0] = rgb[2]; bgr[1] = rgb[1]; bgr[2] = rgb[0]; } -static void cmyk_to_rgb(fz_context *ctx, fz_colorspace *cs, float *cmyk, float *rgb) +static void cmyk_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *cmyk, float *rgb) { #ifdef SLOWCMYK /* from poppler */ float c = cmyk[0], m = cmyk[1], y = cmyk[2], k = cmyk[3]; @@ -156,7 +156,7 @@ static void cmyk_to_rgb(fz_context *ctx, fz_colorspace *cs, float *cmyk, float * #endif } -static void rgb_to_cmyk(fz_context *ctx, fz_colorspace *cs, float *rgb, float *cmyk) +static void rgb_to_cmyk(fz_context *ctx, fz_colorspace *cs, const float *rgb, float *cmyk) { float c, m, y, k; c = 1 - rgb[0]; @@ -990,7 +990,7 @@ fz_convert_pixmap(fz_context *ctx, fz_pixmap *dp, fz_pixmap *sp) /* Convert a single color */ static void -std_conv_color(fz_color_converter *cc, float *dstv, float *srcv) +std_conv_color(fz_color_converter *cc, float *dstv, const float *srcv) { float rgb[3]; int i; @@ -1014,7 +1014,7 @@ std_conv_color(fz_color_converter *cc, float *dstv, float *srcv) } static void -g2rgb(fz_color_converter *cc, float *dv, float *sv) +g2rgb(fz_color_converter *cc, float *dv, const float *sv) { dv[0] = sv[0]; dv[1] = sv[0]; @@ -1022,7 +1022,7 @@ g2rgb(fz_color_converter *cc, float *dv, float *sv) } static void -g2cmyk(fz_color_converter *cc, float *dv, float *sv) +g2cmyk(fz_color_converter *cc, float *dv, const float *sv) { dv[0] = 0; dv[1] = 0; @@ -1031,13 +1031,13 @@ g2cmyk(fz_color_converter *cc, float *dv, float *sv) } static void -rgb2g(fz_color_converter *cc, float *dv, float *sv) +rgb2g(fz_color_converter *cc, float *dv, const float *sv) { dv[0] = sv[0] * 0.3f + sv[1] * 0.59f + sv[2] * 0.11f; } static void -rgb2bgr(fz_color_converter *cc, float *dv, float *sv) +rgb2bgr(fz_color_converter *cc, float *dv, const float *sv) { dv[0] = sv[2]; dv[1] = sv[1]; @@ -1045,7 +1045,7 @@ rgb2bgr(fz_color_converter *cc, float *dv, float *sv) } static void -rgb2cmyk(fz_color_converter *cc, float *dv, float *sv) +rgb2cmyk(fz_color_converter *cc, float *dv, const float *sv) { float c = 1 - sv[0]; float m = 1 - sv[1]; @@ -1058,13 +1058,13 @@ rgb2cmyk(fz_color_converter *cc, float *dv, float *sv) } static void -bgr2g(fz_color_converter *cc, float *dv, float *sv) +bgr2g(fz_color_converter *cc, float *dv, const float *sv) { dv[0] = sv[0] * 0.11f + sv[1] * 0.59f + sv[2] * 0.3f; } static void -bgr2cmyk(fz_color_converter *cc, float *dv, float *sv) +bgr2cmyk(fz_color_converter *cc, float *dv, const float *sv) { float c = 1 - sv[2]; float m = 1 - sv[1]; @@ -1077,7 +1077,7 @@ bgr2cmyk(fz_color_converter *cc, float *dv, float *sv) } static void -cmyk2g(fz_color_converter *cc, float *dv, float *sv) +cmyk2g(fz_color_converter *cc, float *dv, const float *sv) { float c = sv[0] * 0.3f; float m = sv[1] * 0.59f; @@ -1086,7 +1086,7 @@ cmyk2g(fz_color_converter *cc, float *dv, float *sv) } static void -cmyk2rgb(fz_color_converter *cc, float *dv, float *sv) +cmyk2rgb(fz_color_converter *cc, float *dv, const float *sv) { #ifdef SLOWCMYK cmyk_to_rgb(cc->ctx, NULL, sv, dv); @@ -1098,7 +1098,7 @@ cmyk2rgb(fz_color_converter *cc, float *dv, float *sv) } static void -cmyk2bgr(fz_color_converter *cc, float *dv, float *sv) +cmyk2bgr(fz_color_converter *cc, float *dv, const float *sv) { #ifdef SLOWCMYK float rgb[3]; @@ -1169,7 +1169,7 @@ void fz_lookup_color_converter(fz_color_converter *cc, fz_context *ctx, fz_color } void -fz_convert_color(fz_context *ctx, fz_colorspace *ds, float *dv, fz_colorspace *ss, float *sv) +fz_convert_color(fz_context *ctx, fz_colorspace *ds, float *dv, fz_colorspace *ss, const float *sv) { fz_color_converter cc; fz_lookup_color_converter(&cc, ctx, ds, ss); @@ -1186,7 +1186,7 @@ struct indexed }; static void -indexed_to_rgb(fz_context *ctx, fz_colorspace *cs, float *color, float *rgb) +indexed_to_rgb(fz_context *ctx, fz_colorspace *cs, const float *color, float *rgb) { struct indexed *idx = cs->data; float alt[FZ_MAX_COLORS]; @@ -1283,7 +1283,7 @@ typedef struct fz_cached_color_converter } fz_cached_color_converter; -static void fz_cached_color_convert(fz_color_converter *cc_, float *ds, float *ss) +static void fz_cached_color_convert(fz_color_converter *cc_, float *ds, const float *ss) { fz_cached_color_converter *cc = cc_->opaque; fz_context *ctx = cc->base.ctx; diff --git a/source/fitz/function.c b/source/fitz/function.c index b5ba4815..7ebdb912 100644 --- a/source/fitz/function.c +++ b/source/fitz/function.c @@ -1,18 +1,18 @@ #include "mupdf/fitz.h" void -fz_eval_function(fz_context *ctx, fz_function *func, float *in_, int inlen, float *out_, int outlen) +fz_eval_function(fz_context *ctx, fz_function *func, const float *in_, int inlen, float *out_, int outlen) { float fakein[FZ_FN_MAXM]; float fakeout[FZ_FN_MAXN]; - float *in = in_; + const float *in = in_; float *out = out_; if (inlen < func->m) { in = fakein; - memset(in, 0, sizeof(float) * func->m); - memcpy(in, in_, sizeof(float) * inlen); + memset(fakein, 0, sizeof(float) * func->m); + memcpy(fakein, in_, sizeof(float) * inlen); } if (outlen < func->n) diff --git a/source/fitz/hash.c b/source/fitz/hash.c index 624cc305..708d72f2 100644 --- a/source/fitz/hash.c +++ b/source/fitz/hash.c @@ -26,7 +26,7 @@ struct fz_hash_table_s fz_hash_entry *ents; }; -static unsigned hash(unsigned char *s, int len) +static unsigned hash(const unsigned char *s, int len) { unsigned val = 0; int i; @@ -101,7 +101,7 @@ fz_free_hash(fz_context *ctx, fz_hash_table *table) } static void * -do_hash_insert(fz_context *ctx, fz_hash_table *table, void *key, void *val, unsigned *pos_ptr) +do_hash_insert(fz_context *ctx, fz_hash_table *table, const void *key, void *val, unsigned *pos_ptr) { fz_hash_entry *ents; unsigned size; @@ -199,7 +199,7 @@ fz_resize_hash(fz_context *ctx, fz_hash_table *table, int newsize) } void * -fz_hash_find(fz_context *ctx, fz_hash_table *table, void *key) +fz_hash_find(fz_context *ctx, fz_hash_table *table, const void *key) { fz_hash_entry *ents = table->ents; unsigned size = table->size; @@ -221,7 +221,7 @@ fz_hash_find(fz_context *ctx, fz_hash_table *table, void *key) } void * -fz_hash_insert(fz_context *ctx, fz_hash_table *table, void *key, void *val) +fz_hash_insert(fz_context *ctx, fz_hash_table *table, const void *key, void *val) { if (table->load > table->size * 8 / 10) { @@ -232,7 +232,7 @@ fz_hash_insert(fz_context *ctx, fz_hash_table *table, void *key, void *val) } void * -fz_hash_insert_with_pos(fz_context *ctx, fz_hash_table *table, void *key, void *val, unsigned *pos) +fz_hash_insert_with_pos(fz_context *ctx, fz_hash_table *table, const void *key, void *val, unsigned *pos) { if (table->load > table->size * 8 / 10) { @@ -243,7 +243,7 @@ fz_hash_insert_with_pos(fz_context *ctx, fz_hash_table *table, void *key, void * } static void -do_removal(fz_context *ctx, fz_hash_table *table, void *key, unsigned hole) +do_removal(fz_context *ctx, fz_hash_table *table, const void *key, unsigned hole) { fz_hash_entry *ents = table->ents; unsigned size = table->size; @@ -279,7 +279,7 @@ do_removal(fz_context *ctx, fz_hash_table *table, void *key, unsigned hole) } void -fz_hash_remove(fz_context *ctx, fz_hash_table *table, void *key) +fz_hash_remove(fz_context *ctx, fz_hash_table *table, const void *key) { fz_hash_entry *ents = table->ents; unsigned size = table->size; @@ -309,7 +309,7 @@ fz_hash_remove(fz_context *ctx, fz_hash_table *table, void *key) } void -fz_hash_remove_fast(fz_context *ctx, fz_hash_table *table, void *key, unsigned pos) +fz_hash_remove_fast(fz_context *ctx, fz_hash_table *table, const void *key, unsigned pos) { fz_hash_entry *ents = table->ents; |