diff options
Diffstat (limited to 'pdf/pdf_xobject.c')
-rw-r--r-- | pdf/pdf_xobject.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/pdf/pdf_xobject.c b/pdf/pdf_xobject.c index 91bf4db3..ffa86184 100644 --- a/pdf/pdf_xobject.c +++ b/pdf/pdf_xobject.c @@ -1,5 +1,5 @@ -#include "fitz.h" -#include "mupdf.h" +#include "fitz-internal.h" +#include "mupdf-internal.h" pdf_xobject * pdf_keep_xobject(fz_context *ctx, pdf_xobject *xobj) @@ -21,10 +21,10 @@ pdf_free_xobject_imp(fz_context *ctx, fz_storable *xobj_) if (xobj->colorspace) fz_drop_colorspace(ctx, xobj->colorspace); if (xobj->resources) - fz_drop_obj(xobj->resources); + pdf_drop_obj(xobj->resources); if (xobj->contents) fz_drop_buffer(ctx, xobj->contents); - fz_drop_obj(xobj->me); + pdf_drop_obj(xobj->me); fz_free(ctx, xobj); } @@ -37,13 +37,13 @@ pdf_xobject_size(pdf_xobject *xobj) } pdf_xobject * -pdf_load_xobject(pdf_document *xref, fz_obj *dict) +pdf_load_xobject(pdf_document *xref, pdf_obj *dict) { pdf_xobject *form; - fz_obj *obj; + pdf_obj *obj; fz_context *ctx = xref->ctx; - if ((form = fz_find_item(ctx, pdf_free_xobject_imp, dict))) + if ((form = pdf_find_item(ctx, pdf_free_xobject_imp, dict))) { return form; } @@ -56,12 +56,12 @@ pdf_load_xobject(pdf_document *xref, fz_obj *dict) form->me = NULL; /* Store item immediately, to avoid possible recursion if objects refer back to this one */ - fz_store_item(ctx, dict, form, pdf_xobject_size(form)); + pdf_store_item(ctx, dict, form, pdf_xobject_size(form)); - obj = fz_dict_gets(dict, "BBox"); + obj = pdf_dict_gets(dict, "BBox"); form->bbox = pdf_to_rect(ctx, obj); - obj = fz_dict_gets(dict, "Matrix"); + obj = pdf_dict_gets(dict, "Matrix"); if (obj) form->matrix = pdf_to_matrix(ctx, obj); else @@ -71,19 +71,19 @@ pdf_load_xobject(pdf_document *xref, fz_obj *dict) form->knockout = 0; form->transparency = 0; - obj = fz_dict_gets(dict, "Group"); + obj = pdf_dict_gets(dict, "Group"); if (obj) { - fz_obj *attrs = obj; + pdf_obj *attrs = obj; - form->isolated = fz_to_bool(fz_dict_gets(attrs, "I")); - form->knockout = fz_to_bool(fz_dict_gets(attrs, "K")); + form->isolated = pdf_to_bool(pdf_dict_gets(attrs, "I")); + form->knockout = pdf_to_bool(pdf_dict_gets(attrs, "K")); - obj = fz_dict_gets(attrs, "S"); - if (fz_is_name(obj) && !strcmp(fz_to_name(obj), "Transparency")) + obj = pdf_dict_gets(attrs, "S"); + if (pdf_is_name(obj) && !strcmp(pdf_to_name(obj), "Transparency")) form->transparency = 1; - obj = fz_dict_gets(attrs, "CS"); + obj = pdf_dict_gets(attrs, "CS"); if (obj) { form->colorspace = pdf_load_colorspace(xref, obj); @@ -92,21 +92,21 @@ pdf_load_xobject(pdf_document *xref, fz_obj *dict) } } - form->resources = fz_dict_gets(dict, "Resources"); + form->resources = pdf_dict_gets(dict, "Resources"); if (form->resources) - fz_keep_obj(form->resources); + pdf_keep_obj(form->resources); fz_try(ctx) { - form->contents = pdf_load_stream(xref, fz_to_num(dict), fz_to_gen(dict)); + form->contents = pdf_load_stream(xref, pdf_to_num(dict), pdf_to_gen(dict)); } fz_catch(ctx) { - fz_remove_item(ctx, pdf_free_xobject_imp, dict); + pdf_remove_item(ctx, pdf_free_xobject_imp, dict); pdf_drop_xobject(ctx, form); - fz_throw(ctx, "cannot load xobject content stream (%d %d R)", fz_to_num(dict), fz_to_gen(dict)); + fz_throw(ctx, "cannot load xobject content stream (%d %d R)", pdf_to_num(dict), pdf_to_gen(dict)); } - form->me = fz_keep_obj(dict); + form->me = pdf_keep_obj(dict); return form; } |