diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-10-10 12:53:32 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-10-25 15:50:27 +0200 |
commit | c7535ca8ef92af5adcb58d1b33e15933c27951c5 (patch) | |
tree | 0f872a7c2c2d447901c04b0b93a7e420c6afd479 /source | |
parent | f0367fc24d95a2172ed0ebb38adc0632de9fb7ce (diff) | |
download | mupdf-c7535ca8ef92af5adcb58d1b33e15933c27951c5.tar.xz |
Rename NO_ICC to FZ_ENABLE_ICC=0|1 to match other config.h options.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/color-lcms.c | 2 | ||||
-rw-r--r-- | source/fitz/colorspace.c | 40 | ||||
-rw-r--r-- | source/tools/mudraw.c | 6 |
3 files changed, 25 insertions, 23 deletions
diff --git a/source/fitz/color-lcms.c b/source/fitz/color-lcms.c index f4fc1ac8..1f94c428 100644 --- a/source/fitz/color-lcms.c +++ b/source/fitz/color-lcms.c @@ -1,6 +1,6 @@ #include "mupdf/fitz.h" -#ifndef NO_ICC +#if FZ_ENABLE_ICC #include "lcms2mt.h" #include "lcms2mt_plugin.h" #include "colorspace-imp.h" diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c index de3b3578..4a957d20 100644 --- a/source/fitz/colorspace.c +++ b/source/fitz/colorspace.c @@ -147,15 +147,7 @@ void fz_cmm_fin_profile(fz_context *ctx, fz_iccprofile *profile) #define SLOWCMYK -#ifdef NO_ICC - -const unsigned char * -fz_lookup_icc(fz_context *ctx, enum fz_colorspace_type type, size_t *size) -{ - return *size = 0, NULL; -} - -#else +#if FZ_ENABLE_ICC #include "icc/gray.icc.h" #include "icc/rgb.icc.h" @@ -186,6 +178,14 @@ fz_lookup_icc(fz_context *ctx, enum fz_colorspace_type type, size_t *size) return *size = 0, NULL; } +#else + +const unsigned char * +fz_lookup_icc(fz_context *ctx, enum fz_colorspace_type type, size_t *size) +{ + return *size = 0, NULL; +} + #endif /* Same order as needed by lcms */ @@ -835,10 +835,7 @@ void fz_set_cmm_engine(fz_context *ctx, const fz_cmm_engine *engine) if (!cct) return; -#ifdef NO_ICC - if (engine) - fz_throw(ctx, FZ_ERROR_GENERIC, "ICC workflow not supported in NO_ICC build"); -#else +#if FZ_ENABLE_ICC if (cct->cmm == engine) return; @@ -885,6 +882,9 @@ void fz_set_cmm_engine(fz_context *ctx, const fz_cmm_engine *engine) } else set_no_icc(cct); +#else + if (engine) + fz_throw(ctx, FZ_ERROR_GENERIC, "ICC workflow not supported in FZ_ENABLE_ICC=0 build"); #endif } @@ -893,10 +893,10 @@ void fz_new_colorspace_context(fz_context *ctx) ctx->colorspace = fz_malloc_struct(ctx, fz_colorspace_context); ctx->colorspace->ctx_refs = 1; set_no_icc(ctx->colorspace); -#ifdef NO_ICC - fz_set_cmm_engine(ctx, NULL); -#else +#if FZ_ENABLE_ICC fz_set_cmm_engine(ctx, &fz_cmm_engine_lcms); +#else + fz_set_cmm_engine(ctx, NULL); #endif } @@ -3735,6 +3735,7 @@ const char *fz_colorspace_name(fz_context *ctx, const fz_colorspace *cs) return cs ? cs->name : ""; } +#if FZ_ENABLE_ICC static void free_icc(fz_context *ctx, fz_colorspace *cs) { @@ -3775,13 +3776,12 @@ static const char *colorspace_name_from_type(int type) case FZ_COLORSPACE_LAB: return "Lab"; } } +#endif fz_colorspace * fz_new_icc_colorspace(fz_context *ctx, enum fz_colorspace_type type, fz_buffer *buf) { -#ifdef NO_ICC - fz_throw(ctx, FZ_ERROR_GENERIC, "ICC Profiles not supported in NO_ICC build"); -#else +#if FZ_ENABLE_ICC fz_colorspace *cs = NULL; fz_iccprofile *profile; int flags = FZ_COLORSPACE_IS_ICC; @@ -3886,6 +3886,8 @@ fz_new_icc_colorspace(fz_context *ctx, enum fz_colorspace_type type, fz_buffer * fz_rethrow(ctx); } return cs; +#else + fz_throw(ctx, FZ_ERROR_GENERIC, "ICC Profiles not supported in FZ_ENABLE_ICC=0 build"); #endif } diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c index bcae107d..c49ec18d 100644 --- a/source/tools/mudraw.c +++ b/source/tools/mudraw.c @@ -274,10 +274,10 @@ static int num_workers = 0; static worker_t *workers; static fz_band_writer *bander = NULL; -#ifdef NO_ICC -static fz_cmm_engine *icc_engine = NULL; -#else +#if FZ_ENABLE_ICC static fz_cmm_engine *icc_engine = &fz_cmm_engine_lcms; +#else +static fz_cmm_engine *icc_engine = NULL; #endif static const char *layer_config = NULL; |