summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2017-03-23 21:36:57 -0400
committerRobin Watts <Robin.Watts@artifex.com>2017-03-23 21:39:07 -0400
commitea75724276f1efabd5d78595af0d3d35f7cde659 (patch)
tree5d4ebd5169ba4154109463f7e9bfcf7462737fd6 /source/fitz
parent6979982ba2900f451c801d35bb7e52413a89d26e (diff)
downloadmupdf-ea75724276f1efabd5d78595af0d3d35f7cde659.tar.xz
Introduce fz_new_derived_...
Instead of having fz_new_XXXX(ctx, type, ...) macros that call fz_new_XXXX_of_size etc, use fz_new_derived_... Clearer naming, and doesn't clash with fz_new_document_writer.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/image.c6
-rw-r--r--source/fitz/output-cbz.c4
-rw-r--r--source/fitz/output-svg.c2
-rw-r--r--source/fitz/writer.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/source/fitz/image.c b/source/fitz/image.c
index a1d392d9..72855395 100644
--- a/source/fitz/image.c
+++ b/source/fitz/image.c
@@ -734,7 +734,7 @@ fz_new_image_from_pixmap(fz_context *ctx, fz_pixmap *pixmap, fz_image *mask)
{
fz_pixmap_image *image;
- image = fz_new_image(ctx, pixmap->w, pixmap->h, 8, pixmap->colorspace,
+ image = fz_new_derived_image(ctx, pixmap->w, pixmap->h, 8, pixmap->colorspace,
pixmap->xres, pixmap->yres, 0, 0,
NULL, NULL, mask, fz_pixmap_image,
pixmap_image_get_pixmap,
@@ -823,7 +823,7 @@ fz_new_image_from_compressed_buffer(fz_context *ctx, int w, int h,
fz_try(ctx)
{
- image = fz_new_image(ctx, w, h, bpc,
+ image = fz_new_derived_image(ctx, w, h, bpc,
colorspace, xres, yres,
interpolate, imagemask, decode,
colorkey, mask, fz_compressed_image,
@@ -1102,7 +1102,7 @@ fz_image *fz_new_image_from_display_list(fz_context *ctx, float w, float h, fz_d
iw = w * SCALABLE_IMAGE_DPI / 72;
ih = h * SCALABLE_IMAGE_DPI / 72;
- image = fz_new_image(ctx, iw, ih, 8, fz_device_rgb(ctx),
+ image = fz_new_derived_image(ctx, iw, ih, 8, fz_device_rgb(ctx),
SCALABLE_IMAGE_DPI, SCALABLE_IMAGE_DPI, 0, 0,
NULL, NULL, NULL, fz_display_list_image,
display_list_image_get_pixmap,
diff --git a/source/fitz/output-cbz.c b/source/fitz/output-cbz.c
index 73cc1195..0e0a0195 100644
--- a/source/fitz/output-cbz.c
+++ b/source/fitz/output-cbz.c
@@ -66,7 +66,7 @@ cbz_drop_writer(fz_context *ctx, fz_document_writer *wri_)
fz_document_writer *
fz_new_cbz_writer(fz_context *ctx, const char *path, const char *options)
{
- fz_cbz_writer *wri = fz_new_writer(ctx, fz_cbz_writer, cbz_begin_page, cbz_end_page, cbz_close_writer, cbz_drop_writer);
+ fz_cbz_writer *wri = fz_new_derived_document_writer(ctx, fz_cbz_writer, cbz_begin_page, cbz_end_page, cbz_close_writer, cbz_drop_writer);
fz_try(ctx)
{
@@ -133,7 +133,7 @@ fz_new_pixmap_writer(fz_context *ctx, const char *path, const char *options,
const char *default_path, int n,
void (*save)(fz_context *ctx, fz_pixmap *pix, const char *filename))
{
- fz_pixmap_writer *wri = fz_new_writer(ctx, fz_pixmap_writer, pixmap_begin_page, pixmap_end_page, NULL, pixmap_drop_writer);
+ fz_pixmap_writer *wri = fz_new_derived_document_writer(ctx, fz_pixmap_writer, pixmap_begin_page, pixmap_end_page, NULL, pixmap_drop_writer);
fz_try(ctx)
{
diff --git a/source/fitz/output-svg.c b/source/fitz/output-svg.c
index 0758b843..174906a2 100644
--- a/source/fitz/output-svg.c
+++ b/source/fitz/output-svg.c
@@ -59,7 +59,7 @@ fz_document_writer *
fz_new_svg_writer(fz_context *ctx, const char *path, const char *args)
{
const char *val;
- fz_svg_writer *wri = fz_new_writer(ctx, fz_svg_writer, svg_begin_page, svg_end_page, NULL, svg_drop_writer);
+ fz_svg_writer *wri = fz_new_derived_document_writer(ctx, fz_svg_writer, svg_begin_page, svg_end_page, NULL, svg_drop_writer);
wri->text_format = FZ_SVG_TEXT_AS_PATH;
wri->reuse_images = 1;
diff --git a/source/fitz/writer.c b/source/fitz/writer.c
index c89ee4e0..f9d5b8c1 100644
--- a/source/fitz/writer.c
+++ b/source/fitz/writer.c
@@ -48,7 +48,7 @@ fz_option_eq(const char *a, const char *b)
return !strncmp(a, b, n) && (a[n] == ',' || a[n] == 0);
}
-fz_document_writer *fz_new_writer_of_size(fz_context *ctx, size_t size, fz_document_writer_begin_page_fn *begin_page,
+fz_document_writer *fz_new_document_writer_of_size(fz_context *ctx, size_t size, fz_document_writer_begin_page_fn *begin_page,
fz_document_writer_end_page_fn *end_page, fz_document_writer_close_writer_fn *close, fz_document_writer_drop_writer_fn *drop)
{
fz_document_writer *wri = Memento_label(fz_calloc(ctx, 1, size), "fz_document_writer");