]> git.imager.perl.org - imager.git/blob - palimg.c
don't define mm_log() with IMAGER_NO_CONTEXT
[imager.git] / palimg.c
1 /*
2 =head1 NAME
3
4   palimg.c - implements paletted images for Imager.
5
6 =head1 SYNOPSIS
7
8 =head1 DESCRIPTION
9
10 Implements paletted images using the new image interface.
11
12 =over
13
14 =item IIM_base_8bit_pal
15
16 Basic 8-bit/sample paletted image
17
18 =cut
19 */
20
21 #define IMAGER_NO_CONTEXT
22
23 #include "imager.h"
24 #include "imageri.h"
25
26 #define PALEXT(im) ((i_img_pal_ext*)((im)->ext_data))
27 static int i_ppix_p(i_img *im, i_img_dim x, i_img_dim y, const i_color *val);
28 static int i_gpix_p(i_img *im, i_img_dim x, i_img_dim y, i_color *val);
29 static i_img_dim i_glin_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_color *vals);
30 static i_img_dim i_plin_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, const i_color *vals);
31 static i_img_dim i_gsamp_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_sample_t *samps, int const *chans, int chan_count);
32 static i_img_dim i_gpal_p(i_img *pm, i_img_dim l, i_img_dim r, i_img_dim y, i_palidx *vals);
33 static i_img_dim i_ppal_p(i_img *pm, i_img_dim l, i_img_dim r, i_img_dim y, const i_palidx *vals);
34 static int i_addcolors_p(i_img *im, const i_color *color, int count);
35 static int i_getcolors_p(i_img *im, int i, i_color *color, int count);
36 static int i_colorcount_p(i_img *im);
37 static int i_maxcolors_p(i_img *im);
38 static int i_findcolor_p(i_img *im, const i_color *color, i_palidx *entry);
39 static int i_setcolors_p(i_img *im, int index, const i_color *color, int count);
40
41 static void i_destroy_p(i_img *im);
42 static i_img_dim 
43 i_psamp_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, const i_sample_t *samps, const int *chans, int chan_count);
44 static i_img_dim 
45 i_psampf_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, const i_fsample_t *samps, const int *chans, int chan_count);
46
47 static i_img IIM_base_8bit_pal =
48 {
49   0, /* channels set */
50   0, 0, 0, /* xsize, ysize, bytes */
51   ~0U, /* ch_mask */
52   i_8_bits, /* bits */
53   i_palette_type, /* type */
54   0, /* virtual */
55   NULL, /* idata */
56   { 0, 0, NULL }, /* tags */
57   NULL, /* ext_data */
58
59   i_ppix_p, /* i_f_ppix */
60   i_ppixf_fp, /* i_f_ppixf */
61   i_plin_p, /* i_f_plin */
62   i_plinf_fp, /* i_f_plinf */
63   i_gpix_p, /* i_f_gpix */
64   i_gpixf_fp, /* i_f_gpixf */
65   i_glin_p, /* i_f_glin */
66   i_glinf_fp, /* i_f_glinf */
67   i_gsamp_p, /* i_f_gsamp */
68   i_gsampf_fp, /* i_f_gsampf */
69
70   i_gpal_p, /* i_f_gpal */
71   i_ppal_p, /* i_f_ppal */
72   i_addcolors_p, /* i_f_addcolors */
73   i_getcolors_p, /* i_f_getcolors */
74   i_colorcount_p, /* i_f_colorcount */
75   i_maxcolors_p, /* i_f_maxcolors */
76   i_findcolor_p, /* i_f_findcolor */
77   i_setcolors_p, /* i_f_setcolors */
78
79   i_destroy_p, /* i_f_destroy */
80
81   i_gsamp_bits_fb,
82   NULL, /* i_f_psamp_bits */
83   
84   i_psamp_p,
85   i_psampf_p
86 };
87
88 /*
89 =item i_img_pal_new(C<x>, C<y>, C<channels>, C<maxpal>)
90
91 =category Image creation/destruction
92 =synopsis i_img *img = i_img_pal_new(width, height, channels, max_palette_size)
93
94 Creates a new paletted image of the supplied dimensions.
95
96 C<maxpal> is the maximum palette size and should normally be 256.
97
98 Returns a new image or NULL on failure.
99
100 =cut
101 */
102 i_img *
103 im_img_pal_new(pIMCTX, i_img_dim x, i_img_dim y, int channels, int maxpal) {
104   i_img *im;
105   i_img_pal_ext *palext;
106   size_t bytes, line_bytes;
107
108   i_clear_error();
109   if (maxpal < 1 || maxpal > 256) {
110     i_push_error(0, "Maximum of 256 palette entries");
111     return NULL;
112   }
113   if (x < 1 || y < 1) {
114     i_push_error(0, "Image sizes must be positive");
115     return NULL;
116   }
117   if (channels < 1 || channels > MAXCHANNELS) {
118     im_push_errorf(aIMCTX, 0, "Channels must be positive and <= %d", MAXCHANNELS);
119     return NULL;
120   }
121   bytes = sizeof(i_palidx) * x * y;
122   if (bytes / y / sizeof(i_palidx) != x) {
123     i_push_error(0, "integer overflow calculating image allocation");
124     return NULL;
125   }
126
127   /* basic assumption: we can always allocate a buffer representing a
128      line from the image, otherwise we're going to have trouble
129      working with the image */
130   line_bytes = sizeof(i_color) * x;
131   if (line_bytes / x != sizeof(i_color)) {
132     i_push_error(0, "integer overflow calculating scanline allocation");
133     return NULL;
134   }
135
136   im = i_img_alloc();
137   memcpy(im, &IIM_base_8bit_pal, sizeof(i_img));
138   palext = mymalloc(sizeof(i_img_pal_ext));
139   palext->pal = mymalloc(sizeof(i_color) * maxpal);
140   palext->count = 0;
141   palext->alloc = maxpal;
142   palext->last_found = -1;
143   im->ext_data = palext;
144   i_tags_new(&im->tags);
145   im->bytes = bytes;
146   im->idata = mymalloc(im->bytes);
147   im->channels = channels;
148   memset(im->idata, 0, im->bytes);
149   im->xsize = x;
150   im->ysize = y;
151
152   i_img_init(im);
153   
154   return im;
155 }
156
157 /*
158 =item i_img_rgb_convert(i_img *targ, i_img *src)
159
160 Converts paletted data in src to RGB data in targ
161
162 Internal function.
163
164 src must be a paletted image and targ must be an RGB image with the
165 same width, height and channels.
166
167 =cut
168 */
169 static void i_img_rgb_convert(i_img *targ, i_img *src) {
170   i_color *row = mymalloc(sizeof(i_color) * targ->xsize);
171   i_img_dim y;
172   for (y = 0; y < targ->ysize; ++y) {
173     i_glin(src, 0, src->xsize, y, row);
174     i_plin(targ, 0, src->xsize, y, row);
175   }
176   myfree(row);
177 }
178
179 /*
180 =item i_img_to_rgb_inplace(im)
181
182 Converts im from a paletted image to an RGB image.
183
184 The conversion is done in place.
185
186 The conversion cannot be done for virtual images.
187
188 =cut
189 */
190 int
191 i_img_to_rgb_inplace(i_img *im) {
192   i_img temp;
193   dIMCTXim(im);
194
195   if (im->virtual)
196     return 0;
197
198   if (im->type == i_direct_type)
199     return 1; /* trivial success */
200
201   i_img_empty_ch(&temp, im->xsize, im->ysize, im->channels);
202   i_img_rgb_convert(&temp, im);
203
204   /* nasty hack */
205   (im->i_f_destroy)(im);
206   myfree(im->idata);
207   *im = temp;
208
209   return 1;
210 }
211
212 /*
213 =item i_img_to_pal(i_img *im, i_quantize *quant)
214
215 Converts an RGB image to a paletted image
216
217 =cut
218 */
219 i_img *i_img_to_pal(i_img *src, i_quantize *quant) {
220   i_palidx *result;
221   i_img *im;
222   dIMCTXim(src);
223
224   i_clear_error();
225   
226   i_quant_makemap(quant, &src, 1);
227   result = i_quant_translate(quant, src);
228
229   if (result) {
230
231     im = i_img_pal_new(src->xsize, src->ysize, src->channels, quant->mc_size);
232
233     /* copy things over */
234     memcpy(im->idata, result, im->bytes);
235     PALEXT(im)->count = quant->mc_count;
236     memcpy(PALEXT(im)->pal, quant->mc_colors, sizeof(i_color) * quant->mc_count);
237     
238     myfree(result);
239
240     return im;
241   }
242   else {
243     return NULL;
244   }
245 }
246
247 /*
248 =item i_img_to_rgb(i_img *src)
249
250 =cut
251 */
252 i_img *
253 i_img_to_rgb(i_img *src) {
254   dIMCTXim(src);
255   i_img *im = i_img_empty_ch(NULL, src->xsize, src->ysize, src->channels);
256   i_img_rgb_convert(im, src);
257
258   return im;
259 }
260
261 /*
262 =item i_destroy_p(i_img *im)
263
264 Destroys data related to a paletted image.
265
266 =cut
267 */
268 static void i_destroy_p(i_img *im) {
269   if (im) {
270     i_img_pal_ext *palext = im->ext_data;
271     if (palext) {
272       if (palext->pal)
273         myfree(palext->pal);
274       myfree(palext);
275     }
276   }
277 }
278
279 /*
280 =item i_ppix_p(i_img *im, i_img_dim x, i_img_dim y, const i_color *val)
281
282 Write to a pixel in the image.
283
284 Warning: converts the image to a RGB image if the color isn't already
285 present in the image.
286
287 =cut
288 */
289 static int 
290 i_ppix_p(i_img *im, i_img_dim x, i_img_dim y, const i_color *val) {
291   const i_color *work_val = val;
292   i_color workc;
293   i_palidx which;
294   const unsigned all_mask = ( 1 << im->channels ) - 1;
295
296   if (x < 0 || x >= im->xsize || y < 0 || y >= im->ysize)
297     return -1;
298
299   if ((im->ch_mask & all_mask) != all_mask) {
300     unsigned mask = 1;
301     int ch;
302     i_gpix(im, x, y, &workc);
303     for (ch = 0; ch < im->channels; ++ch) {
304       if (im->ch_mask & mask)
305         workc.channel[ch] = val->channel[ch];
306       mask <<= 1;
307     }
308     work_val = &workc;
309   }
310
311   if (i_findcolor(im, work_val, &which)) {
312     ((i_palidx *)im->idata)[x + y * im->xsize] = which;
313     return 0;
314   }
315   else {
316     dIMCTXim(im);
317     im_log((aIMCTX, 1, "i_ppix: color(%d,%d,%d) not found, converting to rgb\n",
318             val->channel[0], val->channel[1], val->channel[2]));
319     if (i_img_to_rgb_inplace(im)) {
320       return i_ppix(im, x, y, val);
321     }
322     else
323       return -1;
324   }
325 }
326
327 /*
328 =item i_gpix_p(i_img *im, i_img_dim x, i_img_dim y, i_color *val)
329
330 Retrieve a pixel, converting from a palette index to a color.
331
332 =cut
333 */
334 static int i_gpix_p(i_img *im, i_img_dim x, i_img_dim y, i_color *val) {
335   i_palidx which;
336   if (x < 0 || x >= im->xsize || y < 0 || y >= im->ysize) {
337     return -1;
338   }
339   which = ((i_palidx *)im->idata)[x + y * im->xsize];
340   if (which > PALEXT(im)->count)
341     return -1;
342   *val = PALEXT(im)->pal[which];
343
344   return 0;
345 }
346
347 /*
348 =item i_glinp(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_color *vals)
349
350 Retrieve a row of pixels.
351
352 =cut
353 */
354 static i_img_dim i_glin_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_color *vals) {
355   if (y >= 0 && y < im->ysize && l < im->xsize && l >= 0) {
356     int palsize = PALEXT(im)->count;
357     i_color *pal = PALEXT(im)->pal;
358     i_palidx *data;
359     i_img_dim count, i;
360     if (r > im->xsize)
361       r = im->xsize;
362     data = ((i_palidx *)im->idata) + l + y * im->xsize;
363     count = r - l;
364     for (i = 0; i < count; ++i) {
365       i_palidx which = *data++;
366       if (which < palsize)
367         vals[i] = pal[which];
368     }
369     return count;
370   }
371   else {
372     return 0;
373   }
374 }
375
376 /*
377 =item i_plin_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, const i_color *vals)
378
379 Write a line of color data to the image.
380
381 If any color value is not in the image when the image is converted to 
382 RGB.
383
384 =cut
385 */
386 static i_img_dim 
387 i_plin_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, const i_color *vals) {
388   i_img_dim count, i;
389   i_palidx *data;
390   i_palidx which;
391   if (y >=0 && y < im->ysize && l < im->xsize && l >= 0) {
392     if (r > im->xsize)
393       r = im->xsize;
394     data = ((i_palidx *)im->idata) + l + y * im->xsize;
395     count = r - l;
396     for (i = 0; i < count; ++i) {
397       if (i_findcolor(im, vals+i, &which)) {
398         ((i_palidx *)data)[i] = which;
399       }
400       else {
401         if (i_img_to_rgb_inplace(im)) {
402           return i+i_plin(im, l+i, r, y, vals+i);
403         }
404       }
405     }
406     return count;
407   }
408   else {
409     return 0;
410   }
411 }
412
413 /*
414 =item i_gsamp_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_sample_t *samps, int chans, int chan_count)
415
416 =cut
417 */
418 static i_img_dim i_gsamp_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_sample_t *samps, 
419               int const *chans, int chan_count) {
420   int ch;
421   if (y >= 0 && y < im->ysize && l < im->xsize && l >= 0) {
422     int palsize = PALEXT(im)->count;
423     i_color *pal = PALEXT(im)->pal;
424     i_palidx *data;
425     i_img_dim count, i, w;
426     if (r > im->xsize)
427       r = im->xsize;
428     data = ((i_palidx *)im->idata) + l + y * im->xsize;
429     count = 0;
430     w = r - l;
431     if (chans) {
432       for (ch = 0; ch < chan_count; ++ch) {
433         if (chans[ch] < 0 || chans[ch] >= im->channels) {
434           dIMCTXim(im);
435           im_push_errorf(aIMCTX, 0, "No channel %d in this image", chans[ch]);
436         }
437       }
438
439       for (i = 0; i < w; ++i) {
440         i_palidx which = *data++;
441         if (which < palsize) {
442           for (ch = 0; ch < chan_count; ++ch) {
443             *samps++ = pal[which].channel[chans[ch]];
444             ++count;
445           }
446         }
447       }
448     }
449     else {
450       if (chan_count <= 0 || chan_count > im->channels) {
451         dIMCTXim(im);
452         im_push_errorf(aIMCTX, 0, "chan_count %d out of range, must be >0, <= channels", 
453                       chan_count);
454         return 0;
455       }
456       for (i = 0; i < w; ++i) {
457         i_palidx which = *data++;
458         if (which < palsize) {
459           for (ch = 0; ch < chan_count; ++ch) {
460             *samps++ = pal[which].channel[ch];
461             ++count;
462           }
463         }
464       }
465     }
466     return count;
467   }
468   else {
469     return 0;
470   }
471 }
472
473 /*
474 =item i_gpal_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_palidx *vals)
475
476 =cut
477 */
478
479 static i_img_dim i_gpal_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, i_palidx *vals) {
480   if (y >= 0 && y < im->ysize && l < im->xsize && l >= 0) {
481     i_palidx *data;
482     i_img_dim i, w;
483     if (r > im->xsize)
484       r = im->xsize;
485     data = ((i_palidx *)im->idata) + l + y * im->xsize;
486     w = r - l;
487     for (i = 0; i < w; ++i) {
488       *vals++ = *data++;
489     }
490     return i;
491   }
492   else {
493     return 0;
494   }
495 }
496
497 /*
498 =item i_ppal_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, const i_palidx *vals)
499
500 =cut
501 */
502
503 static i_img_dim i_ppal_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y, const i_palidx *vals) {
504   if (y >= 0 && y < im->ysize && l < im->xsize && l >= 0) {
505     i_palidx *data;
506     i_img_dim i, w;
507     if (r > im->xsize)
508       r = im->xsize;
509     data = ((i_palidx *)im->idata) + l + y * im->xsize;
510     w = r - l;
511     for (i = 0; i < w; ++i) {
512       *data++ = *vals++;
513     }
514     return i;
515   }
516   else {
517     return 0;
518   }
519 }
520
521 /*
522 =item i_addcolors_p(i_img *im, const i_color *color, int count)
523
524 =cut
525 */
526 static int i_addcolors_p(i_img *im, const i_color *color, int count) {
527   if (PALEXT(im)->count + count <= PALEXT(im)->alloc) {
528     int result = PALEXT(im)->count;
529     int index = result;
530
531     PALEXT(im)->count += count;
532     while (count) {
533       PALEXT(im)->pal[index++] = *color++;
534       --count;
535     }
536
537     return result;
538   }
539   else
540     return -1;
541 }
542
543 /*
544 =item i_getcolors_p(i_img *im, int i, i_color *color, int count)
545
546 =cut
547 */
548 static int i_getcolors_p(i_img *im, int i, i_color *color, int count) {
549   if (i >= 0 && i+count <= PALEXT(im)->count) {
550     while (count) {
551       *color++ = PALEXT(im)->pal[i++];
552       --count;
553     }
554     return 1;
555   }
556   else
557     return 0;
558 }
559
560 static int color_eq(i_img *im, const i_color *c1, const i_color *c2) {
561   int ch;
562   for (ch = 0; ch < im->channels; ++ch) {
563     if (c1->channel[ch] != c2->channel[ch])
564       return 0;
565   }
566   return 1;
567 }
568
569 /*
570 =item i_colorcount_p(i_img *im)
571
572 =cut
573 */
574 static int i_colorcount_p(i_img *im) {
575   return PALEXT(im)->count;
576 }
577
578 /*
579 =item i_maxcolors_p(i_img *im)
580
581 =cut
582 */
583 static int i_maxcolors_p(i_img *im) {
584   return PALEXT(im)->alloc;
585 }
586
587 /*
588 =item i_setcolors_p(i_img *im, int index, const i_color *colors, int count)
589
590 =cut
591 */
592 static int i_setcolors_p(i_img *im, int index, const i_color *colors, int count) {
593   if (index >= 0 && count >= 1 && index + count <= PALEXT(im)->count) {
594     while (count) {
595       PALEXT(im)->pal[index++] = *colors++;
596       --count;
597     }
598     return 1;
599   }
600
601   return 0;
602 }
603
604 /*
605 =item i_findcolor_p(i_img *im)
606
607 =cut
608 */
609 static int i_findcolor_p(i_img *im, const i_color *color, i_palidx *entry) {
610   if (PALEXT(im)->count) {
611     int i;
612     /* often the same color comes up several times in a row */
613     if (PALEXT(im)->last_found >= 0) {
614       if (color_eq(im, color, PALEXT(im)->pal + PALEXT(im)->last_found)) {
615         *entry = PALEXT(im)->last_found;
616         return 1;
617       }
618     }
619     for (i = 0; i < PALEXT(im)->count; ++i) {
620       if (color_eq(im, color, PALEXT(im)->pal + i)) {
621         PALEXT(im)->last_found = *entry = i;
622         return 1;
623       }
624     }
625   }
626   return 0;
627 }
628
629 /*
630 =item i_psamp_p(im, l, r, y, samps, chans, chan_count)
631
632 Implement psamp() for paletted images.
633
634 Since writing samples doesn't really work as a concept for paletted
635 images, this is slow.
636
637 Also, writing samples may convert the image to a direct image in the
638 process, so use i_ppix/i_gpix instead of directly calling the paletted
639 handlers.
640
641 =cut
642 */
643
644 static i_img_dim 
645 i_psamp_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y,
646           const i_sample_t *samps, const int *chans, int chan_count) {
647   if (y >=0 && y < im->ysize && l < im->xsize && l >= 0) {
648     i_img_dim count = 0;
649     int ch;
650
651     if (r > im->xsize)
652       r = im->xsize;
653       
654     if (chans) {
655       /* make sure we have good channel numbers */
656       for (ch = 0; ch < chan_count; ++ch) {
657         if (chans[ch] < 0 || chans[ch] >= im->channels) {
658           dIMCTXim(im);
659           im_push_errorf(aIMCTX, 0, "No channel %d in this image", chans[ch]);
660           return -1;
661         }
662       }
663       while (l < r) {
664         i_color c;
665         
666         i_gpix(im, l, y, &c);
667         for (ch = 0; ch < chan_count; ++ch)
668           c.channel[chans[ch]] = *samps++;
669         i_ppix(im, l, y, &c);
670         count += chan_count;
671         ++l;
672       }
673     }
674     else {
675       if (chan_count <= 0 || chan_count > im->channels) {
676         dIMCTXim(im);
677         im_push_errorf(aIMCTX, 0, "chan_count %d out of range, must be >0, <= channels", 
678                       chan_count);
679         return -1;
680       }
681
682       while (l < r) {
683         i_color c;
684         
685         i_gpix(im, l, y, &c);
686         for (ch = 0; ch < chan_count; ++ch)
687           c.channel[ch] = *samps++;
688         i_ppix(im, l, y, &c);
689         count += chan_count;
690         ++l;
691       }
692     }
693
694     return count;
695   }
696   else {
697     dIMCTXim(im);
698     i_push_error(0, "Image position outside of image");
699     return -1;
700   }
701 }
702
703 /*
704 =item i_psampf_p(im, l, r, y, samps, chans, chan_count)
705
706 Implement psampf() for paletted images.
707
708 Since writing samples doesn't really work as a concept for paletted
709 images, this is slow.
710
711 Also, writing samples may convert the image to a direct image in the
712 process, so use i_ppixf/i_gpixf instead of directly calling the paletted
713 handlers.
714
715 =cut
716 */
717
718 static i_img_dim 
719 i_psampf_p(i_img *im, i_img_dim l, i_img_dim r, i_img_dim y,
720           const i_fsample_t *samps, const int *chans, int chan_count) {
721   if (y >=0 && y < im->ysize && l < im->xsize && l >= 0) {
722     i_img_dim count = 0;
723     int ch;
724
725     if (r > im->xsize)
726       r = im->xsize;
727       
728     if (chans) {
729       /* make sure we have good channel numbers */
730       for (ch = 0; ch < chan_count; ++ch) {
731         if (chans[ch] < 0 || chans[ch] >= im->channels) {
732           dIMCTXim(im);
733           im_push_errorf(aIMCTX, 0, "No channel %d in this image", chans[ch]);
734           return -1;
735         }
736       }
737       while (l < r) {
738         i_fcolor c;
739         
740         i_gpixf(im, l, y, &c);
741         for (ch = 0; ch < chan_count; ++ch)
742           c.channel[chans[ch]] = *samps++;
743         i_ppixf(im, l, y, &c);
744         count += chan_count;
745         ++l;
746       }
747     }
748     else {
749       if (chan_count <= 0 || chan_count > im->channels) {
750         dIMCTXim(im);
751         im_push_errorf(aIMCTX, 0, "chan_count %d out of range, must be >0, <= channels", 
752                       chan_count);
753         return -1;
754       }
755
756       while (l < r) {
757         i_fcolor c;
758         
759         i_gpixf(im, l, y, &c);
760         for (ch = 0; ch < chan_count; ++ch)
761           c.channel[ch] = *samps++;
762         i_ppixf(im, l, y, &c);
763         count += chan_count;
764         ++l;
765       }
766     }
767
768     return count;
769   }
770   else {
771     dIMCTXim(im);
772     i_push_error(0, "Image position outside of image");
773     return -1;
774   }
775 }
776
777 /*
778 =back
779
780 =head1 AUTHOR
781
782 Tony Cook <tony@develop-help.com>
783
784 =head1 SEE ALSO
785
786 Imager(3)
787
788 =cut
789 */