]> git.imager.perl.org - imager.git/blob - ICO/msicon.h
- Calling setpixel() with color set to [ 0, 0, 0 ] would crash with
[imager.git] / ICO / msicon.h
1 #ifndef IMAGER_MSICON_H_
2 #define IMAGER_MSICON_H_
3
4 #include "iolayer.h"
5
6 typedef struct ico_reader_tag ico_reader_t;
7
8 #define ICON_ICON 1
9 #define ICON_CURSOR 2
10
11 typedef struct {
12   unsigned char r, g, b, a;
13 } ico_color_t;
14
15 typedef struct {
16   int width;
17   int height;
18   int direct;
19   int bit_count;
20   void *image_data;
21   int palette_size;
22   ico_color_t *palette;
23   unsigned char *mask_data;
24 } ico_image_t;
25
26 extern ico_reader_t *ico_reader_open(i_io_glue_t *ig, int *error);
27 extern int ico_image_count(ico_reader_t *file);
28 extern int ico_type(ico_reader_t *file);
29 extern ico_image_t *ico_image_read(ico_reader_t *file, int index, int *error);
30 extern void ico_image_release(ico_image_t *image);
31 extern void ico_reader_close(ico_reader_t *file);
32
33 extern size_t ico_error_message(int error, char *buffer, size_t buffer_size);
34
35 #define ICO_MAX_MESSAGE 80
36
37 #define ICOERR_Short_File 100
38 #define ICOERR_File_Error 101
39
40 #define ICOERR_Invalid_File 200
41 #define ICOERR_Unknown_Bits 201
42
43 #define ICOERR_Bad_Image_Index 300
44
45 #define ICOERR_Out_Of_Memory 400
46
47 #endif