summaryrefslogtreecommitdiff
path: root/image
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-04-22 23:13:24 +0100
committerVincent Sanders <vince@kyllikki.org>2015-04-22 23:14:51 +0100
commitde98108e7f5dde136164a6e74596d70fd1289397 (patch)
treebee10caaf3f76eaed32b91adebf7b0a45af84859 /image
parentdf3a8894357444704ec6c72df2dd3b2161e3f4c7 (diff)
downloadnetsurf-de98108e7f5dde136164a6e74596d70fd1289397.tar.gz
netsurf-de98108e7f5dde136164a6e74596d70fd1289397.tar.bz2
Add render to bitmap operations and update gtk to provide it.
Diffstat (limited to 'image')
-rw-r--r--image/bitmap.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/image/bitmap.h b/image/bitmap.h
index b121f8abd..ef6c1b49b 100644
--- a/image/bitmap.h
+++ b/image/bitmap.h
@@ -28,27 +28,27 @@
* For example, an opaque 1x1 pixel image would yield the following bitmap
* data:
*
- * Red : 0xff 0x00 0x00 0x00
- * Green: 0x00 0xff 0x00 0x00
- * Blue : 0x00 0x00 0xff 0x00
+ * > Red : 0xff 0x00 0x00 0x00
+ * > Green: 0x00 0xff 0x00 0x00
+ * > Blue : 0x00 0x00 0xff 0x00
*
* Any attempt to read pixels by casting bitmap data to uint32_t or similar
* will need to cater for the order of bytes in a word being different on
* big and little endian systems. To avoid confusion, it is recommended
* that pixel data is loaded as follows:
*
- * uint32_t read_pixel(const uint8_t *bmp)
- * {
- * // red green blue alpha
- * return bmp[0] | (bmp[1] << 8) | (bmp[2] << 16) | (bmp[3] << 24);
- * }
+ * uint32_t read_pixel(const uint8_t *bmp)
+ * {
+ * // red green blue alpha
+ * return bmp[0] | (bmp[1] << 8) | (bmp[2] << 16) | (bmp[3] << 24);
+ * }
*
* and *not* as follows:
*
- * uint32_t read_pixel(const uint8_t *bmp)
- * {
- * return *((uint32_t *) bmp);
- * }
+ * uint32_t read_pixel(const uint8_t *bmp)
+ * {
+ * return *((uint32_t *) bmp);
+ * }
*/
#ifndef _NETSURF_IMAGE_BITMAP_H_
@@ -61,6 +61,7 @@
struct content;
struct bitmap;
+struct hlcache_handle;
/**
* Bitmap operations.
@@ -163,6 +164,14 @@ struct gui_bitmap_table {
* \param bitmap The bitmap set as modified.
*/
void (*modified)(void *bitmap);
+
+ /**
+ * Render content into a bitmap.
+ *
+ * \param bitmap The bitmap to render into.
+ * \param content The content to render.
+ */
+ nserror (*render)(struct bitmap *bitmap, struct hlcache_handle *content);
};
#endif