From f653eac3bac807f13ecba3e8463c4de3689da090 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 16 Jun 2016 00:14:47 +0100 Subject: Improve banding API. Previously the API assumed that all bands had to be the same height. By moving the multiplication into the caller, we can lift that assumption. --- source/fitz/output-png.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/fitz/output-png.c') diff --git a/source/fitz/output-png.c b/source/fitz/output-png.c index 74f2ca3f..00eaeee8 100644 --- a/source/fitz/output-png.c +++ b/source/fitz/output-png.c @@ -130,7 +130,7 @@ fz_write_png_header(fz_context *ctx, fz_output *out, int w, int h, int n, int al } void -fz_write_png_band(fz_context *ctx, fz_output *out, fz_png_output_context *poc, int stride, int band, int bandheight, unsigned char *sp) +fz_write_png_band(fz_context *ctx, fz_output *out, fz_png_output_context *poc, int stride, int band_start, int bandheight, unsigned char *sp) { unsigned char *dp; int y, x, k, err, finalband; @@ -144,10 +144,9 @@ fz_write_png_band(fz_context *ctx, fz_output *out, fz_png_output_context *poc, i n = poc->n; alpha = poc->alpha; - band *= bandheight; - finalband = (band+bandheight >= h); + finalband = (band_start+bandheight >= h); if (finalband) - bandheight = h - band; + bandheight = h - band_start; if (poc->udata == NULL) { -- cgit v1.2.3