libvips/man/im_ifthenelse.3

40 lines
1.1 KiB
Groff
Raw Normal View History

2007-08-29 18:23:50 +02:00
.TH IM_IFTHENELSE 3 "30 October 1992"
.SH NAME
im_ifthenelse \- use an unsigned char image to join two images together
.SH SYNOPSIS
.B #include <vips/vips.h>
.B int im_ifthenelse(c, a, b, out)
.br
.B IMAGE *c, *a, *b, *out;
.B int im_blend(c, a, b, out)
.br
.B IMAGE *c, *a, *b, *out;
.SH DESCRIPTION
.B 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 chosen from a and b.
Images a and b must match in size, type and number of bands.
.B 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.
.SH RETURN VALUE
0 on success and -1 on error.
.SH SEE ALSO
im_equal(3), im_and(3).
.SH COPYRIGHT
National Gallery
.SH AUTHOR
J. Cupitt