summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2017-04-10 10:17:07 -0700
committerRobin Watts <robin.watts@artifex.com>2017-06-16 16:13:18 +0100
commit691a6b2c26767186ee7e0e7d0813391f41ac0850 (patch)
treef6f22dcba9c4976e46b23a7ce0c179b18900fc7c /source/pdf
parentf631dc0ebc7910d4ef1b6e41bc36b1bfaf101a50 (diff)
downloadmupdf-691a6b2c26767186ee7e0e7d0813391f41ac0850.tar.xz
Strip doc out of color space load method
Also the pdf_load_function call. Doc was not used in either of these.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-colorspace.c32
-rw-r--r--source/pdf/pdf-function.c20
-rw-r--r--source/pdf/pdf-image.c4
-rw-r--r--source/pdf/pdf-interpret.c2
-rw-r--r--source/pdf/pdf-shade.c6
-rw-r--r--source/pdf/pdf-xobject.c2
6 files changed, 33 insertions, 33 deletions
diff --git a/source/pdf/pdf-colorspace.c b/source/pdf/pdf-colorspace.c
index 820ae713..2a862c65 100644
--- a/source/pdf/pdf-colorspace.c
+++ b/source/pdf/pdf-colorspace.c
@@ -8,7 +8,7 @@
/* ICCBased */
static fz_colorspace *
-load_icc_based(fz_context *ctx, pdf_document *doc, pdf_obj *dict)
+load_icc_based(fz_context *ctx, pdf_obj *dict)
{
int n;
pdf_obj *obj;
@@ -22,7 +22,7 @@ load_icc_based(fz_context *ctx, pdf_document *doc, pdf_obj *dict)
fz_try(ctx)
{
- cs_alt = pdf_load_colorspace(ctx, doc, obj);
+ cs_alt = pdf_load_colorspace(ctx, obj);
if (cs_alt->n != n)
{
fz_drop_colorspace(ctx, cs_alt);
@@ -77,7 +77,7 @@ free_separation(fz_context *ctx, fz_colorspace *cs)
}
static fz_colorspace *
-load_separation(fz_context *ctx, pdf_document *doc, pdf_obj *array)
+load_separation(fz_context *ctx, pdf_obj *array)
{
fz_colorspace *cs;
struct separation *sep = NULL;
@@ -99,11 +99,11 @@ load_separation(fz_context *ctx, pdf_document *doc, pdf_obj *array)
if (n > FZ_MAX_COLORS)
fz_throw(ctx, FZ_ERROR_SYNTAX, "too many components in colorspace");
- base = pdf_load_colorspace(ctx, doc, baseobj);
+ base = pdf_load_colorspace(ctx, baseobj);
fz_try(ctx)
{
- tint = pdf_load_function(ctx, doc, tintobj, n, base->n);
+ tint = pdf_load_function(ctx, tintobj, n, base->n);
/* RJW: fz_drop_colorspace(ctx, base);
* "cannot load tint function (%d 0 R)", pdf_to_num(ctx, tintobj) */
@@ -134,7 +134,7 @@ pdf_is_tint_colorspace(fz_context *ctx, fz_colorspace *cs)
/* Indexed */
static fz_colorspace *
-load_indexed(fz_context *ctx, pdf_document *doc, pdf_obj *array)
+load_indexed(fz_context *ctx, pdf_obj *array)
{
pdf_obj *baseobj = pdf_array_get(ctx, array, 1);
pdf_obj *highobj = pdf_array_get(ctx, array, 2);
@@ -149,7 +149,7 @@ load_indexed(fz_context *ctx, pdf_document *doc, pdf_obj *array)
fz_try(ctx)
{
- base = pdf_load_colorspace(ctx, doc, baseobj);
+ base = pdf_load_colorspace(ctx, baseobj);
high = pdf_to_int(ctx, highobj);
high = fz_clampi(high, 0, 255);
@@ -204,7 +204,7 @@ load_indexed(fz_context *ctx, pdf_document *doc, pdf_obj *array)
/* Parse and create colorspace from PDF object */
static fz_colorspace *
-pdf_load_colorspace_imp(fz_context *ctx, pdf_document *doc, pdf_obj *obj)
+pdf_load_colorspace_imp(fz_context *ctx, pdf_obj *obj)
{
if (pdf_obj_marked(ctx, obj))
fz_throw(ctx, FZ_ERROR_SYNTAX, "recursion in colorspace definition");
@@ -264,18 +264,18 @@ pdf_load_colorspace_imp(fz_context *ctx, pdf_document *doc, pdf_obj *obj)
if (pdf_mark_obj(ctx, obj))
fz_throw(ctx, FZ_ERROR_SYNTAX, "recursive colorspace");
if (pdf_name_eq(ctx, name, PDF_NAME_ICCBased))
- cs = load_icc_based(ctx, doc, pdf_array_get(ctx, obj, 1));
+ cs = load_icc_based(ctx, pdf_array_get(ctx, obj, 1));
else if (pdf_name_eq(ctx, name, PDF_NAME_Indexed))
- cs = load_indexed(ctx, doc, obj);
+ cs = load_indexed(ctx, obj);
else if (pdf_name_eq(ctx, name, PDF_NAME_I))
- cs = load_indexed(ctx, doc, obj);
+ cs = load_indexed(ctx, obj);
else if (pdf_name_eq(ctx, name, PDF_NAME_Separation))
- cs = load_separation(ctx, doc, obj);
+ cs = load_separation(ctx, obj);
else if (pdf_name_eq(ctx, name, PDF_NAME_DeviceN))
- cs = load_separation(ctx, doc, obj);
+ cs = load_separation(ctx, obj);
else if (pdf_name_eq(ctx, name, PDF_NAME_Pattern))
{
pdf_obj *pobj;
@@ -287,7 +287,7 @@ pdf_load_colorspace_imp(fz_context *ctx, pdf_document *doc, pdf_obj *obj)
break;
}
- cs = pdf_load_colorspace(ctx, doc, pobj);
+ cs = pdf_load_colorspace(ctx, pobj);
}
else
fz_throw(ctx, FZ_ERROR_SYNTAX, "unknown colorspace %s", pdf_to_name(ctx, name));
@@ -309,7 +309,7 @@ pdf_load_colorspace_imp(fz_context *ctx, pdf_document *doc, pdf_obj *obj)
}
fz_colorspace *
-pdf_load_colorspace(fz_context *ctx, pdf_document *doc, pdf_obj *obj)
+pdf_load_colorspace(fz_context *ctx, pdf_obj *obj)
{
fz_colorspace *cs;
@@ -318,7 +318,7 @@ pdf_load_colorspace(fz_context *ctx, pdf_document *doc, pdf_obj *obj)
return cs;
}
- cs = pdf_load_colorspace_imp(ctx, doc, obj);
+ cs = pdf_load_colorspace_imp(ctx, obj);
pdf_store_item(ctx, obj, cs, cs->size);
diff --git a/source/pdf/pdf-function.c b/source/pdf/pdf-function.c
index b0c4a6ed..9577dccc 100644
--- a/source/pdf/pdf-function.c
+++ b/source/pdf/pdf-function.c
@@ -864,7 +864,7 @@ parse_code(fz_context *ctx, pdf_function *func, fz_stream *stream, int *codeptr,
}
static void
-load_postscript_func(fz_context *ctx, pdf_document *doc, pdf_function *func, pdf_obj *dict)
+load_postscript_func(fz_context *ctx, pdf_function *func, pdf_obj *dict)
{
fz_stream *stream = NULL;
int codeptr;
@@ -937,7 +937,7 @@ eval_postscript_func(fz_context *ctx, pdf_function *func, const float *in, float
#define MAX_SAMPLE_FUNCTION_SIZE (100 << 20)
static void
-load_sample_func(fz_context *ctx, pdf_document *doc, pdf_function *func, pdf_obj *dict)
+load_sample_func(fz_context *ctx, pdf_function *func, pdf_obj *dict)
{
fz_stream *stream;
pdf_obj *obj;
@@ -1145,7 +1145,7 @@ eval_sample_func(fz_context *ctx, pdf_function *func, const float *in, float *ou
*/
static void
-load_exponential_func(fz_context *ctx, pdf_document *doc, pdf_function *func, pdf_obj *dict)
+load_exponential_func(fz_context *ctx, pdf_function *func, pdf_obj *dict)
{
pdf_obj *obj;
int i;
@@ -1230,7 +1230,7 @@ eval_exponential_func(fz_context *ctx, pdf_function *func, float in, float *out)
*/
static void
-load_stitching_func(fz_context *ctx, pdf_document *doc, pdf_function *func, pdf_obj *dict)
+load_stitching_func(fz_context *ctx, pdf_function *func, pdf_obj *dict)
{
pdf_function **funcs;
pdf_obj *obj;
@@ -1263,7 +1263,7 @@ load_stitching_func(fz_context *ctx, pdf_document *doc, pdf_function *func, pdf_
for (i = 0; i < k; i++)
{
sub = pdf_array_get(ctx, obj, i);
- funcs[i] = pdf_load_function(ctx, doc, sub, 1, func->n);
+ funcs[i] = pdf_load_function(ctx, sub, 1, func->n);
func->size += pdf_function_size(ctx, funcs[i]);
func->u.st.k ++;
@@ -1442,7 +1442,7 @@ pdf_eval_function(fz_context *ctx, pdf_function *func, const float *in, int inle
}
pdf_function *
-pdf_load_function(fz_context *ctx, pdf_document *doc, pdf_obj *dict, int in, int out)
+pdf_load_function(fz_context *ctx, pdf_obj *dict, int in, int out)
{
pdf_function *func;
pdf_obj *obj;
@@ -1498,19 +1498,19 @@ pdf_load_function(fz_context *ctx, pdf_document *doc, pdf_obj *dict, int in, int
switch (func->type)
{
case SAMPLE:
- load_sample_func(ctx, doc, func, dict);
+ load_sample_func(ctx, func, dict);
break;
case EXPONENTIAL:
- load_exponential_func(ctx, doc, func, dict);
+ load_exponential_func(ctx, func, dict);
break;
case STITCHING:
- load_stitching_func(ctx, doc, func, dict);
+ load_stitching_func(ctx, func, dict);
break;
case POSTSCRIPT:
- load_postscript_func(ctx, doc, func, dict);
+ load_postscript_func(ctx, func, dict);
break;
default:
diff --git a/source/pdf/pdf-image.c b/source/pdf/pdf-image.c
index 524284e8..b19f1e39 100644
--- a/source/pdf/pdf-image.c
+++ b/source/pdf/pdf-image.c
@@ -99,7 +99,7 @@ pdf_load_image_imp(fz_context *ctx, pdf_document *doc, pdf_obj *rdb, pdf_obj *di
obj = res;
}
- colorspace = pdf_load_colorspace(ctx, doc, obj);
+ colorspace = pdf_load_colorspace(ctx, obj);
indexed = fz_colorspace_is_indexed(ctx, colorspace);
n = fz_colorspace_n(ctx, colorspace);
@@ -233,7 +233,7 @@ pdf_load_jpx(fz_context *ctx, pdf_document *doc, pdf_obj *dict, int forcemask)
obj = pdf_dict_get(ctx, dict, PDF_NAME_ColorSpace);
if (obj)
- colorspace = pdf_load_colorspace(ctx, doc, obj);
+ colorspace = pdf_load_colorspace(ctx, obj);
len = fz_buffer_storage(ctx, buf, &data);
pix = fz_load_jpx(ctx, data, len, colorspace);
diff --git a/source/pdf/pdf-interpret.c b/source/pdf/pdf-interpret.c
index 577bd818..f98326e6 100644
--- a/source/pdf/pdf-interpret.c
+++ b/source/pdf/pdf-interpret.c
@@ -393,7 +393,7 @@ pdf_process_CS(fz_context *ctx, pdf_processor *proc, pdf_csi *csi, int stroke)
csobj = pdf_dict_gets(ctx, csres, csi->name);
if (!csobj)
fz_throw(ctx, FZ_ERROR_SYNTAX, "cannot find ColorSpace resource '%s'", csi->name);
- cs = pdf_load_colorspace(ctx, csi->doc, csobj);
+ cs = pdf_load_colorspace(ctx, csobj);
}
fz_try(ctx)
diff --git a/source/pdf/pdf-shade.c b/source/pdf/pdf-shade.c
index cc665fc7..3cf3db52 100644
--- a/source/pdf/pdf-shade.c
+++ b/source/pdf/pdf-shade.c
@@ -333,7 +333,7 @@ pdf_load_shading_dict(fz_context *ctx, pdf_document *doc, pdf_obj *dict, const f
obj = pdf_dict_get(ctx, dict, PDF_NAME_ColorSpace);
if (!obj)
fz_throw(ctx, FZ_ERROR_SYNTAX, "shading colorspace is missing");
- shade->colorspace = pdf_load_colorspace(ctx, doc, obj);
+ shade->colorspace = pdf_load_colorspace(ctx, obj);
n = fz_colorspace_n(ctx, shade->colorspace);
obj = pdf_dict_get(ctx, dict, PDF_NAME_Background);
@@ -359,7 +359,7 @@ pdf_load_shading_dict(fz_context *ctx, pdf_document *doc, pdf_obj *dict, const f
in = 1;
out = n;
- func[0] = pdf_load_function(ctx, doc, obj, in, out);
+ func[0] = pdf_load_function(ctx, obj, in, out);
if (!func[0])
fz_throw(ctx, FZ_ERROR_SYNTAX, "cannot load shading function (%d 0 R)", pdf_to_num(ctx, obj));
}
@@ -385,7 +385,7 @@ pdf_load_shading_dict(fz_context *ctx, pdf_document *doc, pdf_obj *dict, const f
for (i = 0; i < funcs; i++)
{
- func[i] = pdf_load_function(ctx, doc, pdf_array_get(ctx, obj, i), in, out);
+ func[i] = pdf_load_function(ctx, pdf_array_get(ctx, obj, i), in, out);
if (!func[i])
fz_throw(ctx, FZ_ERROR_SYNTAX, "cannot load shading function (%d 0 R)", pdf_to_num(ctx, obj));
}
diff --git a/source/pdf/pdf-xobject.c b/source/pdf/pdf-xobject.c
index 34d8edd8..c7b03a4e 100644
--- a/source/pdf/pdf-xobject.c
+++ b/source/pdf/pdf-xobject.c
@@ -83,7 +83,7 @@ pdf_xobject_colorspace(fz_context *ctx, pdf_xobject *xobj)
{
fz_colorspace *colorspace = NULL;
fz_try(ctx)
- colorspace = pdf_load_colorspace(ctx, pdf_get_bound_document(ctx, xobj->obj), cs);
+ colorspace = pdf_load_colorspace(ctx, cs);
fz_catch(ctx)
fz_warn(ctx, "cannot load xobject colorspace");
return colorspace;