summaryrefslogtreecommitdiff
path: root/trunk/libsprite.h
diff options
context:
space:
mode:
authorJames Shaw <jshaw@netsurf-browser.org>2007-11-29 12:47:59 +0000
committerJames Shaw <jshaw@netsurf-browser.org>2007-11-29 12:47:59 +0000
commitbaf5637b98e0571690ff7348188da22481d4a1a4 (patch)
treebb4a5b23b41249436f9a7780acfe1203f47081e5 /trunk/libsprite.h
parentaf7f28efd7bacd461d9b9a9bcd319ddf067677b0 (diff)
downloadlibrosprite-baf5637b98e0571690ff7348188da22481d4a1a4.tar.gz
librosprite-baf5637b98e0571690ff7348188da22481d4a1a4.tar.bz2
Implement destroy functions, misc code style improvements thanks to Rob
Kendrick. svn path=/import/jshaw/libsprite/; revision=10003
Diffstat (limited to 'trunk/libsprite.h')
-rw-r--r--trunk/libsprite.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/trunk/libsprite.h b/trunk/libsprite.h
index 1d8ceb0..f0f0806 100644
--- a/trunk/libsprite.h
+++ b/trunk/libsprite.h
@@ -1,11 +1,10 @@
-#ifndef libsprite_h_
-#define libsprite_h_
+#ifndef ROSPRITE_H
+#define ROSPRITE_H
#include <stdint.h>
#include <stdbool.h>
-#define SPRITE_RGB 0
-#define SPRITE_CMYK 1
+typedef enum { rosprite_rgb, rosprite_cmyk } rosprite_color_model;
struct sprite_area {
uint32_t extension_size; /* size of extension_words in bytes */
@@ -26,7 +25,7 @@ struct sprite_mode {
uint32_t mask_width; /* in pixels */
uint32_t xdpi;
uint32_t ydpi;
- uint32_t color_model;
+ rosprite_color_model color_model;
};
struct sprite_palette {
@@ -41,13 +40,17 @@ struct sprite {
bool has_palette;
uint32_t palettesize; /* in number of entries (each entry is a word) */
uint32_t* palette;
- uint32_t width; /* width and height in _pixels_ */
- uint32_t height;
- uint32_t* image;
+ uint32_t width; /* width in pixels */
+ uint32_t height; /* height in pixels */
+ uint32_t* image; /* image data in 0xRRGGBBAA words */
};
void sprite_init(void);
struct sprite_area* sprite_load_file(FILE* f);
-struct sprite_palette* sprite_load_palette(FILE* f);
+void rosprite_destroy_sprite_area(struct sprite_area *);
+
+struct sprite_palette* rosprite_load_palette(FILE* f);
+void rosprite_destroy_palette(struct sprite_palette *);
+
#endif