summaryrefslogtreecommitdiff
path: root/amiga/bitmap.h
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-04-16 22:36:29 +0100
committerVincent Sanders <vince@kyllikki.org>2015-04-16 22:36:29 +0100
commitfb0bd7994491da2a7fa6913c5b5666ed49c6e153 (patch)
tree8927b698347d87bda7639719e68ea0266eb483e7 /amiga/bitmap.h
parent3c61db33ffc94ee194dd0111a332762199334d37 (diff)
downloadnetsurf-fb0bd7994491da2a7fa6913c5b5666ed49c6e153.tar.gz
netsurf-fb0bd7994491da2a7fa6913c5b5666ed49c6e153.tar.bz2
update amiga frontend to use bitmap operation table
Diffstat (limited to 'amiga/bitmap.h')
-rwxr-xr-xamiga/bitmap.h80
1 files changed, 79 insertions, 1 deletions
diff --git a/amiga/bitmap.h b/amiga/bitmap.h
index 6657d2f8a..63969ecaa 100755
--- a/amiga/bitmap.h
+++ b/amiga/bitmap.h
@@ -18,7 +18,6 @@
#ifndef AMIGA_BITMAP_H
#define AMIGA_BITMAP_H
-#include "image/bitmap.h"
#include <exec/types.h>
#include <proto/graphics.h>
@@ -28,6 +27,8 @@
#define AMI_BITMAP_FORMAT RGBFB_R8G8B8A8
#define AMI_BITMAP_FORCE_OVERWRITE 0xFF
+struct gui_bitmap_table *amiga_bitmap_table;
+
struct bitmap {
int width;
int height;
@@ -55,4 +56,81 @@ struct bitmap *ami_bitmap_from_datatype(char *filename);
void ami_bitmap_argb_to_rgba(struct bitmap *bm);
#endif
+/**
+ * Create a bitmap.
+ *
+ * \param width width of image in pixels
+ * \param height width of image in pixels
+ * \param state a flag word indicating the initial state
+ * \return an opaque struct bitmap, or NULL on memory exhaustion
+ */
+void *amiga_bitmap_create(int width, int height, unsigned int state);
+
+/**
+ * Return a pointer to the pixel data in a bitmap.
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ * \return pointer to the pixel buffer
+ *
+ * The pixel data is packed as BITMAP_FORMAT, possibly with padding at the end
+ * of rows. The width of a row in bytes is given by bitmap_get_rowstride().
+ */
+unsigned char *amiga_bitmap_get_buffer(void *bitmap);
+
+/**
+ * Find the width of a pixel row in bytes.
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ * \return width of a pixel row in the bitmap
+ */
+size_t amiga_bitmap_get_rowstride(void *bitmap);
+
+/**
+ * Free a bitmap.
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ */
+void amiga_bitmap_destroy(void *bitmap);
+
+/**
+ * Save a bitmap in the platform's native format.
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ * \param path pathname for file
+ * \param flags flags controlling how the bitmap is saved.
+ * \return true on success, false on error and error reported
+ */
+bool amiga_bitmap_save(void *bitmap, const char *path, unsigned flags);
+
+/**
+ * The bitmap image has changed, so flush any persistant cache.
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ */
+void amiga_bitmap_modified(void *bitmap);
+
+/**
+ * Sets whether a bitmap should be plotted opaque
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ * \param opaque whether the bitmap should be plotted opaque
+ */
+void amiga_bitmap_set_opaque(void *bitmap, bool opaque);
+
+/**
+ * Tests whether a bitmap has an opaque alpha channel
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ * \return whether the bitmap is opaque
+ */
+bool amiga_bitmap_test_opaque(void *bitmap);
+
+/**
+ * Gets whether a bitmap should be plotted opaque
+ *
+ * \param bitmap a bitmap, as returned by bitmap_create()
+ */
+bool amiga_bitmap_get_opaque(void *bitmap);
+
+
#endif