~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/trace/imagemap.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __IMAGEMAP_H__
 
2
#define __IMAGEMAP_H__
 
3
 
 
4
#ifndef TRUE
 
5
#define TRUE  1
 
6
#endif
 
7
 
 
8
#ifndef FALSE
 
9
#define FALSE 0
 
10
#endif
 
11
 
 
12
 
 
13
/*#########################################################################
 
14
### G R A Y M A P
 
15
#########################################################################*/
 
16
 
 
17
 
 
18
typedef struct GrayMap_def GrayMap;
 
19
 
 
20
#define GRAYMAP_BLACK 0
 
21
#define GRAYMAP_WHITE 765
 
22
 
 
23
/**
 
24
 *
 
25
 */
 
26
struct GrayMap_def
 
27
{
 
28
 
 
29
    /*#################
 
30
    ### METHODS
 
31
    #################*/
 
32
 
 
33
    /**
 
34
     *
 
35
     */
 
36
    void (*setPixel)(GrayMap *me, int x, int y, unsigned long val);
 
37
 
 
38
    /**
 
39
     *
 
40
     */
 
41
    unsigned long (*getPixel)(GrayMap *me, int x, int y);
 
42
 
 
43
    /**
 
44
     *
 
45
     */
 
46
    int (*writePPM)(GrayMap *me, char *fileName);
 
47
 
 
48
 
 
49
 
 
50
    /**
 
51
     *
 
52
     */
 
53
    void (*destroy)(GrayMap *me);
 
54
 
 
55
 
 
56
 
 
57
    /*#################
 
58
    ### FIELDS
 
59
    #################*/
 
60
 
 
61
    /**
 
62
     *
 
63
     */
 
64
    int width;
 
65
 
 
66
    /**
 
67
     *
 
68
     */
 
69
    int height;
 
70
 
 
71
    /**
 
72
     *  The pixel array
 
73
     */
 
74
    unsigned long *pixels;
 
75
 
 
76
    /**
 
77
     *  Pointer to the beginning of each row
 
78
     */
 
79
    unsigned long **rows;
 
80
 
 
81
};
 
82
 
 
83
#ifdef __cplusplus
 
84
extern "C" {
 
85
#endif
 
86
 
 
87
GrayMap *GrayMapCreate(int width, int height);
 
88
 
 
89
#ifdef __cplusplus
 
90
}
 
91
#endif
 
92
 
 
93
 
 
94
 
 
95
 
 
96
/*#########################################################################
 
97
### P A C K E D    P I X E L     M A P
 
98
#########################################################################*/
 
99
 
 
100
 
 
101
typedef struct PackedPixelMap_def PackedPixelMap;
 
102
 
 
103
/**
 
104
 *
 
105
 */
 
106
struct PackedPixelMap_def
 
107
{
 
108
 
 
109
    /*#################
 
110
    ### METHODS
 
111
    #################*/
 
112
 
 
113
    /**
 
114
     *
 
115
     */
 
116
    void (*setPixel)(PackedPixelMap *me, int x, int y, int r, int g, int b);
 
117
 
 
118
 
 
119
    /**
 
120
     *
 
121
     */
 
122
    void (*setPixelLong)(PackedPixelMap *me, int x, int y, unsigned long rgb);
 
123
 
 
124
 
 
125
    /**
 
126
     *
 
127
     */
 
128
    unsigned long (*getPixel)(PackedPixelMap *me, int x, int y);
 
129
 
 
130
 
 
131
    /**
 
132
     *
 
133
     */
 
134
    int (*writePPM)(PackedPixelMap *me, char *fileName);
 
135
 
 
136
 
 
137
 
 
138
    /**
 
139
     *
 
140
     */
 
141
    void (*destroy)(PackedPixelMap *me);
 
142
 
 
143
 
 
144
 
 
145
    /*#################
 
146
    ### FIELDS
 
147
    #################*/
 
148
 
 
149
    /**
 
150
     *
 
151
     */
 
152
    int width;
 
153
 
 
154
    /**
 
155
     *
 
156
     */
 
157
    int height;
 
158
 
 
159
    /**
 
160
     * The allocated array of pixels
 
161
     */
 
162
    unsigned long *pixels;
 
163
 
 
164
    /**
 
165
     * Pointers to the beginning of each row of pixels
 
166
     */
 
167
    unsigned long **rows;
 
168
 
 
169
 
 
170
};
 
171
 
 
172
 
 
173
 
 
174
#ifdef __cplusplus
 
175
extern "C" {
 
176
#endif
 
177
 
 
178
PackedPixelMap *PackedPixelMapCreate(int width, int height);
 
179
 
 
180
#ifdef __cplusplus
 
181
}
 
182
#endif
 
183
 
 
184
 
 
185
 
 
186
/*#########################################################################
 
187
### R G B   M A P
 
188
#########################################################################*/
 
