void
pdf_store_item (
fz_context *ctx,
pdf_obj *key,
void *val,
size_t itemsize
)
void *
pdf_find_item (
fz_context *ctx,
fz_store_drop_fn *drop,
pdf_obj *key
)
void
pdf_remove_item (
fz_context *ctx,
fz_store_drop_fn *drop,
pdf_obj *key
)
void
pdf_empty_store (
fz_context *ctx,
pdf_document *doc
)
void
pdf_purge_locals_from_store (
fz_context *ctx,
pdf_document *doc
)
void
pdf_purge_object_from_store (
fz_context *ctx,
pdf_document *doc,
int num
)
int
pdf_pattern_uses_blending (
fz_context *ctx,
pdf_obj *dict,
pdf_cycle_list *cycle_up
)
enum pdf_font_resource_type
{
PDF_SIMPLE_FONT_RESOURCE = 1,
PDF_CID_FONT_RESOURCE = 2,
PDF_CJK_FONT_RESOURCE = 3
}
Structures used for managing resource locations and avoiding multiple occurrences when resources are added to the document. The search for existing resources will be performed when we are first trying to add an item. Object refs are stored in a fz_hash_table structure using a hash of the md5 sum of the data, enabling rapid lookup.
enum pdf_simple_font_encoding
{
PDF_SIMPLE_ENCODING_LATIN,
PDF_SIMPLE_ENCODING_GREEK,
PDF_SIMPLE_ENCODING_CYRILLIC
}
struct pdf_font_resource_key
{
unsigned char digest[16];
int type;
int encoding;
int local_xref;
}
The contents of this structure are defined publicly just so we can define this on the stack.
struct pdf_colorspace_resource_key
{
unsigned char digest[16];
int local_xref;
}
struct pdf_image_resource_key
{
int w, h;
int decode;
unsigned int bpc : 3;
unsigned int n : 6;
unsigned int imagemask : 1;
unsigned int use_colorkey : 1;
unsigned int use_decode : 1;
unsigned int local_xref : 1;
unsigned char mask[16];
unsigned char digest[16];
}
pdf_obj *
pdf_find_font_resource (
fz_context *ctx,
pdf_document *doc,
int type,
int encoding,
fz_font *item,
pdf_font_resource_key *key
)
pdf_obj *
pdf_insert_font_resource (
fz_context *ctx,
pdf_document *doc,
pdf_font_resource_key *key,
pdf_obj *obj
)
pdf_obj *
pdf_find_colorspace_resource (
fz_context *ctx,
pdf_document *doc,
fz_colorspace *item,
pdf_colorspace_resource_key *key
)
pdf_obj *
pdf_insert_colorspace_resource (
fz_context *ctx,
pdf_document *doc,
pdf_colorspace_resource_key *key,
pdf_obj *obj
)
pdf_obj *
pdf_find_image_resource (
fz_context *ctx,
pdf_document *doc,
fz_image *item,
pdf_image_resource_key *key
)
pdf_obj *
pdf_insert_image_resource (
fz_context *ctx,
pdf_document *doc,
pdf_image_resource_key *key,
pdf_obj *obj
)
void
pdf_drop_resource_tables (
fz_context *ctx,
pdf_document *doc
)
void
pdf_purge_local_resources (
fz_context *ctx,
pdf_document *doc
)
typedef struct pdf_function pdf_function
void
pdf_eval_function (
fz_context *ctx,
pdf_function *func,
const float *in,
int inlen,
float *out,
int outlen
)
pdf_function *
pdf_keep_function (
fz_context *ctx,
pdf_function *func
)
void
pdf_drop_function (
fz_context *ctx,
pdf_function *func
)
size_t
pdf_function_size (
fz_context *ctx,
pdf_function *func
)
pdf_function *
pdf_load_function (
fz_context *ctx,
pdf_obj *ref,
int in,
int out
)
fz_colorspace *
pdf_document_output_intent (
fz_context *ctx,
pdf_document *doc
)
fz_colorspace *
pdf_load_colorspace (
fz_context *ctx,
pdf_obj *obj
)
int
pdf_is_tint_colorspace (
fz_context *ctx,
fz_colorspace *cs
)
fz_shade *
pdf_load_shading (
fz_context *ctx,
pdf_document *doc,
pdf_obj *obj
)
void
pdf_sample_shade_function (
fz_context *ctx,
float *samples,
int n,
int funcs,
pdf_function **func,
float t0,
float t1
)
int
pdf_guess_colorspace_components (
fz_context *ctx,
pdf_obj *obj
)
typedef void (pdf_recolor_vertex)(fz_context *ctx, void *opaque, fz_colorspace *dst_cs, float *d, fz_colorspace *src_cs, const float *src)
Function to recolor a single color from a shade.
typedef pdf_recolor_vertex *(pdf_shade_recolorer)(fz_context *ctx, void *opaque, fz_colorspace *src_cs, fz_colorspace **dst_cs)
Function to handle recoloring a shade.
Called with src_cs from the shade. If no recoloring is required, return NULL. Otherwise fill in *dst_cs, and return a vertex recolorer.
pdf_obj *
pdf_recolor_shade (
fz_context *ctx,
pdf_obj *shade,
pdf_shade_recolorer *reshade,
void *opaque
)
Recolor a shade.
fz_image *
pdf_load_inline_image (
fz_context *ctx,
pdf_document *doc,
pdf_resource_stack *rdb,
pdf_obj *dict,
fz_stream *file
)
int
pdf_is_jpx_image (
fz_context *ctx,
pdf_obj *dict
)
fz_image *
pdf_load_image (
fz_context *ctx,
pdf_document *doc,
pdf_obj *obj
)
pdf_obj *
pdf_add_image (
fz_context *ctx,
pdf_document *doc,
fz_image *image
)
pdf_obj *
pdf_add_colorspace (
fz_context *ctx,
pdf_document *doc,
fz_colorspace *cs
)
struct pdf_pattern
{
fz_storable storable;
int ismask;
float xstep;
float ystep;
fz_matrix matrix;
fz_rect bbox;
pdf_document *document;
pdf_obj *resources;
pdf_obj *contents;
int id; /* unique ID for caching rendered tiles */
int uses_blending;
}
pdf_pattern *
pdf_load_pattern (
fz_context *ctx,
pdf_document *doc,
pdf_obj *obj
)
pdf_pattern *
pdf_keep_pattern (
fz_context *ctx,
pdf_pattern *pat
)
void
pdf_drop_pattern (
fz_context *ctx,
pdf_pattern *pat
)
pdf_obj *
pdf_new_xobject (
fz_context *ctx,
pdf_document *doc,
fz_rect bbox,
fz_matrix matrix,
pdf_obj *res,
fz_buffer *buffer
)
void
pdf_update_xobject (
fz_context *ctx,
pdf_document *doc,
pdf_obj *xobj,
fz_rect bbox,
fz_matrix mat,
pdf_obj *res,
fz_buffer *buffer
)
pdf_obj *
pdf_xobject_resources (
fz_context *ctx,
pdf_obj *xobj
)
fz_rect
pdf_xobject_bbox (
fz_context *ctx,
pdf_obj *xobj
)
fz_matrix
pdf_xobject_matrix (
fz_context *ctx,
pdf_obj *xobj
)
int
pdf_xobject_isolated (
fz_context *ctx,
pdf_obj *xobj
)
int
pdf_xobject_knockout (
fz_context *ctx,
pdf_obj *xobj
)
int
pdf_xobject_transparency (
fz_context *ctx,
pdf_obj *xobj
)
fz_colorspace *
pdf_xobject_colorspace (
fz_context *ctx,
pdf_obj *xobj
)