| 1 |
#ifndef IMAGER_IMDATATYPES_H |
| 2 |
#define IMAGER_IMDATATYPES_H |
| 3 |
|
| 4 |
#include <stddef.h> |
| 5 |
#include "imconfig.h" |
| 6 |
|
| 7 |
#ifdef __cplusplus |
| 8 |
extern "C" { |
| 9 |
#endif |
| 10 |
|
| 11 |
#define MAXCHANNELS 4 |
| 12 |
|
| 13 |
/* |
| 14 |
=item im_context_t |
| 15 |
=category Data Types |
| 16 |
|
| 17 |
Imager's per-thread context. |
| 18 |
|
| 19 |
=cut |
| 20 |
*/ |
| 21 |
|
| 22 |
typedef struct im_context_tag *im_context_t; |
| 23 |
|
| 24 |
/* |
| 25 |
=item im_slot_t |
| 26 |
=category Data Types |
| 27 |
|
| 28 |
Represents a slot in the context object. |
| 29 |
|
| 30 |
=cut |
| 31 |
*/ |
| 32 |
|
| 33 |
typedef ptrdiff_t im_slot_t; |
| 34 |
typedef void (*im_slot_destroy_t)(void *); |
| 35 |
|
| 36 |
/* just so we can use our own input typemap */ |
| 37 |
typedef double im_double; |
| 38 |
typedef float im_float; |
| 39 |
|
| 40 |
/* used for palette indices in some internal code (which might be |
| 41 |
exposed at some point |
| 42 |
*/ |
| 43 |
typedef unsigned char i_palidx; |
| 44 |
|
| 45 |
/* We handle 2 types of sample, this is hopefully the most common, and the |
| 46 |
smaller of the ones we support */ |
| 47 |
typedef unsigned char i_sample_t; |
| 48 |
|
| 49 |
typedef struct { i_sample_t gray_color; } gray_color; |
| 50 |
typedef struct { i_sample_t r,g,b; } rgb_color; |
| 51 |
typedef struct { i_sample_t r,g,b,a; } rgba_color; |
| 52 |
typedef struct { i_sample_t c,m,y,k; } cmyk_color; |
| 53 |
|
| 54 |
typedef int undef_int; /* special value to put in typemaps to retun undef on 0 and 1 on 1 */ |
| 55 |
|
| 56 |
/* |
| 57 |
=item i_img_dim |
| 58 |
=category Data Types |
| 59 |
=synopsis i_img_dim x, y; |
| 60 |
=order 90 |
| 61 |
|
| 62 |
A signed integer type that represents an image dimension or ordinate. |
| 63 |
|
| 64 |
May be larger than int on some platforms. |
| 65 |
|
| 66 |
=cut |
| 67 |
*/ |
| 68 |
|
| 69 |
typedef ptrdiff_t i_img_dim; |
| 70 |
|
| 71 |
/* |
| 72 |
=item i_img_dim_u |
| 73 |
=category Data Types |
| 74 |
=synopsis i_img_dim_u limit; |
| 75 |
=order 90 |
| 76 |
|
| 77 |
An unsigned variant of L</i_img_dim>. |
| 78 |
|
| 79 |
=cut |
| 80 |
*/ |
| 81 |
|
| 82 |
typedef size_t i_img_dim_u; |
| 83 |
|
| 84 |
#define i_img_dim_MAX ((i_img_dim)(~(i_img_dim_u)0 >> 1)) |
| 85 |
|
| 86 |
/* |
| 87 |
=item i_color |
| 88 |
=category Data Types |
| 89 |
=synopsis i_color black; |
| 90 |
=synopsis black.rgba.r = black.rgba.g = black.rgba.b = black.rgba.a = 0; |
| 91 |
|
| 92 |
Type for 8-bit/sample color. |
| 93 |
|
| 94 |
Samples as per; |
| 95 |
|
| 96 |
i_color c; |
| 97 |
|
| 98 |
i_color is a union of: |
| 99 |
|
| 100 |
=over |
| 101 |
|
| 102 |
=item * |
| 103 |
|
| 104 |
gray - contains a single element gray_color, eg. C<c.gray.gray_color> |
| 105 |
|
| 106 |
=item * |
| 107 |
|
| 108 |
C<rgb> - contains three elements C<r>, C<g>, C<b>, eg. C<c.rgb.r> |
| 109 |
|
| 110 |
=item * |
| 111 |
|
| 112 |
C<rgba> - contains four elements C<r>, C<g>, C<b>, C<a>, eg. C<c.rgba.a> |
| 113 |
|
| 114 |
=item * |
| 115 |
|
| 116 |
C<cmyk> - contains four elements C<c>, C<m>, C<y>, C<k>, |
| 117 |
eg. C<c.cmyk.y>. Note that Imager never uses CMYK colors except when |
| 118 |
reading/writing files. |
| 119 |
|
| 120 |
=item * |
| 121 |
|
| 122 |
channels - an array of four channels, eg C<c.channels[2]>. |
| 123 |
|
| 124 |
=back |
| 125 |
|
| 126 |
=cut |
| 127 |
*/ |
| 128 |
|
| 129 |
typedef union { |
| 130 |
gray_color gray; |
| 131 |
rgb_color rgb; |
| 132 |
rgba_color rgba; |
| 133 |
cmyk_color cmyk; |
| 134 |
i_sample_t channel[MAXCHANNELS]; |
| 135 |
unsigned int ui; |
| 136 |
} i_color; |
| 137 |
|
| 138 |
/* this is the larger sample type, it should be able to accurately represent |
| 139 |
any sample size we use */ |
| 140 |
typedef double i_fsample_t; |
| 141 |
|
| 142 |
typedef struct { i_fsample_t gray_color; } i_fgray_color_t; |
| 143 |
typedef struct { i_fsample_t r, g, b; } i_frgb_color_t; |
| 144 |
typedef struct { i_fsample_t r, g, b, a; } i_frgba_color_t; |
| 145 |
typedef struct { i_fsample_t c, m, y, k; } i_fcmyk_color_t; |
| 146 |
|
| 147 |
/* |
| 148 |
=item i_fcolor |
| 149 |
=category Data Types |
| 150 |
|
| 151 |
This is the double/sample color type. |
| 152 |
|
| 153 |
Its layout exactly corresponds to i_color. |
| 154 |
|
| 155 |
=cut |
| 156 |
*/ |
| 157 |
|
| 158 |
typedef union { |
| 159 |
i_fgray_color_t gray; |
| 160 |
i_frgb_color_t rgb; |
| 161 |
i_frgba_color_t rgba; |
| 162 |
i_fcmyk_color_t cmyk; |
| 163 |
i_fsample_t channel[MAXCHANNELS]; |
| 164 |
} i_fcolor; |
| 165 |
|
| 166 |
typedef enum { |
| 167 |
i_direct_type, /* direct colour, keeps RGB values per pixel */ |
| 168 |
i_palette_type /* keeps a palette index per pixel */ |
| 169 |
} i_img_type_t; |
| 170 |
|
| 171 |
typedef enum { |
| 172 |
/* bits per sample, not per pixel */ |
| 173 |
/* a paletted image might have one bit per sample */ |
| 174 |
i_8_bits = 8, |
| 175 |
i_16_bits = 16, |
| 176 |
i_double_bits = sizeof(double) * 8 |
| 177 |
} i_img_bits_t; |
| 178 |
|
| 179 |
typedef struct { |
| 180 |
char *name; /* name of a given tag */ |
| 181 |
int code; /* number of a given tag, deprecated */ |
| 182 |
char *data; /* value of a given tag if it's not an int, may be NULL */ |
| 183 |
int size; /* size of the data */ |
| 184 |
int idata; /* value of a given tag if data is NULL */ |
| 185 |
} i_img_tag; |
| 186 |
|
| 187 |
typedef struct { |
| 188 |
int count; /* how many tags have been set */ |
| 189 |
int alloc; /* how many tags have been allocated for */ |
| 190 |
i_img_tag *tags; |
| 191 |
} i_img_tags; |
| 192 |
|
| 193 |
typedef struct i_img_ i_img; |
| 194 |
typedef int (*i_f_ppix_t)(i_img *im, i_img_dim x, i_img_dim y, const i_color *pix); |
| 195 |
typedef int (*i_f_ppixf_t)(i_img *im, i_img_dim x, i_img_dim y, const i_fcolor *pix); |
| 196 |
typedef i_img_dim (*i_f_plin_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, const i_color *vals); |
| 197 |
typedef i_img_dim (*i_f_plinf_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, const i_fcolor *vals); |
| 198 |
typedef int (*i_f_gpix_t)(i_img *im, i_img_dim x, i_img_dim y, i_color *pix); |
| 199 |
typedef int (*i_f_gpixf_t)(i_img *im, i_img_dim x, i_img_dim y, i_fcolor *pix); |
| 200 |
typedef i_img_dim (*i_f_glin_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, i_color *vals); |
| 201 |
typedef i_img_dim (*i_f_glinf_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, i_fcolor *vals); |
| 202 |
|
| 203 |
typedef i_img_dim (*i_f_gsamp_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, i_sample_t *samp, |
| 204 |
const int *chans, int chan_count); |
| 205 |
typedef i_img_dim (*i_f_gsampf_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, i_fsample_t *samp, |
| 206 |
const int *chan, int chan_count); |
| 207 |
|
| 208 |
typedef i_img_dim (*i_f_gpal_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, i_palidx *vals); |
| 209 |
typedef i_img_dim (*i_f_ppal_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, const i_palidx *vals); |
| 210 |
typedef int (*i_f_addcolors_t)(i_img *im, const i_color *colors, int count); |
| 211 |
typedef int (*i_f_getcolors_t)(i_img *im, int i, i_color *, int count); |
| 212 |
typedef int (*i_f_colorcount_t)(i_img *im); |
| 213 |
typedef int (*i_f_maxcolors_t)(i_img *im); |
| 214 |
typedef int (*i_f_findcolor_t)(i_img *im, const i_color *color, i_palidx *entry); |
| 215 |
typedef int (*i_f_setcolors_t)(i_img *im, int index, const i_color *colors, |
| 216 |
int count); |
| 217 |
|
| 218 |
typedef void (*i_f_destroy_t)(i_img *im); |
| 219 |
|
| 220 |
typedef i_img_dim (*i_f_gsamp_bits_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, unsigned *samp, |
| 221 |
const int *chans, int chan_count, int bits); |
| 222 |
typedef i_img_dim (*i_f_psamp_bits_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, unsigned const *samp, |
| 223 |
const int *chans, int chan_count, int bits); |
| 224 |
typedef i_img_dim |
| 225 |
(*i_f_psamp_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, |
| 226 |
const i_sample_t *samp, const int *chan, int chan_count); |
| 227 |
typedef i_img_dim |
| 228 |
(*i_f_psampf_t)(i_img *im, i_img_dim x, i_img_dim r, i_img_dim y, |
| 229 |
const i_fsample_t *samp, const int *chan, int chan_count); |
| 230 |
|
| 231 |
/* |
| 232 |
=item i_img |
| 233 |
=category Data Types |
| 234 |
=synopsis i_img *img; |
| 235 |
=order 10 |
| 236 |
|
| 237 |
This is Imager's image type. |
| 238 |
|
| 239 |
It contains the following members: |
| 240 |
|
| 241 |
=over |
| 242 |
|
| 243 |
=item * |
| 244 |
|
| 245 |
C<channels> - the number of channels in the image |
| 246 |
|
| 247 |
=item * |
| 248 |
|
| 249 |
C<xsize>, C<ysize> - the width and height of the image in pixels |
| 250 |
|
| 251 |
=item * |
| 252 |
|
| 253 |
C<bytes> - the number of bytes used to store the image data. Undefined |
| 254 |
where virtual is non-zero. |
| 255 |
|
| 256 |
=item * |
| 257 |
|
| 258 |
C<ch_mask> - a mask of writable channels. eg. if this is 6 then only |
| 259 |
channels 1 and 2 are writable. There may be bits set for which there |
| 260 |
are no channels in the image. |
| 261 |
|
| 262 |
=item * |
| 263 |
|
| 264 |
C<bits> - the number of bits stored per sample. Should be one of |
| 265 |
i_8_bits, i_16_bits, i_double_bits. |
| 266 |
|
| 267 |
=item * |
| 268 |
|
| 269 |
C<type> - either i_direct_type for direct color images, or i_palette_type |
| 270 |
for paletted images. |
| 271 |
|
| 272 |
=item * |
| 273 |
|
| 274 |
C<isvirtual> - if zero then this image is-self contained. If non-zero |
| 275 |
then this image could be an interface to some other implementation. |
| 276 |
|
| 277 |
=item * |
| 278 |
|
| 279 |
C<idata> - the image data. This should not be directly accessed. A new |
| 280 |
image implementation can use this to store its image data. |
| 281 |
i_img_destroy() will myfree() this pointer if it's non-null. |
| 282 |
|
| 283 |
=item * |
| 284 |
|
| 285 |
C<tags> - a structure storing the image's tags. This should only be |
| 286 |
accessed via the i_tags_*() functions. |
| 287 |
|
| 288 |
=item * |
| 289 |
|
| 290 |
C<ext_data> - a pointer for use internal to an image implementation. |
| 291 |
This should be freed by the image's destroy handler. |
| 292 |
|
| 293 |
=item * |
| 294 |
|
| 295 |
C<im_data> - data internal to Imager. This is initialized by |
| 296 |
i_img_init(). |
| 297 |
|
| 298 |
=item * |
| 299 |
|
| 300 |
i_f_ppix, i_f_ppixf, i_f_plin, i_f_plinf, i_f_gpix, i_f_gpixf, |
| 301 |
i_f_glin, i_f_glinf, i_f_gsamp, i_f_gampf - implementations for each |
| 302 |
of the required image functions. An image implementation should |
| 303 |
initialize these between calling i_img_alloc() and i_img_init(). |
| 304 |
|
| 305 |
=item * |
| 306 |
|
| 307 |
i_f_gpal, i_f_ppal, i_f_addcolors, i_f_getcolors, i_f_colorcount, |
| 308 |
i_f_maxcolors, i_f_findcolor, i_f_setcolors - implementations for each |
| 309 |
paletted image function. |
| 310 |
|
| 311 |
=item * |
| 312 |
|
| 313 |
i_f_destroy - custom image destruction function. This should be used |
| 314 |
to release memory if necessary. |
| 315 |
|
| 316 |
=item * |
| 317 |
|
| 318 |
i_f_gsamp_bits - implements i_gsamp_bits() for this image. |
| 319 |
|
| 320 |
=item * |
| 321 |
|
| 322 |
i_f_psamp_bits - implements i_psamp_bits() for this image. |
| 323 |
|
| 324 |
=item * |
| 325 |
|
| 326 |
i_f_psamp - implements psamp() for this image. |
| 327 |
|
| 328 |
=item * |
| 329 |
|
| 330 |
i_f_psampf - implements psamp() for this image. |
| 331 |
|
| 332 |
=item * |
| 333 |
|
| 334 |
C<im_data> - image specific data internal to Imager. |
| 335 |
|
| 336 |
=item * |
| 337 |
|
| 338 |
C<context> - the Imager API context this image belongs to. |
| 339 |
|
| 340 |
=back |
| 341 |
|
| 342 |
=cut |
| 343 |
*/ |
| 344 |
|
| 345 |
struct i_img_ { |
| 346 |
int channels; |
| 347 |
i_img_dim xsize,ysize; |
| 348 |
size_t bytes; |
| 349 |
unsigned int ch_mask; |
| 350 |
i_img_bits_t bits; |
| 351 |
i_img_type_t type; |
| 352 |
int isvirtual; /* image might not keep any data, must use functions */ |
| 353 |
unsigned char *idata; /* renamed to force inspection of existing code */ |
| 354 |
/* can be NULL if isvirtual is non-zero */ |
| 355 |
i_img_tags tags; |
| 356 |
|
| 357 |
void *ext_data; |
| 358 |
|
| 359 |
/* interface functions */ |
| 360 |
i_f_ppix_t i_f_ppix; |
| 361 |
i_f_ppixf_t i_f_ppixf; |
| 362 |
i_f_plin_t i_f_plin; |
| 363 |
i_f_plinf_t i_f_plinf; |
| 364 |
i_f_gpix_t i_f_gpix; |
| 365 |
i_f_gpixf_t i_f_gpixf; |
| 366 |
i_f_glin_t i_f_glin; |
| 367 |
i_f_glinf_t i_f_glinf; |
| 368 |
i_f_gsamp_t i_f_gsamp; |
| 369 |
i_f_gsampf_t i_f_gsampf; |
| 370 |
|
| 371 |
/* only valid for type == i_palette_type */ |
| 372 |
i_f_gpal_t i_f_gpal; |
| 373 |
i_f_ppal_t i_f_ppal; |
| 374 |
i_f_addcolors_t i_f_addcolors; |
| 375 |
i_f_getcolors_t i_f_getcolors; |
| 376 |
i_f_colorcount_t i_f_colorcount; |
| 377 |
i_f_maxcolors_t i_f_maxcolors; |
| 378 |
i_f_findcolor_t i_f_findcolor; |
| 379 |
i_f_setcolors_t i_f_setcolors; |
| 380 |
|
| 381 |
i_f_destroy_t i_f_destroy; |
| 382 |
|
| 383 |
/* as of 0.61 */ |
| 384 |
i_f_gsamp_bits_t i_f_gsamp_bits; |
| 385 |
i_f_psamp_bits_t i_f_psamp_bits; |
| 386 |
|
| 387 |
/* as of 0.88 */ |
| 388 |
i_f_psamp_t i_f_psamp; |
| 389 |
i_f_psampf_t i_f_psampf; |
| 390 |
|
| 391 |
void *im_data; |
| 392 |
|
| 393 |
/* 0.91 */ |
| 394 |
im_context_t context; |
| 395 |
}; |
| 396 |
|
| 397 |
/* ext_data for paletted images |
| 398 |
*/ |
| 399 |
typedef struct { |
| 400 |
int count; /* amount of space used in palette (in entries) */ |
| 401 |
int alloc; /* amount of space allocated for palette (in entries) */ |
| 402 |
i_color *pal; |
| 403 |
int last_found; |
| 404 |
} i_img_pal_ext; |
| 405 |
|
| 406 |
/* Helper datatypes |
| 407 |
The types in here so far are: |
| 408 |
|
| 409 |
doubly linked bucket list - pretty efficient |
| 410 |
octtree - no idea about goodness |
| 411 |
|
| 412 |
needed: hashes. |
| 413 |
|
| 414 |
*/ |
| 415 |
|
| 416 |
/* bitmap mask */ |
| 417 |
|
| 418 |
struct i_bitmap { |
| 419 |
i_img_dim xsize,ysize; |
| 420 |
char *data; |
| 421 |
}; |
| 422 |
|
| 423 |
struct i_bitmap* btm_new(i_img_dim xsize,i_img_dim ysize); |
| 424 |
void btm_destroy(struct i_bitmap *btm); |
| 425 |
int btm_test(struct i_bitmap *btm,i_img_dim x,i_img_dim y); |
| 426 |
void btm_set(struct i_bitmap *btm,i_img_dim x,i_img_dim y); |
| 427 |
|
| 428 |
|
| 429 |
/* Stack/Linked list */ |
| 430 |
|
| 431 |
struct llink { |
| 432 |
struct llink *p,*n; |
| 433 |
void *data; |
| 434 |
int fill; /* Number used in this link */ |
| 435 |
}; |
| 436 |
|
| 437 |
struct llist { |
| 438 |
struct llink *h,*t; |
| 439 |
int multip; /* # of copies in a single chain */ |
| 440 |
size_t ssize; /* size of each small element */ |
| 441 |
int count; /* number of elements on the list */ |
| 442 |
}; |
| 443 |
|
| 444 |
|
| 445 |
/* Lists */ |
| 446 |
|
| 447 |
struct llist *llist_new( int multip, size_t ssize ); |
| 448 |
void llist_destroy( struct llist *l ); |
| 449 |
void llist_push( struct llist *l, const void *data ); |
| 450 |
void llist_dump( struct llist *l ); |
| 451 |
int llist_pop( struct llist *l,void *data ); |
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
/* Octtree */ |
| 457 |
|
| 458 |
struct octt { |
| 459 |
struct octt *t[8]; |
| 460 |
int cnt; |
| 461 |
}; |
| 462 |
|
| 463 |
struct octt *octt_new(void); |
| 464 |
int octt_add(struct octt *ct,unsigned char r,unsigned char g,unsigned char b); |
| 465 |
void octt_dump(struct octt *ct); |
| 466 |
void octt_count(struct octt *ct,int *tot,int max,int *overflow); |
| 467 |
void octt_delete(struct octt *ct); |
| 468 |
void octt_histo(struct octt *ct, unsigned int **col_usage_it_adr); |
| 469 |
|
| 470 |
/* font bounding box results */ |
| 471 |
enum bounding_box_index_t { |
| 472 |
BBOX_NEG_WIDTH, |
| 473 |
BBOX_GLOBAL_DESCENT, |
| 474 |
BBOX_POS_WIDTH, |
| 475 |
BBOX_GLOBAL_ASCENT, |
| 476 |
BBOX_DESCENT, |
| 477 |
BBOX_ASCENT, |
| 478 |
BBOX_ADVANCE_WIDTH, |
| 479 |
BBOX_RIGHT_BEARING, |
| 480 |
BOUNDING_BOX_COUNT |
| 481 |
}; |
| 482 |
|
| 483 |
/* |
| 484 |
=item i_polygon_t |
| 485 |
=category Data Types |
| 486 |
|
| 487 |
Represents a polygon. Has the following members: |
| 488 |
|
| 489 |
=over |
| 490 |
|
| 491 |
=item * |
| 492 |
|
| 493 |
C<x>, C<y> - arrays of x and y locations of vertices. |
| 494 |
|
| 495 |
=item * |
| 496 |
|
| 497 |
C<count> - the number of entries in the C<x> and C<y> arrays. |
| 498 |
|
| 499 |
=back |
| 500 |
|
| 501 |
=cut |
| 502 |
*/ |
| 503 |
|
| 504 |
typedef struct i_polygon_tag { |
| 505 |
const double *x; |
| 506 |
const double *y; |
| 507 |
size_t count; |
| 508 |
} i_polygon_t; |
| 509 |
|
| 510 |
/* |
| 511 |
=item i_poly_fill_mode_t |
| 512 |
=category Data Types |
| 513 |
|
| 514 |
Control how polygons are filled. Has the following values: |
| 515 |
|
| 516 |
=over |
| 517 |
|
| 518 |
=item * |
| 519 |
|
| 520 |
C<i_pfm_evenodd> - simple even-odd fills. |
| 521 |
|
| 522 |
=item * |
| 523 |
|
| 524 |
C<i_pfm_nonzero> - non-zero winding rule fills. |
| 525 |
|
| 526 |
=back |
| 527 |
|
| 528 |
=cut |
| 529 |
*/ |
| 530 |
|
| 531 |
typedef enum i_poly_fill_mode_tag { |
| 532 |
i_pfm_evenodd, |
| 533 |
i_pfm_nonzero |
| 534 |
} i_poly_fill_mode_t; |
| 535 |
|
| 536 |
/* Generic fills */ |
| 537 |
struct i_fill_tag; |
| 538 |
|
| 539 |
typedef void (*i_fill_with_color_f) |
| 540 |
(struct i_fill_tag *fill, i_img_dim x, i_img_dim y, i_img_dim width, int channels, |
| 541 |
i_color *data); |
| 542 |
typedef void (*i_fill_with_fcolor_f) |
| 543 |
(struct i_fill_tag *fill, i_img_dim x, i_img_dim y, i_img_dim width, int channels, |
| 544 |
i_fcolor *data); |
| 545 |
typedef void (*i_fill_destroy_f)(struct i_fill_tag *fill); |
| 546 |
|
| 547 |
/* combine functions modify their target and are permitted to modify |
| 548 |
the source to prevent having to perform extra copying/memory |
| 549 |
allocations, etc |
| 550 |
The out array has I<channels> channels. |
| 551 |
|
| 552 |
The in array has I<channels> channels + an alpha channel if one |
| 553 |
isn't included in I<channels>. |
| 554 |
*/ |
| 555 |
|
| 556 |
typedef void (*i_fill_combine_f)(i_color *out, i_color *in, int channels, |
| 557 |
i_img_dim count); |
| 558 |
typedef void (*i_fill_combinef_f)(i_fcolor *out, i_fcolor *in, int channels, |
| 559 |
i_img_dim count); |
| 560 |
|
| 561 |
/* fountain fill types */ |
| 562 |
typedef enum { |
| 563 |
i_fst_linear, |
| 564 |
i_fst_curved, |
| 565 |
i_fst_sine, |
| 566 |
i_fst_sphere_up, |
| 567 |
i_fst_sphere_down, |
| 568 |
i_fst_end |
| 569 |
} i_fountain_seg_type; |
| 570 |
typedef enum { |
| 571 |
i_fc_direct, |
| 572 |
i_fc_hue_up, |
| 573 |
i_fc_hue_down, |
| 574 |
i_fc_end |
| 575 |
} i_fountain_color; |
| 576 |
typedef struct { |
| 577 |
double start, middle, end; |
| 578 |
i_fcolor c[2]; |
| 579 |
i_fountain_seg_type type; |
| 580 |
i_fountain_color color; |
| 581 |
} i_fountain_seg; |
| 582 |
typedef enum { |
| 583 |
i_fr_none, |
| 584 |
i_fr_sawtooth, |
| 585 |
i_fr_triangle, |
| 586 |
i_fr_saw_both, |
| 587 |
i_fr_tri_both |
| 588 |
} i_fountain_repeat; |
| 589 |
typedef enum { |
| 590 |
i_ft_linear, |
| 591 |
i_ft_bilinear, |
| 592 |
i_ft_radial, |
| 593 |
i_ft_radial_square, |
| 594 |
i_ft_revolution, |
| 595 |
i_ft_conical, |
| 596 |
i_ft_end |
| 597 |
} i_fountain_type; |
| 598 |
typedef enum { |
| 599 |
i_fts_none, |
| 600 |
i_fts_grid, |
| 601 |
i_fts_random, |
| 602 |
i_fts_circle |
| 603 |
} i_ft_supersample; |
| 604 |
|
| 605 |
/* |
| 606 |
=item i_fill_t |
| 607 |
=category Data Types |
| 608 |
=synopsis i_fill_t *fill; |
| 609 |
|
| 610 |
This is the "abstract" base type for Imager's fill types. |
| 611 |
|
| 612 |
Unless you're implementing a new fill type you'll typically treat this |
| 613 |
as an opaque type. |
| 614 |
|
| 615 |
=cut |
| 616 |
*/ |
| 617 |
|
| 618 |
typedef struct i_fill_tag |
| 619 |
{ |
| 620 |
/* called for 8-bit/sample image (and maybe lower) */ |
| 621 |
/* this may be NULL, if so call fill_with_fcolor */ |
| 622 |
i_fill_with_color_f f_fill_with_color; |
| 623 |
|
| 624 |
/* called for other sample sizes */ |
| 625 |
/* this must be non-NULL */ |
| 626 |
i_fill_with_fcolor_f f_fill_with_fcolor; |
| 627 |
|
| 628 |
/* called if non-NULL to release any extra resources */ |
| 629 |
i_fill_destroy_f destroy; |
| 630 |
|
| 631 |
/* if non-zero the caller will fill data with the original data |
| 632 |
from the image */ |
| 633 |
i_fill_combine_f combine; |
| 634 |
i_fill_combinef_f combinef; |
| 635 |
} i_fill_t; |
| 636 |
|
| 637 |
typedef enum { |
| 638 |
ic_none, |
| 639 |
ic_normal, |
| 640 |
ic_multiply, |
| 641 |
ic_dissolve, |
| 642 |
ic_add, |
| 643 |
ic_subtract, |
| 644 |
ic_diff, |
| 645 |
ic_lighten, |
| 646 |
ic_darken, |
| 647 |
ic_hue, |
| 648 |
ic_sat, |
| 649 |
ic_value, |
| 650 |
ic_color |
| 651 |
} i_combine_t; |
| 652 |
|
| 653 |
/* |
| 654 |
=item i_mutex_t |
| 655 |
X<i_mutex> |
| 656 |
=category mutex |
| 657 |
=synopsis i_mutex_t mutex; |
| 658 |
|
| 659 |
Opaque type for Imager's mutex API. |
| 660 |
|
| 661 |
=cut |
| 662 |
*/ |
| 663 |
typedef struct i_mutex_tag *i_mutex_t; |
| 664 |
|
| 665 |
/* |
| 666 |
describes an axis of a MM font. |
| 667 |
Modelled on FT2's FT_MM_Axis. |
| 668 |
It would be nice to have a default entry too, but FT2 |
| 669 |
doesn't support it. |
| 670 |
*/ |
| 671 |
typedef struct i_font_mm_axis_tag { |
| 672 |
char const *name; |
| 673 |
int minimum; |
| 674 |
int maximum; |
| 675 |
} i_font_mm_axis; |
| 676 |
|
| 677 |
#define IM_FONT_MM_MAX_AXES 4 |
| 678 |
|
| 679 |
/* |
| 680 |
multiple master information for a font, if any |
| 681 |
modelled on FT2's FT_Multi_Master. |
| 682 |
*/ |
| 683 |
typedef struct i_font_mm_tag { |
| 684 |
int num_axis; |
| 685 |
int num_designs; /* provided but not necessarily useful */ |
| 686 |
i_font_mm_axis axis[IM_FONT_MM_MAX_AXES]; |
| 687 |
} i_font_mm; |
| 688 |
|
| 689 |
#ifdef HAVE_LIBTT |
| 690 |
|
| 691 |
struct TT_Fonthandle_; |
| 692 |
|
| 693 |
typedef struct TT_Fonthandle_ TT_Fonthandle; |
| 694 |
|
| 695 |
#endif |
| 696 |
|
| 697 |
/* |
| 698 |
=item i_transp |
| 699 |
=category Data Types |
| 700 |
|
| 701 |
An enumerated type for controlling how transparency is handled during |
| 702 |
quantization. |
| 703 |
|
| 704 |
This has the following possible values: |
| 705 |
|
| 706 |
=over |
| 707 |
|
| 708 |
=item * |
| 709 |
|
| 710 |
C<tr_none> - ignore the alpha channel |
| 711 |
|
| 712 |
=item * |
| 713 |
|
| 714 |
C<tr_threshold> - simple transparency thresholding. |
| 715 |
|
| 716 |
=item * |
| 717 |
|
| 718 |
C<tr_errdiff> - use error diffusion to control which pixels are |
| 719 |
transparent. |
| 720 |
|
| 721 |
=item * |
| 722 |
|
| 723 |
C<tr_ordered> - use ordered dithering to control which pixels are |
| 724 |
transparent. |
| 725 |
|
| 726 |
=back |
| 727 |
|
| 728 |
=cut |
| 729 |
*/ |
| 730 |
|
| 731 |
/* transparency handling for quantized output */ |
| 732 |
typedef enum i_transp_tag { |
| 733 |
tr_none, /* ignore any alpha channel */ |
| 734 |
tr_threshold, /* threshold the transparency - uses tr_threshold */ |
| 735 |
tr_errdiff, /* error diffusion */ |
| 736 |
tr_ordered /* an ordered dither */ |
| 737 |
} i_transp; |
| 738 |
|
| 739 |
/* |
| 740 |
=item i_make_colors |
| 741 |
=category Data Types |
| 742 |
|
| 743 |
An enumerated type used to control the method used for produce the |
| 744 |
color map: |
| 745 |
|
| 746 |
=over |
| 747 |
|
| 748 |
=item * |
| 749 |
|
| 750 |
C<mc_none> - the user supplied map is used. |
| 751 |
|
| 752 |
=item * |
| 753 |
|
| 754 |
C<mc_web_map> - use the classic web map. Any existing fixed colors |
| 755 |
are ignored. |
| 756 |
|
| 757 |
=item * |
| 758 |
|
| 759 |
C<mc_median_cut> - use median cut |
| 760 |
|
| 761 |
=item * |
| 762 |
|
| 763 |
C<mono> - use a fixed black and white map. |
| 764 |
|
| 765 |
=item * |
| 766 |
|
| 767 |
C<gray> - 256 step gray map. |
| 768 |
|
| 769 |
=item * |
| 770 |
|
| 771 |
C<gray4> - 4 step gray map. |
| 772 |
|
| 773 |
=item * |
| 774 |
|
| 775 |
C<gray16> - 16 step gray map. |
| 776 |
|
| 777 |
=back |
| 778 |
|
| 779 |
=cut |
| 780 |
*/ |
| 781 |
|
| 782 |
typedef enum i_make_colors_tag { |
| 783 |
mc_none, /* user supplied colour map only */ |
| 784 |
mc_web_map, /* Use the 216 colour web colour map */ |
| 785 |
mc_addi, /* Addi's algorithm */ |
| 786 |
mc_median_cut, /* median cut - similar to giflib, hopefully */ |
| 787 |
mc_mono, /* fixed mono color map */ |
| 788 |
mc_gray, /* 256 gray map */ |
| 789 |
mc_gray4, /* four step gray map */ |
| 790 |
mc_gray16, /* sixteen step gray map */ |
| 791 |
mc_mask = 0xFF /* (mask for generator) */ |
| 792 |
} i_make_colors; |
| 793 |
|
| 794 |
/* |
| 795 |
=item i_translate |
| 796 |
=category Data Types |
| 797 |
|
| 798 |
An enumerated type that controls how colors are translated: |
| 799 |
|
| 800 |
=over |
| 801 |
|
| 802 |
=item * |
| 803 |
|
| 804 |
C<pt_giflib> - obsolete, forces C<make_colors> to use median cut and |
| 805 |
acts like C<pt_closest>. |
| 806 |
|
| 807 |
=item * |
| 808 |
|
| 809 |
C<pt_closest> - always use the closest color. |
| 810 |
|
| 811 |
=item * |
| 812 |
|
| 813 |
C<pt_perturb> - add random values to each sample and find the closest |
| 814 |
color. |
| 815 |
|
| 816 |
=item * |
| 817 |
|
| 818 |
C<pt_errdiff> - error diffusion dither. |
| 819 |
|
| 820 |
=back |
| 821 |
|
| 822 |
=cut |
| 823 |
*/ |
| 824 |
|
| 825 |
/* controls how we translate the colours */ |
| 826 |
typedef enum i_translate_tag { |
| 827 |
pt_giflib, /* get gif lib to do it (ignores make_colours) */ |
| 828 |
pt_closest, /* just use the closest match within the hashbox */ |
| 829 |
pt_perturb, /* randomly perturb the data - uses perturb_size*/ |
| 830 |
pt_errdiff /* error diffusion dither - uses errdiff */ |
| 831 |
} i_translate; |
| 832 |
|
| 833 |
/* |
| 834 |
=item i_errdiff |
| 835 |
=category Data Types |
| 836 |
|
| 837 |
Controls the type of error diffusion to use: |
| 838 |
|
| 839 |
=over |
| 840 |
|
| 841 |
=item * |
| 842 |
|
| 843 |
C<ed_floyd> - floyd-steinberg |
| 844 |
|
| 845 |
=item * |
| 846 |
|
| 847 |
C<ed_jarvis> - Jarvis, Judice and Ninke |
| 848 |
|
| 849 |
=item * |
| 850 |
|
| 851 |
C<ed_stucki> - Stucki |
| 852 |
|
| 853 |
=item * |
| 854 |
|
| 855 |
C<ed_custom> - not usable for transparency dithering, allows a custom |
| 856 |
error diffusion map to be used. |
| 857 |
|
| 858 |
=item * |
| 859 |
|
| 860 |
C<ed_bidir> - or with the error diffusion type to use alternate |
| 861 |
directions on each line of the dither. |
| 862 |
|
| 863 |
=back |
| 864 |
|
| 865 |
=cut |
| 866 |
*/ |
| 867 |
|
| 868 |
/* Which error diffusion map to use */ |
| 869 |
typedef enum i_errdiff_tag { |
| 870 |
ed_floyd, /* floyd-steinberg */ |
| 871 |
ed_jarvis, /* Jarvis, Judice and Ninke */ |
| 872 |
ed_stucki, /* Stucki */ |
| 873 |
ed_custom, /* the map found in ed_map|width|height|orig */ |
| 874 |
ed_mask = 0xFF, /* mask to get the map */ |
| 875 |
ed_bidir = 0x100 /* change direction for each row */ |
| 876 |
} i_errdiff; |
| 877 |
|
| 878 |
/* |
| 879 |
=item i_ord_dith |
| 880 |
=category Data Types |
| 881 |
|
| 882 |
Which ordered dither map to use, currently only available for |
| 883 |
transparency. Values are: |
| 884 |
|
| 885 |
=over |
| 886 |
|
| 887 |
=item * |
| 888 |
|
| 889 |
C<od_random> - a pre-generated random map. |
| 890 |
|
| 891 |
=item * |
| 892 |
|
| 893 |
C<od_dot8> - large dot dither. |
| 894 |
|
| 895 |
=item * |
| 896 |
|
| 897 |
C<od_dot4> - smaller dot dither |
| 898 |
|
| 899 |
=item * |
| 900 |
|
| 901 |
C<od_hline> - horizontal line dither. |
| 902 |
|
| 903 |
=item * |
| 904 |
|
| 905 |
C<od_vline> - vertical line dither. |
| 906 |
|
| 907 |
=item * |
| 908 |
|
| 909 |
C<od_slashline> - C</> line dither. |
| 910 |
|
| 911 |
=item * |
| 912 |
|
| 913 |
C<od_backline> - C<\> line dither. |
| 914 |
|
| 915 |
=item * |
| 916 |
|
| 917 |
C<od_tiny> - small checkbox dither |
| 918 |
|
| 919 |
=item * |
| 920 |
|
| 921 |
C<od_custom> - custom dither map. |
| 922 |
|
| 923 |
=back |
| 924 |
|
| 925 |
=cut |
| 926 |
|
| 927 |
I don't know of a way to do ordered dither of an image against some |
| 928 |
general palette |
| 929 |
*/ |
| 930 |
typedef enum i_ord_dith_tag |
| 931 |
{ |
| 932 |
od_random, /* sort of random */ |
| 933 |
od_dot8, /* large dot */ |
| 934 |
od_dot4, |
| 935 |
od_hline, |
| 936 |
od_vline, |
| 937 |
od_slashline, /* / line dither */ |
| 938 |
od_backline, /* \ line dither */ |
| 939 |
od_tiny, /* small checkerbox */ |
| 940 |
od_custom /* custom 8x8 map */ |
| 941 |
} i_ord_dith; |
| 942 |
|
| 943 |
/* |
| 944 |
=item i_quantize |
| 945 |
=category Data Types |
| 946 |
|
| 947 |
A structure type used to supply image quantization, ie. when |
| 948 |
converting a direct color image to a paletted image. |
| 949 |
|
| 950 |
This has the following members: |
| 951 |
|
| 952 |
=over |
| 953 |
|
| 954 |
=item * |
| 955 |
|
| 956 |
C<transp> - how to handle transparency, see L</i_transp>. |
| 957 |
|
| 958 |
=item * |
| 959 |
|
| 960 |
C<threshold> - when C<transp> is C<tr_threshold>, this is the alpha |
| 961 |
level at which pixels become transparent. |
| 962 |
|
| 963 |
=item * |
| 964 |
|
| 965 |
C<tr_errdiff> - when C<transp> is C<tr_errdiff> this controls the type |
| 966 |
of error diffusion to be done. This may not be C<ed_custom> for this |
| 967 |
member. |
| 968 |
|
| 969 |
=item * |
| 970 |
|
| 971 |
C<tr_orddith> - when C<transp> is C<tr_ordered> this controls the |
| 972 |
patten used for dithering transparency. |
| 973 |
|
| 974 |
=item * |
| 975 |
|
| 976 |
C<tr_custom> - when C<tr_orddith> is C<tr_custom> this is the ordered |
| 977 |
dither mask. |
| 978 |
|
| 979 |
=item * |
| 980 |
|
| 981 |
C<make_colors> - the method used to generate the color palette, see |
| 982 |
L</i_make_colors>. |
| 983 |
|
| 984 |
=item * |
| 985 |
|
| 986 |
C<mc_colors> - an array of C<mc_size> L</i_color> entries used to |
| 987 |
define the fixed colors (controlled by C<mc_count> and to return the |
| 988 |
generated color list. |
| 989 |
|
| 990 |
=item * |
| 991 |
|
| 992 |
C<mc_size> - the size of the buffer allocated to C<mc_colors> in |
| 993 |
C<sizeof(i_color)> units. |
| 994 |
|
| 995 |
=item * |
| 996 |
|
| 997 |
C<mc_count> - the number of initialized colors in C<mc_colors>. |
| 998 |
|
| 999 |
=item * |
| 1000 |
|
| 1001 |
C<translate> - how RGB colors are translated to palette indexes, see |
| 1002 |
L</i_translate>. |
| 1003 |
|
| 1004 |
=item * |
| 1005 |
|
| 1006 |
C<errdiff> - when C<translate> is C<pt_errdiff> this controls the type |
| 1007 |
of error diffusion to be done. |
| 1008 |
|
| 1009 |
=item * |
| 1010 |
|
| 1011 |
C<ed_map>, C<ed_width>, C<ed_height>, C<ed_orig> - when C<errdiff> is |
| 1012 |
C<ed_custom> this controls the error diffusion map. C<ed_map> is an |
| 1013 |
array of C<ed_width * ed_height> integers. C<ed_orig> is the position |
| 1014 |
of the current pixel in the error diffusion map, always on the top |
| 1015 |
row. |
| 1016 |
|
| 1017 |
=item * |
| 1018 |
|
| 1019 |
C<perturb> - the amount to perturb pixels when C<translate> is |
| 1020 |
C<mc_perturb>. |
| 1021 |
|
| 1022 |
=back |
| 1023 |
|
| 1024 |
=cut |
| 1025 |
*/ |
| 1026 |
typedef struct i_quantize_tag { |
| 1027 |
int version; |
| 1028 |
|
| 1029 |
/* how to handle transparency */ |
| 1030 |
i_transp transp; |
| 1031 |
/* the threshold at which to make pixels opaque */ |
| 1032 |
int tr_threshold; |
| 1033 |
i_errdiff tr_errdiff; |
| 1034 |
i_ord_dith tr_orddith; |
| 1035 |
unsigned char tr_custom[64]; |
| 1036 |
|
| 1037 |
/* how to make the colour map */ |
| 1038 |
i_make_colors make_colors; |
| 1039 |
|
| 1040 |
/* any existing colours |
| 1041 |
mc_existing is an existing colour table |
| 1042 |
mc_count is the number of existing colours |
| 1043 |
mc_size is the total size of the array that mc_existing points |
| 1044 |
at - this must be at least 256 |
| 1045 |
*/ |
| 1046 |
i_color *mc_colors; |
| 1047 |
int mc_size; |
| 1048 |
int mc_count; |
| 1049 |
|
| 1050 |
/* how we translate the colours */ |
| 1051 |
i_translate translate; |
| 1052 |
|
| 1053 |
/* the error diffusion map to use if translate is mc_errdiff */ |
| 1054 |
i_errdiff errdiff; |
| 1055 |
/* the following define the error diffusion values to use if |
| 1056 |
errdiff is ed_custom. ed_orig is the column on the top row that |
| 1057 |
represents the current |
| 1058 |
*/ |
| 1059 |
int *ed_map; |
| 1060 |
int ed_width, ed_height, ed_orig; |
| 1061 |
|
| 1062 |
/* the amount of perturbation to use for translate is mc_perturb */ |
| 1063 |
int perturb; |
| 1064 |
/* version 2 members after here */ |
| 1065 |
} i_quantize; |
| 1066 |
|
| 1067 |
/* distance measures used by some filters */ |
| 1068 |
enum { |
| 1069 |
i_dmeasure_euclidean = 0, |
| 1070 |
i_dmeasure_euclidean_squared = 1, |
| 1071 |
i_dmeasure_manhatten = 2, |
| 1072 |
i_dmeasure_limit = 2, |
| 1073 |
}; |
| 1074 |
|
| 1075 |
#include "iolayert.h" |
| 1076 |
|
| 1077 |
/* error message information returned by im_errors() */ |
| 1078 |
|
| 1079 |
typedef struct { |
| 1080 |
char *msg; |
| 1081 |
int code; |
| 1082 |
} i_errmsg; |
| 1083 |
|
| 1084 |
typedef struct i_render_tag i_render; |
| 1085 |
|
| 1086 |
/* trim colors for im_trim()/im_trim_dim() */ |
| 1087 |
|
| 1088 |
typedef struct { |
| 1089 |
int is_float; |
| 1090 |
i_color c1, c2; |
| 1091 |
i_fcolor cf1, cf2; |
| 1092 |
} i_trim_colors_t; |
| 1093 |
|
| 1094 |
/* |
| 1095 |
=item i_color_model_t |
| 1096 |
=category Data Types |
| 1097 |
=order 95 |
| 1098 |
|
| 1099 |
Returned by L</i_img_color_model(im)> to indicate the color model of |
| 1100 |
the image. |
| 1101 |
|
| 1102 |
An enumerated type with the following possible values: |
| 1103 |
|
| 1104 |
=over |
| 1105 |
|
| 1106 |
=item * |
| 1107 |
|
| 1108 |
C<icm_unknown> - the image has no usable color data. In future |
| 1109 |
versions of Imager this will be returned in a few limited cases, |
| 1110 |
eg. when the source image is CMYK and the user has requested no color |
| 1111 |
translation is done. |
| 1112 |
|
| 1113 |
=item * |
| 1114 |
|
| 1115 |
C<icm_gray> - gray scale with no alpha channel. |
| 1116 |
|
| 1117 |
=item * |
| 1118 |
|
| 1119 |
C<icm_gray_alpha> - gray scale with an alpha channel. |
| 1120 |
|
| 1121 |
=item * |
| 1122 |
|
| 1123 |
C<icm_rgb> - RGB |
| 1124 |
|
| 1125 |
=item * |
| 1126 |
|
| 1127 |
C<icm_rgb_alpha> - RGB with an alpha channel. |
| 1128 |
|
| 1129 |
=back |
| 1130 |
|
| 1131 |
=cut |
| 1132 |
*/ |
| 1133 |
|
| 1134 |
typedef enum { |
| 1135 |
icm_unknown, |
| 1136 |
icm_gray, |
| 1137 |
icm_gray_alpha, |
| 1138 |
icm_rgb, |
| 1139 |
icm_rgb_alpha |
| 1140 |
} i_color_model_t; |
| 1141 |
|
| 1142 |
#ifdef IMAGER_FORMAT_ATTR |
| 1143 |
#define I_FORMAT_ATTR(format_index, va_index) \ |
| 1144 |
__attribute ((format (printf, format_index, va_index))) |
| 1145 |
#else |
| 1146 |
#define I_FORMAT_ATTR(format_index, va_index) |
| 1147 |
#endif |
| 1148 |
|
| 1149 |
#ifdef _MSC_VER |
| 1150 |
# ifndef vsnprintf |
| 1151 |
# define vsnprintf _vsnprintf |
| 1152 |
# endif |
| 1153 |
# ifndef snprintf |
| 1154 |
# define snprintf _snprintf |
| 1155 |
# endif |
| 1156 |
#endif |
| 1157 |
|
| 1158 |
/* |
| 1159 |
=item i_DF |
| 1160 |
=category Data Types |
| 1161 |
=synopsis printf("left %" i_DF "\n", i_DFc(x)); |
| 1162 |
=order 95 |
| 1163 |
|
| 1164 |
This is a constant string that can be used with functions like |
| 1165 |
printf() to format i_img_dim values after they're been cast with i_DFc(). |
| 1166 |
|
| 1167 |
Does not include the leading C<%>. |
| 1168 |
|
| 1169 |
=cut |
| 1170 |
|
| 1171 |
=item i_DFc |
| 1172 |
=category Data Types |
| 1173 |
=order 95 |
| 1174 |
|
| 1175 |
Cast an C<i_img_dim> value to a type for use with the i_DF format |
| 1176 |
string. |
| 1177 |
|
| 1178 |
=cut |
| 1179 |
|
| 1180 |
=item i_DFp |
| 1181 |
=category Data Types |
| 1182 |
=synopsis printf("point (" i_DFp ")\n", i_DFcp(x, y)); |
| 1183 |
=order 95 |
| 1184 |
|
| 1185 |
Format a pair of C<i_img_dim> values. This format string I<does> |
| 1186 |
include the leading C<%>. |
| 1187 |
|
| 1188 |
=cut |
| 1189 |
|
| 1190 |
=item i_DFcp |
| 1191 |
=category Data Types |
| 1192 |
=order 95 |
| 1193 |
|
| 1194 |
Casts two C<i_img_dim> values for use with the i_DF (or i_DFp) format. |
| 1195 |
|
| 1196 |
=cut |
| 1197 |
*/ |
| 1198 |
|
| 1199 |
#define i_DFc(x) ((i_dim_format_t)(x)) |
| 1200 |
#define i_DFcp(x, y) i_DFc(x), i_DFc(y) |
| 1201 |
#define i_DFp "%" i_DF ", %" i_DF |
| 1202 |
|
| 1203 |
#ifdef __cplusplus |
| 1204 |
} |
| 1205 |
#endif |
| 1206 |
|
| 1207 |
#endif |
| 1208 |
|