summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-06-28 15:01:39 +0100
committerRobin Watts <robin.watts@artifex.com>2016-06-28 15:15:42 +0100
commit5c41dcd3f3458f7e1562a9493b4cba0da83f4188 (patch)
tree3e94316bb611c43d04926b16e8af76397c2e14d3 /source/fitz
parent12aa6f724a04f1729513690a14d3a0bdc0725732 (diff)
downloadmupdf-5c41dcd3f3458f7e1562a9493b4cba0da83f4188.tar.xz
Fix inconsistency in band handling.
In an earlier commit, I changed some of the band writing functions to take the band starting offset, rather than the band number. This was done to accomodate the idea of rendering the page in bands of different heights. Sadly, it seems I didn't push this all the way through, and had different band writing functions still taking the band number. Fix all the band writing functions to be consistent.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/output-pcl.c7
-rw-r--r--source/fitz/output-ps.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/source/fitz/output-pcl.c b/source/fitz/output-pcl.c
index 6d0a24a6..c0858299 100644
--- a/source/fitz/output-pcl.c
+++ b/source/fitz/output-pcl.c
@@ -777,7 +777,7 @@ fz_color_pcl_output_context *fz_write_color_pcl_header(fz_context *ctx, fz_outpu
return pcoc;
}
-void fz_write_color_pcl_band(fz_context *ctx, fz_output *out, fz_color_pcl_output_context *pcoc, int w, int h, int n, int stride, int band, int bandheight, unsigned char *sp)
+void fz_write_color_pcl_band(fz_context *ctx, fz_output *out, fz_color_pcl_output_context *pcoc, int w, int h, int n, int stride, int band_start, int bandheight, unsigned char *sp)
{
int y, ss, ds, seed_valid, fill;
unsigned char *prev;
@@ -796,9 +796,8 @@ void fz_write_color_pcl_band(fz_context *ctx, fz_output *out, fz_color_pcl_outpu
comp = pcoc->compbuf;
seed_valid = pcoc->seed_valid;
- band *= bandheight;
- if (band+bandheight >= h)
- bandheight = h - band;
+ if (band_start+bandheight >= h)
+ bandheight = h - band_start;
y = 0;
while (y < bandheight)
diff --git a/source/fitz/output-ps.c b/source/fitz/output-ps.c
index 1c4f5103..d183adf6 100644
--- a/source/fitz/output-ps.c
+++ b/source/fitz/output-ps.c
@@ -153,16 +153,15 @@ void fz_save_pixmap_as_ps(fz_context *ctx, fz_pixmap *pixmap, char *filename, in
fz_rethrow(ctx);
}
-void fz_write_ps_band(fz_context *ctx, fz_output *out, fz_ps_output_context *psoc, int w, int h, int n, int stride, int band, int bandheight, unsigned char *samples)
+void fz_write_ps_band(fz_context *ctx, fz_output *out, fz_ps_output_context *psoc, int w, int h, int n, int stride, int band_start, int bandheight, unsigned char *samples)
{
int x, y, i, err;
int required_input;
int required_output;
unsigned char *o;
- band *= bandheight;
- if (band+bandheight >= h)
- bandheight = h - band;
+ if (band_start+bandheight >= h)
+ bandheight = h - band_start;
required_input = w*(n-1)*bandheight;
required_output = (int)deflateBound(&psoc->stream, required_input);