im_ifthenelse(3) im_ifthenelse(3)
NAME
im_ifthenelse - use an unsigned char image to join two images together
SYNOPSIS
#include <vips/vips.h> int im_ifthenelse(c, a, b, out) IMAGE *c, *a, *b, *out; int im_blend(c, a, b, out) IMAGE *c, *a, *b, *out;
DESCRIPTION
im_ifthenelse builds an output image which uses some pels from a and some from b: if the conditional image c is non-zero at that point, the pel comes from a; if it is zero, the pel comes from b. The conditional image c can have either 1 band, in which case entire pels come either from a or b, or n bands, where n is the number of bands in both a and b, in which case individual band elements are cho- sen from a and b. Images a and b must match in size, type and number of bands. im_blend(3) works just as im_ifthenelse(3), except that instead of selecting between a and b, values in the condition image are used to softly blend between the two. 255 means a only, 0 means b only, 128 means 50:50.
RETURN VALUE
0 on success and -1 on error.
SEE ALSO
im_equal(3), im_and(3).
COPYRIGHT
National Gallery
AUTHOR
J. Cupitt 30 October 1992 im_ifthenelse(3)
im_ifthenelse 7.14.5 - Generated Fri Sep 5 20:46:23 CDT 2008