summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-11-11 13:17:02 +0000
committerRobin Watts <robin.watts@artifex.com>2016-11-11 16:07:21 +0000
commit7c6c6a58d58b7df384704e909d34e47454582c15 (patch)
tree88bcca2f8293efbd9ce5d5d02c6c0bf7da1e4e05 /include
parent099a0806ebc85632b96ff5e7f52306102b4a9791 (diff)
downloadmupdf-7c6c6a58d58b7df384704e909d34e47454582c15.tar.xz
API improvements.
Add missing API comments. Move private definitions to implementation headers or C files. Move internal functions to implementation headers.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/annotation.h8
-rw-r--r--include/mupdf/fitz/bitmap.h70
2 files changed, 66 insertions, 12 deletions
diff --git a/include/mupdf/fitz/annotation.h b/include/mupdf/fitz/annotation.h
index 9864fd16..79df092d 100644
--- a/include/mupdf/fitz/annotation.h
+++ b/include/mupdf/fitz/annotation.h
@@ -11,7 +11,15 @@
*/
void *fz_new_annot(fz_context *ctx, int size);
+/*
+ fz_keep_annot: Take a new reference to an annotation.
+*/
fz_annot *fz_keep_annot(fz_context *ctx, fz_annot *annot);
+
+/*
+ fz_drop_annot: Drop a reference to an annotation. If the
+ reference count reaches zero, annot will be destroyed.
+*/
void fz_drop_annot(fz_context *ctx, fz_annot *annot);
/*
diff --git a/include/mupdf/fitz/bitmap.h b/include/mupdf/fitz/bitmap.h
index 3b35b543..353f4ccc 100644
--- a/include/mupdf/fitz/bitmap.h
+++ b/include/mupdf/fitz/bitmap.h
@@ -44,7 +44,7 @@ typedef struct fz_halftone_s fz_halftone;
fz_new_bitmap_from_pixmap: Make a bitmap from a pixmap and a halftone.
pix: The pixmap to generate from. Currently must be a single color
- component + alpha (where the alpha is assumed to be solid).
+ component with no alpha.
ht: The halftone to use. NULL implies the default halftone.
@@ -53,7 +53,23 @@ typedef struct fz_halftone_s fz_halftone;
*/
fz_bitmap *fz_new_bitmap_from_pixmap(fz_context *ctx, fz_pixmap *pix, fz_halftone *ht);
-fz_bitmap *fz_new_bitmap_from_pixmap_band(fz_context *ctx, fz_pixmap *pix, fz_halftone *ht, int band_start, int band_height);
+/*
+ fz_new_bitmap_from_pixmap_band: Make a bitmap from a pixmap and a
+ halftone, allowing for the position of the pixmap within an
+ overall banded rendering.
+
+ pix: The pixmap to generate from. Currently must be a single color
+ component with no alpha.
+
+ ht: The halftone to use. NULL implies the default halftone.
+
+ band_start: Vertical offset within the overall banded rendering
+ (in pixels)
+
+ Returns the resultant bitmap. Throws exceptions in the case of
+ failure to allocate.
+*/
+fz_bitmap *fz_new_bitmap_from_pixmap_band(fz_context *ctx, fz_pixmap *pix, fz_halftone *ht, int band_start);
struct fz_bitmap_s
{
@@ -63,20 +79,41 @@ struct fz_bitmap_s
unsigned char *samples;
};
+/*
+ fz_new_bitmap: Create a new bitmap.
+
+ w, h: Width and Height for the bitmap
+
+ n: Number of color components (assumed to be a divisor of 8)
+
+ xres, yres: X and Y resolutions (in pixels per inch).
+
+ Returns pointer to created bitmap structure. The bitmap
+ data is uninitialised.
+*/
fz_bitmap *fz_new_bitmap(fz_context *ctx, int w, int h, int n, int xres, int yres);
-void fz_bitmap_details(fz_bitmap *bitmap, int *w, int *h, int *n, int *stride);
+/*
+ fz_bitmap_details: Retrieve details of a given bitmap.
-void fz_clear_bitmap(fz_context *ctx, fz_bitmap *bit);
+ bitmap: The bitmap to query.
-struct fz_halftone_s
-{
- int refs;
- int n;
- fz_pixmap *comp[1];
-};
+ w: Pointer to storage to retrieve width (or NULL).
+
+ h: Pointer to storage to retrieve height (or NULL).
+
+ n: Pointer to storage to retrieve number of color components (or NULL).
+
+ stride: Pointer to storage to retrieve bitmap stride (or NULL).
+*/
+void fz_bitmap_details(fz_bitmap *bitmap, int *w, int *h, int *n, int *stride);
-fz_halftone *fz_new_halftone(fz_context *ctx, int num_comps);
+/*
+ fz_clear_bitmap: Clear a previously created bitmap.
+
+ bit: The bitmap to clear.
+*/
+void fz_clear_bitmap(fz_context *ctx, fz_bitmap *bit);
/*
fz_default_halftone: Create a 'default' halftone structure
@@ -90,7 +127,16 @@ fz_halftone *fz_new_halftone(fz_context *ctx, int num_comps);
*/
fz_halftone *fz_default_halftone(fz_context *ctx, int num_comps);
-void fz_drop_halftone(fz_context *ctx, fz_halftone *half);
+/*
+ fz_keep_halftone: Take an additional reference to a
+ halftone.
+*/
fz_halftone *fz_keep_halftone(fz_context *ctx, fz_halftone *half);
+/*
+ fz_drop_halftone: Drop a reference to a halftone. If the
+ reference count reaches zero, ht will be destroyed.
+*/
+void fz_drop_halftone(fz_context *ctx, fz_halftone *ht);
+
#endif