]> git.imager.perl.org - imager.git/blame - ICO/msicon.h
hopefully avoid coverity complaining about a float vs int comparison
[imager.git] / ICO / msicon.h
CommitLineData
b00687b2
TC
1#ifndef IMAGER_MSICON_H_
2#define IMAGER_MSICON_H_
3
6d5c85a2 4#include "iolayert.h"
b00687b2
TC
5
6typedef struct ico_reader_tag ico_reader_t;
7
8#define ICON_ICON 1
9#define ICON_CURSOR 2
10
11typedef struct {
12 unsigned char r, g, b, a;
13} ico_color_t;
14
15typedef 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;
2b405c9e 24 int hotspot_x, hotspot_y;
b00687b2
TC
25} ico_image_t;
26
27extern ico_reader_t *ico_reader_open(i_io_glue_t *ig, int *error);
28extern int ico_image_count(ico_reader_t *file);
29extern int ico_type(ico_reader_t *file);
30extern ico_image_t *ico_image_read(ico_reader_t *file, int index, int *error);
31extern void ico_image_release(ico_image_t *image);
32extern void ico_reader_close(ico_reader_t *file);
33
2b405c9e
TC
34extern int ico_write(i_io_glue_t *ig, ico_image_t const *images,
35 int image_count, int type, int *error);
36
b00687b2
TC
37extern size_t ico_error_message(int error, char *buffer, size_t buffer_size);
38
39#define ICO_MAX_MESSAGE 80
40
41#define ICOERR_Short_File 100
42#define ICOERR_File_Error 101
2b405c9e 43#define ICOERR_Write_Failure 102
b00687b2
TC
44
45#define ICOERR_Invalid_File 200
46#define ICOERR_Unknown_Bits 201
47
48#define ICOERR_Bad_Image_Index 300
2b405c9e
TC
49#define ICOERR_Bad_File_Type 301
50#define ICOERR_Invalid_Width 302
51#define ICOERR_Invalid_Height 303
52#define ICOERR_Invalid_Palette 304
53#define ICOERR_No_Data 305
b00687b2
TC
54
55#define ICOERR_Out_Of_Memory 400
56
57#endif