summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/mupdf/fitz/output.h37
1 files changed, 35 insertions, 2 deletions
diff --git a/include/mupdf/fitz/output.h b/include/mupdf/fitz/output.h
index aae56528..ed4d47fa 100644
--- a/include/mupdf/fitz/output.h
+++ b/include/mupdf/fitz/output.h
@@ -339,13 +339,46 @@ struct fz_band_writer_s
int xres;
int yres;
int pagenum;
+ int line;
};
fz_band_writer *fz_new_band_writer_of_size(fz_context *ctx, size_t size, fz_output *out);
#define fz_new_band_writer(C,M,O) ((M *)Memento_label(fz_new_band_writer_of_size(ctx, sizeof(M), O), #M))
+
+/*
+ fz_write_header: Cause a band writer to write the header for
+ a banded image with the given properties/dimensions etc. This
+ also configures the bandwriter for the format of the data to be
+ passed in future calls.
+
+ w, h: Width and Height of the entire page.
+
+ n: Number of components (including alphas).
+
+ alpha: Number of alpha components.
+
+ xres, yres: X and Y resolutions in dpi.
+
+ pagenum: Page number
+
+ Throws exception if incompatible data format.
+*/
void fz_write_header(fz_context *ctx, fz_band_writer *writer, int w, int h, int n, int alpha, int xres, int yres, int pagenum);
-void fz_write_band(fz_context *ctx, fz_band_writer *writer, int stride, int band_start, int band_height, const unsigned char *samples);
-void fz_write_trailer(fz_context *ctx, fz_band_writer *writer);
+
+/*
+ fz_write_band: Cause a band writer to write the next band
+ of data for an image.
+
+ stride: The byte offset from the first byte of the data
+ for a pixel to the first byte of the data for the same pixel
+ on the row below.
+
+ band_height: The number of lines in this band.
+
+ samples: Pointer to first byte of the data.
+*/
+void fz_write_band(fz_context *ctx, fz_band_writer *writer, int stride, int band_height, const unsigned char *samples);
+
void fz_drop_band_writer(fz_context *ctx, fz_band_writer *writer);
#endif