2 Imager "functions" implemented as macros
4 I suppose these could go in imdatatypes, but they aren't types.
6 #ifndef IMAGER_IMMACROS_H_
7 #define IMAGER_IMMACROS_H_
10 =item i_img_has_alpha(C<im>)
12 =category Image Information
14 Return true if the image has an alpha channel.
19 #define i_img_has_alpha(im) ((im)->channels == 2 || (im)->channels == 4)
22 =item i_img_color_channels(C<im>)
24 =category Image Information
26 The number of channels holding color information.
31 #define i_img_color_channels(im) (i_img_has_alpha(im) ? (im)->channels - 1 : (im)->channels)