-
Notifications
You must be signed in to change notification settings - Fork 7
/
iff.h
73 lines (63 loc) · 1.12 KB
/
iff.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* iff.h
* ql_plugin_test_2
*
* Created by David R on 13-03-09.
* Copyright 2013 __MyCompanyName__. All rights reserved.
*
*/
#include <stdint.h>
typedef struct
{
uint32_t id;
uint32_t size;
}
header_t;
typedef struct
{
header_t header;
uint32_t type;
}
form_t;
typedef struct
{
header_t header;
uint16_t w,h; /* raster width & height in pixels */
int16_t x,y; /* pixel position for this image */
uint8_t nPlanes; /* # source bitplanes */
uint8_t masking;
uint8_t compression;
uint8_t pad1; /* unused; for consistency, put 0 here */
uint16_t transparentColor; /* transparent "color number" (sort of) */
uint8_t xAspect, yAspect; /* pixel aspect, a ratio width : height */
int16_t pageWidth, pageHeight; /* source "page" size in pixels */
}
bmhd_t;
typedef struct
{
header_t header;
uint8_t data;
}
cmap_t;
typedef struct
{
header_t header;
uint8_t data;
}
body_t;
typedef struct
{
header_t header;
uint32_t viewMode;
}
camg_t;
typedef struct
{
form_t *form;
bmhd_t *bmhd;
camg_t *camg;
cmap_t *cmap;
body_t *body;
}
chunkMap_t;
CGImageRef iff_createImage(CFURLRef url, bool withAlpha);