![]() |
![]() |
![]() |
VIPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <vips/vips.h> int im_equal (VipsImage *in1
,VipsImage *in2
,VipsImage *out
); int im_notequal (VipsImage *in1
,VipsImage *in2
,VipsImage *out
); int im_less (VipsImage *in1
,VipsImage *in2
,VipsImage *out
); int im_lesseq (VipsImage *in1
,VipsImage *in2
,VipsImage *out
); int im_more (VipsImage *in1
,VipsImage *in2
,VipsImage *out
); int im_moreeq (VipsImage *in1
,VipsImage *in2
,VipsImage *out
); int im_equal_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_notequal_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_less_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_lesseq_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_more_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_moreeq_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_equalconst (VipsImage *in
,VipsImage *out
,double c
); int im_notequalconst (VipsImage *in
,VipsImage *out
,double c
); int im_lessconst (VipsImage *in
,VipsImage *out
,double c
); int im_lesseqconst (VipsImage *in
,VipsImage *out
,double c
); int im_moreconst (VipsImage *in
,VipsImage *out
,double c
); int im_moreeqconst (VipsImage *in
,VipsImage *out
,double c
); int im_ifthenelse (VipsImage *c
,VipsImage *a
,VipsImage *b
,VipsImage *out
); int im_blend (VipsImage *c
,VipsImage *a
,VipsImage *b
,VipsImage *out
);
These operations perform comparison operations, such as equals, on every pixel in an image or pair of images. All will work with images of any type or any mixture of types of any size and of any number of bands.
For binary operations, if the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together and then the two n-band images are operated upon.
In the same way, for operations that take an array constant, such as
im_equal_vec()
, you can mix single-element arrays or single-band images
freely.
The output type is always unsigned char, with 255 for every band element for which the condition is true, and 0 for every other element. For complex images, the operations calculate and compare the modulus.
For binary operations on pairs of images, the images must match in size.
int im_equal (VipsImage *in1
,VipsImage *in2
,VipsImage *out
);
This operation calculates in1
== in2
(image element equals image element)
and writes the result to out
.
See also: im_notequal()
.
|
input IMAGE 1 |
|
input IMAGE 2 |
|
output IMAGE |
Returns : |
0 on success, -1 on error |
int im_notequal (VipsImage *in1
,VipsImage *in2
,VipsImage *out
);
This operation calculates in1
!= in2
(image element does not equal image
element) and writes the result to out
.
See also: im_notequal()
.
|
input IMAGE 1 |
|
input IMAGE 2 |
|
output IMAGE |
Returns : |
0 on success, -1 on error |
int im_less (VipsImage *in1
,VipsImage *in2
,VipsImage *out
);
This operation calculates in1
< in2
(image element is less than image
element) and writes the result to out
.
See also: im_more()
.
|
input IMAGE 1 |
|
input IMAGE 2 |
|
output IMAGE |
Returns : |
0 on success, -1 on error |
int im_lesseq (VipsImage *in1
,VipsImage *in2
,VipsImage *out
);
This operation calculates in1
<= in2
(image element is less than or equal
to image elemment) and writes the result to out
.
See also: im_more()
.
|
input IMAGE 1 |
|
input IMAGE 2 |
|
output IMAGE |
Returns : |
0 on success, -1 on error |
int im_more (VipsImage *in1
,VipsImage *in2
,VipsImage *out
);
This operation calculates in1
> in2
(image element is greater than
image elemment) and writes the result to out
.
See also: im_less()
.
|
input IMAGE 1 |
|
input IMAGE 2 |
|
output IMAGE |
Returns : |
0 on success, -1 on error |
int im_moreeq (VipsImage *in1
,VipsImage *in2
,VipsImage *out
);
This operation calculates in1
>= in2
(image element is greater than or
equal to image element) and writes the result to out
.
See also: im_more()
.
|
input IMAGE 1 |
|
input IMAGE 2 |
|
output IMAGE |
Returns : |
0 on success, -1 on error |
int im_equal_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
== c
(image element equals constant array
c
) and writes the result to out
.
See also: im_equal()
, im_equalconst()
.
|
input IMAGE |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_notequal_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
!= c
(image element is not equal to constant
array c
) and writes the result to out
.
See also: im_equal()
, im_equal_vec()
.
|
input IMAGE |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_less_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
< c
(image element is less than constant
array c
) and writes the result to out
.
See also: im_less()
, im_lessconst()
.
|
input IMAGE |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_lesseq_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
<= c
(image element is less than or equal to
constant array c
) and writes the result to out
.
See also: im_lesseq()
, im_lesseqconst()
.
|
input IMAGE |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_more_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
> c
(image element is greater than
constant array c
) and writes the result to out
.
See also: im_lesseq()
, im_lesseqconst()
.
|
input IMAGE |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_moreeq_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
>= c
(image element is greater than or
equal to
constant array c
) and writes the result to out
.
See also: im_lesseq()
, im_lesseqconst()
.
|
input IMAGE |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_equalconst (VipsImage *in
,VipsImage *out
,double c
);
This operation calculates in
== c
(image element is
equal to constant c
) and writes the result to out
.
See also: im_lesseq()
, im_lesseqconst()
.
|
input IMAGE |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |
int im_notequalconst (VipsImage *in
,VipsImage *out
,double c
);
This operation calculates in
!= c
(image element is not equal to
constant c
) and writes the result to out
.
See also: im_lesseq()
, im_lesseqconst()
.
|
input IMAGE |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |
int im_lessconst (VipsImage *in
,VipsImage *out
,double c
);
This operation calculates in
< c
(image element is less than
constant c
) and writes the result to out
.
See also: im_lesseq()
, im_lesseqconst()
.
|
input IMAGE |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |
int im_lesseqconst (VipsImage *in
,VipsImage *out
,double c
);
This operation calculates in
= c
(image element is less than
or equal to
constant c
) and writes the result to out
.
See also: im_lesseq()
, im_lesseqconst()
.
|
input IMAGE |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |
int im_moreconst (VipsImage *in
,VipsImage *out
,double c
);
This operation calculates in
= c
(image element is more than
constant c
) and writes the result to out
.
See also: im_lesseq()
, im_lesseqconst()
.
|
input IMAGE |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |
int im_moreeqconst (VipsImage *in
,VipsImage *out
,double c
);
This operation calculates in
= c
(image element is more than
or equal to
constant c
) and writes the result to out
.
See also: im_lesseq()
, im_lesseqconst()
.
|
input IMAGE |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |
int im_ifthenelse (VipsImage *c
,VipsImage *a
,VipsImage *b
,VipsImage *out
);
This operation scans the condition image c
and uses it to select pixels from either the then image a
or the else
image b
. Non-zero means a
, 0 means b
.
Any image can have either 1 band or n bands, where n is the same for all the non-1-band images. Single band images are then effectively copied to make n-band images.
Images a
and b
are cast up to the smallest common format.
If the images differ in size, the smaller images are enlarged to match the largest by adding zero pixels along the bottom and right.
See also: im_blend()
, im_equal()
.
|
condition IMAGE |
|
then IMAGE |
|
else IMAGE |
|
output IMAGE |
Returns : |
0 on success, -1 on error |
int im_blend (VipsImage *c
,VipsImage *a
,VipsImage *b
,VipsImage *out
);
This operation scans the condition image c
and uses it to blend pixels from either the then image a
or the else
image b
. 255 means a
only, 0 means b
only, and intermediate values are a
mixture.
Any image may have either 1 band or n bands, where n is the same for all the non-1-band images. Single band images are then effectively copied to make n-band images.
Images a
and b
are cast up to the smallest common format.
If the images differ in size, the smaller images are enlarged to match the largest by adding zero pixels along the bottom and right.
See also: im_ifthenelse()
, im_equal()
.
|
condition IMAGE |
|
then IMAGE |
|
else IMAGE |
|
output IMAGE |
Returns : |
0 on success, -1 on error |