- fix spelling errors patched by Debian (please report the issues you
[imager.git] / immacros.h
CommitLineData
bea65b1f
TC
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(im)
11
12=category Image Information
13
14Return 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(im)
23
24=category Image Information
25
26The 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