summaryrefslogtreecommitdiff
path: root/source/fitz/output-png.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2017-03-09 12:41:57 -0600
committerRobin Watts <Robin.Watts@artifex.com>2017-03-11 10:16:56 -0600
commit49b6c0f132ec4624e50cd79660143624dd1fcd35 (patch)
tree9097dbd64ef08fd0fd409457107f8b92f5d91e93 /source/fitz/output-png.c
parent49242fd05eda83cdef704a33cc67fd542036d11f (diff)
downloadmupdf-49b6c0f132ec4624e50cd79660143624dd1fcd35.tar.xz
Simplify fz_band_writer API.
Remove needless parameter passing in fz_band_writer API. We always know the bandstart, so why make the caller keep track of it and pass it in? Similarly, we know when we hit the end of the page, so why require us to trigger the trailer writing manually?
Diffstat (limited to 'source/fitz/output-png.c')
-rw-r--r--source/fitz/output-png.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/fitz/output-png.c b/source/fitz/output-png.c
index 524e48bf..62be417b 100644
--- a/source/fitz/output-png.c
+++ b/source/fitz/output-png.c
@@ -33,9 +33,8 @@ fz_save_pixmap_as_png(fz_context *ctx, fz_pixmap *pixmap, const char *filename)
fz_try(ctx)
{
writer = fz_new_png_band_writer(ctx, out);
- fz_write_header(ctx, writer, pixmap->w, pixmap->h, pixmap->n, pixmap->alpha, pixmap->xres, pixmap->yres, 1);
- fz_write_band(ctx, writer, pixmap->stride, 0, pixmap->h, pixmap->samples);
- fz_write_trailer(ctx, writer);
+ fz_write_header(ctx, writer, pixmap->w, pixmap->h, pixmap->n, pixmap->alpha, pixmap->xres, pixmap->yres, 0);
+ fz_write_band(ctx, writer, pixmap->stride, pixmap->h, pixmap->samples);
}
fz_always(ctx)
{
@@ -60,9 +59,8 @@ fz_write_pixmap_as_png(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap)
fz_try(ctx)
{
- fz_write_header(ctx, writer, pixmap->w, pixmap->h, pixmap->n, pixmap->alpha, pixmap->xres, pixmap->yres, 1);
- fz_write_band(ctx, writer, pixmap->stride, 0, pixmap->h, pixmap->samples);
- fz_write_trailer(ctx, writer);
+ fz_write_header(ctx, writer, pixmap->w, pixmap->h, pixmap->n, pixmap->alpha, pixmap->xres, pixmap->yres, 0);
+ fz_write_band(ctx, writer, pixmap->stride, pixmap->h, pixmap->samples);
}
fz_always(ctx)
{