summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-11-11 16:30:59 +0000
committerRobin Watts <robin.watts@artifex.com>2016-11-14 16:09:40 +0000
commit7703ad8b2564f2f3a99b85eca5af276d7ba0e3e4 (patch)
treeabda358d9d039ba76d570a34b7c16d4b79a33724 /source/fitz
parent37f95f87bdfb2e0b01d649afae5fffe60bf99d3a (diff)
downloadmupdf-7703ad8b2564f2f3a99b85eca5af276d7ba0e3e4.tar.xz
More API tweaks.
Move internal functions from public to private headers.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/context.c2
-rw-r--r--source/fitz/device.c2
-rw-r--r--source/fitz/draw-device.c3
-rw-r--r--source/fitz/draw-glyph.c1
-rw-r--r--source/fitz/fitz-imp.h78
-rw-r--r--source/fitz/glyph-cache-imp.h25
-rw-r--r--source/fitz/halftone.c2
-rw-r--r--source/fitz/pool.c14
-rw-r--r--source/fitz/svg-device.c1
9 files changed, 124 insertions, 4 deletions
diff --git a/source/fitz/context.c b/source/fitz/context.c
index 808f53ce..3e79bbea 100644
--- a/source/fitz/context.c
+++ b/source/fitz/context.c
@@ -1,4 +1,4 @@
-#include "mupdf/fitz.h"
+#include "fitz-imp.h"
struct fz_id_context_s
{
diff --git a/source/fitz/device.c b/source/fitz/device.c
index 88b658a3..727000e8 100644
--- a/source/fitz/device.c
+++ b/source/fitz/device.c
@@ -1,4 +1,4 @@
-#include "mupdf/fitz.h"
+#include "fitz-imp.h"
void *
fz_new_device(fz_context *ctx, int size)
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c
index d6d8c38e..28e64839 100644
--- a/source/fitz/draw-device.c
+++ b/source/fitz/draw-device.c
@@ -1,4 +1,5 @@
-#include "mupdf/fitz.h"
+#include "fitz-imp.h"
+#include "glyph-cache-imp.h"
#include "draw-imp.h"
#define STACK_SIZE 96
diff --git a/source/fitz/draw-glyph.c b/source/fitz/draw-glyph.c
index 1eb89093..b3d4cb4c 100644
--- a/source/fitz/draw-glyph.c
+++ b/source/fitz/draw-glyph.c
@@ -1,5 +1,6 @@
#include "mupdf/fitz.h"
#include "draw-imp.h"
+#include "glyph-cache-imp.h"
#define MAX_GLYPH_SIZE 256
#define MAX_CACHE_SIZE (1024*1024)
diff --git a/source/fitz/fitz-imp.h b/source/fitz/fitz-imp.h
index 9441aa9c..169f422e 100644
--- a/source/fitz/fitz-imp.h
+++ b/source/fitz/fitz-imp.h
@@ -12,4 +12,82 @@ struct fz_buffer_s
int shared;
};
+void fz_new_colorspace_context(fz_context *ctx);
+fz_colorspace_context *fz_keep_colorspace_context(fz_context *ctx);
+void fz_drop_colorspace_context(fz_context *ctx);
+
+struct fz_device_container_stack_s
+{
+ fz_rect scissor;
+ int flags;
+ int user;
+};
+
+enum
+{
+ fz_device_container_stack_is_clip_path = 1,
+ fz_device_container_stack_is_clip_stroke_path = 2,
+ fz_device_container_stack_is_clip_text = 4,
+ fz_device_container_stack_is_clip_stroke_text = 8,
+ fz_device_container_stack_is_clip_image_mask = 16,
+ fz_device_container_stack_in_mask = 32,
+ fz_device_container_stack_is_mask = 64,
+ fz_device_container_stack_is_group = 128,
+};
+
+/*
+ fz_new_font_context: Initialise the font context.
+
+ For internal use only.
+*/
+void fz_new_font_context(fz_context *ctx);
+
+/*
+ fz_keep_font_context: Increment the ref count for
+ the current font context.
+
+ For internal use only.
+*/
+fz_font_context *fz_keep_font_context(fz_context *ctx);
+
+/*
+ fz_drop_font_context: Drop the ref count for the
+ current font context.
+
+ For internal use only.
+*/
+void fz_drop_font_context(fz_context *ctx);
+
+/* Tuning context implementation details */
+struct fz_tuning_context_s
+{
+ int refs;
+ fz_tune_image_decode_fn *image_decode;
+ void *image_decode_arg;
+ fz_tune_image_scale_fn *image_scale;
+ void *image_scale_arg;
+};
+
+fz_tune_image_decode_fn fz_default_image_decode;
+fz_tune_image_scale_fn fz_default_image_scale;
+
+fz_context *fz_clone_context_internal(fz_context *ctx);
+
+void fz_new_aa_context(fz_context *ctx);
+void fz_drop_aa_context(fz_context *ctx);
+void fz_copy_aa_context(fz_context *dst, fz_context *src);
+
+void fz_new_glyph_cache_context(fz_context *ctx);
+fz_glyph_cache *fz_keep_glyph_cache(fz_context *ctx);
+void fz_drop_glyph_cache_context(fz_context *ctx);
+
+void fz_new_document_handler_context(fz_context *ctx);
+void fz_drop_document_handler_context(fz_context *ctx);
+fz_document_handler_context *fz_keep_document_handler_context(fz_context *ctx);
+
+void fz_new_output_context(fz_context *ctx);
+void fz_drop_output_context(fz_context *ctx);
+fz_output_context *fz_keep_output_context(fz_context *ctx);
+
+
#endif
diff --git a/source/fitz/glyph-cache-imp.h b/source/fitz/glyph-cache-imp.h
new file mode 100644
index 00000000..e5af15ea
--- /dev/null
+++ b/source/fitz/glyph-cache-imp.h
@@ -0,0 +1,25 @@
+#ifndef MUPDF_FITZ_GLYPH_CACHE_IMP_H
+#define MUPDF_FITZ_GLYPH_CACHE_IMP_H
+
+#include "mupdf/fitz/system.h"
+#include "mupdf/fitz/context.h"
+#include "mupdf/fitz/math.h"
+#include "mupdf/fitz/font.h"
+#include "mupdf/fitz/path.h"
+#include "mupdf/fitz/pixmap.h"
+#include "mupdf/fitz/device.h"
+#include "mupdf/fitz/glyph-cache.h"
+
+fz_path *fz_outline_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *ctm);
+fz_path *fz_outline_ft_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm);
+fz_glyph *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa);
+fz_pixmap *fz_render_ft_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, int aa);
+fz_glyph *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor);
+fz_pixmap *fz_render_t3_glyph_pixmap(fz_context *ctx, fz_font *font, int cid, const fz_matrix *trm, fz_colorspace *model, const fz_irect *scissor);
+fz_glyph *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state);
+fz_pixmap *fz_render_ft_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, const fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *state);
+fz_glyph *fz_render_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, fz_colorspace *model, const fz_irect *scissor, int alpha);
+fz_glyph *fz_render_stroked_glyph(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_matrix *, const fz_stroke_state *stroke, const fz_irect *scissor);
+fz_pixmap *fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font*, int, fz_matrix *, const fz_matrix *, const fz_stroke_state *stroke, const fz_irect *scissor);
+
+#endif
diff --git a/source/fitz/halftone.c b/source/fitz/halftone.c
index 1a4da0f0..910c2059 100644
--- a/source/fitz/halftone.c
+++ b/source/fitz/halftone.c
@@ -1,4 +1,4 @@
-#include "mupdf/fitz.h"
+#include "fitz-imp.h"
struct fz_halftone_s
{
diff --git a/source/fitz/pool.c b/source/fitz/pool.c
index 90c405dc..59e4a0f2 100644
--- a/source/fitz/pool.c
+++ b/source/fitz/pool.c
@@ -1,5 +1,19 @@
#include "mupdf/fitz.h"
+typedef struct fz_pool_node_s fz_pool_node;
+
+struct fz_pool_s
+{
+ fz_pool_node *head, *tail;
+ char *pos, *end;
+};
+
+struct fz_pool_node_s
+{
+ fz_pool_node *next;
+ char mem[64 << 10]; /* 64k blocks */
+};
+
fz_pool *fz_new_pool(fz_context *ctx)
{
fz_pool *pool = fz_malloc_struct(ctx, fz_pool);
diff --git a/source/fitz/svg-device.c b/source/fitz/svg-device.c
index 5d05d808..16542a7a 100644
--- a/source/fitz/svg-device.c
+++ b/source/fitz/svg-device.c
@@ -1,4 +1,5 @@
#include "fitz-imp.h"
+#include "glyph-cache-imp.h"
typedef struct svg_device_s svg_device;