Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (21 sloc) 0.596 kb
/*
Imager "functions" implemented as macros
I suppose these could go in imdatatypes, but they aren't types.
*/
#ifndef IMAGER_IMMACROS_H_
#define IMAGER_IMMACROS_H_
/*
=item i_img_has_alpha(C<im>)
=category Image Information
Return true if the image has an alpha channel.
=cut
*/
#define i_img_has_alpha(im) ((im)->channels == 2 || (im)->channels == 4)
/*
=item i_img_color_channels(C<im>)
=category Image Information
The number of channels holding color information.
=cut
*/
#define i_img_color_channels(im) (i_img_has_alpha(im) ? (im)->channels - 1 : (im)->channels)
#endif
Jump to Line
Something went wrong with that request. Please try again.