189
 
 
190
typedef struct
 
191
{
 
192
    unsigned char r;
 
193
    unsigned char g;
 
194
    unsigned char b;
 
195
} RGB;
 
196
 
 
197
 
 
198
 
 
199
typedef struct RgbMap_def RgbMap;
 
200
 
 
201
/**
 
202
 *
 
203
 */
 
204
struct RgbMap_def
 
205
{
 
206
 
 
207
    /*#################
 
208
    ### METHODS
 
209
    #################*/
 
210
 
 
211
    /**
 
212
     *
 
213
     */
 
214
    void (*setPixel)(RgbMap *me, int x, int y, int r, int g, int b);
 
215
 
 
216
 
 
217
    /**
 
218
     *
 
219
     */
 
220
    void (*setPixelRGB)(RgbMap *me, int x, int y, RGB rgb);
 
221
 
 
222
    /**
 
223
     *
 
224
     */
 
225
    RGB (*getPixel)(RgbMap *me, int x, int y);
 
226
 
 
227
    /**
 
228
     *
 
229
     */
 
230
    int (*writePPM)(RgbMap *me, char *fileName);
 
231
 
 
232
 
 
233
 
 
234
    /**
 
235
     *
 
236
     */
 
237
    void (*destroy)(RgbMap *me);
 
238
 
 
239
 
 
240
 
 
241
    /*#################
 
242
    ### FIELDS
 
243
    #################*/
 
244
 
 
245
    /**
 
246
     *
 
247
     */
 
248
    int width;
 
249
 
 
250
    /**
 
251
     *
 
252
     */
 
253
    int height;
 
254
 
 
255
    /**
 
256
     * The allocated array of pixels
 
257
     */
 
258
    RGB *pixels;
 
259
 
 
260
    /**
 
261
     * Pointers to the beginning of each row of pixels
 
262
     */
 
263
    RGB **rows;
 
264
 
 
265
};
 
266
 
 
267
 
 
268
 
 
269
#ifdef __cplusplus
 
270
extern "C" {
 
271
#endif
 
272
 
 
273
RgbMap *RgbMapCreate(int width, int height);
 
274
 
 
275
#ifdef __cplusplus
 
276
}
 
277
#endif
 
278
 
 
279
 
 
280
 
 
281
 
 
282
/*#########################################################################
 
283
### I N D E X E D     M A P
 
284
#########################################################################*/
 
285
 
 
286
 
 
287
typedef struct IndexedMap_def IndexedMap;
 
288
 
 
289
/**
 
290
 *
 
291
 */
 
292
struct IndexedMap_def
 
293
{
 
294
 
 
295
    /*#################
 
296
    ### METHODS
 
297
    #################*/
 
298
 
 
299
    /**
 
300
     *
 
301
     */
 
302
    void (*setPixel)(IndexedMap *me, int x, int y, unsigned int index);
 
303
 
 
304
 
 
305
    /**
 
306
     *
 
307
     */
 
308
    unsigned int (*getPixel)(IndexedMap *me, int x, int y);
 
309
 
 
310
    /**
 
311
     *
 
312
     */
 
313
    RGB (*getPixelValue)(IndexedMap *me, int x, int y);
 
314
 
 
315
    /**
 
316
     *
 
317
     */
 
318
    int (*writePPM)(IndexedMap *me, char *fileName);
 
319
 
 
320
 
 
321
 
 
322
    /**
 
323
     *
 
324
     */
 
325
    void (*destroy)(IndexedMap *me);
 
326
 
 
327
 
 
328
 
 
329
    /*#################
 
330
    ### FIELDS
 
331
    #################*/
 
332
 
 
333
    /**
 
334
     *
 
335
     */
 
336
    int width;
 
337
 
 
338
    /**
 
339
     *
 
340
     */
 
341
    int height;
 
342
 
 
343
    /**
 
344
     * The allocated array of pixels
 
345
     */
 
346
    unsigned int *pixels;
 
347
 
 
348
    /**
 
349
     * Pointers to the beginning of each row of pixels
 
350
     */
 
351
    unsigned int **rows;
 
352
 
 
353
    /**
 
354
     *
 
355
     */
 
356
    int nrColors;
 
357
 
 
358
    /**
 
359
     * Color look up table
 
360
     */
 
361
    RGB clut[256];
 
362
 
 
363
};
 
364
 
 
365
 
 
366
 
 
367
#ifdef __cplusplus
 
368
extern "C" {
 
369
#endif
 
370
 
 
371
IndexedMap *IndexedMapCreate(int width, int height);
 
372
 
 
373
#ifdef __cplusplus
 
374
}
 
375
#endif
 
376
 
 
377
 
 
378
 
 
379
 
 
380
#endif /* __IMAGEMAP_H__ */
 
381
 
 
382
/*#########################################################################
 
383
### E N D    O F    F I L E
 
384
#########################################################################*/