]> git.imager.perl.org - imager.git/blob - immacros.h
add flood fill test image
[imager.git] / immacros.h
1 /* 
2    Imager "functions" implemented as macros 
3
4    I suppose these could go in imdatatypes, but they aren't types.
5 */
6 #ifndef IMAGER_IMMACROS_H_
7 #define IMAGER_IMMACROS_H_
8
9 /*
10 =item i_img_has_alpha(C<im>)
11
12 =category Image Information
13
14 Return true if the image has an alpha channel.
15
16 =cut
17 */
18
19 #define i_img_has_alpha(im) ((im)->channels == 2 || (im)->channels == 4)
20
21 /*
22 =item i_img_color_channels(C<im>)
23
24 =category Image Information
25
26 The number of channels holding color information.
27
28 =cut
29 */
30
31 #define i_img_color_channels(im) (i_img_has_alpha(im) ? (im)->channels - 1 : (im)->channels)
32
33 #endif