![]() |
![]() |
![]() |
VIPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <vips/vips.h> int im_andimage (VipsImage *in1
,VipsImage *in2
,VipsImage *out
); int im_orimage (VipsImage *in1
,VipsImage *in2
,VipsImage *out
); int im_eorimage (VipsImage *in1
,VipsImage *in2
,VipsImage *out
); int im_andimage_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_andimageconst (VipsImage *in
,VipsImage *out
,double c
); int im_orimage_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_orimageconst (VipsImage *in
,VipsImage *out
,double c
); int im_eorimage_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_eorimageconst (VipsImage *in
,VipsImage *out
,double c
); int im_shiftleft_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_shiftleft (VipsImage *in
,VipsImage *out
,int n
); int im_shiftright_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
); int im_shiftright (VipsImage *in
,VipsImage *out
,int n
);
These operations perform boolean operations, such as bitwise-and, on every pixel in an image or pair of images. They are useful for combining the results of the relational and morphological functions. 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_andimage_vec()
, you can mix single-element arrays or single-band images
freely.
If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.
The output type is the same as the input type for integer types. Float and complex types are cast to signed int.
You might think im_andimage()
would be called "im_and", but that causes
problems when we try and make a C++ binding and drop the "im_" prefix.
int im_andimage (VipsImage *in1
,VipsImage *in2
,VipsImage *out
);
This operation calculates in1
& in2
and writes the result to out
.
The images may have any format. They may differ
in their number of bands, see above. They may differ in size, see above.
See also: im_orimage()
.
|
input IMAGE 1 |
|
input IMAGE 2 |
|
output IMAGE |
Returns : |
0 on success, -1 on error |
int im_orimage (VipsImage *in1
,VipsImage *in2
,VipsImage *out
);
This operation calculates in1
| in2
and writes the result to out
.
The images may have any format. They may differ
in their number of bands, see above. They may differ in size, see above.
See also: im_eorimage()
.
|
input IMAGE 1 |
|
input IMAGE 2 |
|
output IMAGE |
Returns : |
0 on success, -1 on error |
int im_eorimage (VipsImage *in1
,VipsImage *in2
,VipsImage *out
);
This operation calculates in1
^ in2
and writes the result to out
.
The images may have any format. They may differ
in their number of bands, see above. They may differ in size, see above.
See also: im_eorimage_vec()
, im_andimage()
.
|
input IMAGE 1 |
|
input IMAGE 2 |
|
output IMAGE |
Returns : |
0 on success, -1 on error |
int im_andimage_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
& c
(bitwise and of image pixels with array
c
) and writes the result to out
.
See also: im_andimage()
, im_orimage_vec()
.
|
input IMAGE 1 |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_andimageconst (VipsImage *in
,VipsImage *out
,double c
);
This operation calculates in
& c
(bitwise and of image pixels with
constant
c
) and writes the result to out
.
See also: im_andimage()
, im_orimage_vec()
.
|
input IMAGE 1 |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |
int im_orimage_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
| c
(bitwise or of image pixels with array
c
) and writes the result to out
.
See also: im_andimage()
, im_orimageconst()
.
|
input IMAGE 1 |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_orimageconst (VipsImage *in
,VipsImage *out
,double c
);
This operation calculates in
| c
(bitwise or of image pixels with
constant
c
) and writes the result to out
.
See also: im_andimage()
, im_orimage_vec()
.
|
input IMAGE 1 |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |
int im_eorimage_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
^ c
(bitwise exclusive-or of image pixels
with array
c
) and writes the result to out
.
See also: im_andimage()
, im_orimageconst()
.
|
input IMAGE 1 |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_eorimageconst (VipsImage *in
,VipsImage *out
,double c
);
This operation calculates in
^ c
(bitwise exclusive-or of image pixels
with
constant
c
) and writes the result to out
.
See also: im_andimage()
, im_orimage_vec()
.
|
input IMAGE 1 |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |
int im_shiftleft_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
<< c
(left-shift by c
bits
with array
c
) and writes the result to out
.
See also: im_andimage()
, im_orimageconst()
.
|
input IMAGE |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_shiftleft (VipsImage *in
,VipsImage *out
,int n
);
This operation calculates in
<< n
(left-shift by n
bits)
and writes the result to out
.
See also: im_andimage()
, im_orimageconst()
.
|
input IMAGE |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |
int im_shiftright_vec (VipsImage *in
,VipsImage *out
,int n
,double *c
);
This operation calculates in
<< c
(right-shift by c
bits
with array
c
) and writes the result to out
.
See also: im_andimage()
, im_orimageconst()
.
|
input IMAGE |
|
output IMAGE |
|
array length |
|
array of constants |
Returns : |
0 on success, -1 on error |
int im_shiftright (VipsImage *in
,VipsImage *out
,int n
);
This operation calculates in
>> n
(right-shift by n
bits)
and writes the result to out
.
See also: im_andimage()
, im_orimageconst()
.
|
input IMAGE |
|
output IMAGE |
|
constant |
Returns : |
0 on success, -1 on error |