![]() |
![]() |
![]() |
VIPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <vips/vips.h> int im_rwcheck (IMAGE *im
); int im_iocheck (IMAGE *in
,IMAGE *out
); int im_incheck (IMAGE *im
); int im_outcheck (IMAGE *im
); int im_piocheck (IMAGE *in
,IMAGE *out
); int im_pincheck (IMAGE *im
); int im_poutcheck (IMAGE *im
); int im_check_uncoded (const char *domain
,IMAGE *im
); int im_check_coding_known (const char *domain
,IMAGE *im
); int im_check_coding_labq (const char *domain
,IMAGE *im
); int im_check_coding_rad (const char *domain
,IMAGE *im
); int im_check_coding_same (const char *domain
,IMAGE *im1
,IMAGE *im2
); int im_check_mono (const char *domain
,IMAGE *im
); int im_check_bands_1or3 (const char *domain
,IMAGE *in
); int im_check_bands (const char *domain
,IMAGE *im
,int bands
); int im_check_bands_1orn (const char *domain
,IMAGE *im1
,IMAGE *im2
); int im_check_bands_same (const char *domain
,IMAGE *im1
,IMAGE *im2
); int im_check_bandno (const char *domain
,IMAGE *im
,int bandno
); int im_check_int (const char *domain
,IMAGE *im
); int im_check_uint (const char *domain
,IMAGE *im
); int im_check_uintorf (const char *domain
,IMAGE *im
); int im_check_noncomplex (const char *domain
,IMAGE *im
); int im_check_complex (const char *domain
,IMAGE *im
); int im_check_format (const char *domain
,IMAGE *im
,VipsBandFmt fmt
); int im_check_u8or16 (const char *domain
,IMAGE *im
); int im_check_8or16 (const char *domain
,IMAGE *im
); int im_check_u8or16orf (const char *domain
,IMAGE *im
); int im_check_format_same (const char *domain
,IMAGE *im1
,IMAGE *im2
); int im_check_size_same (const char *domain
,IMAGE *im1
,IMAGE *im2
); int im_check_vector (const char *domain
,int n
,IMAGE *im
); int im_check_hist (const char *domain
,IMAGE *im
); int im_check_imask (const char *domain
,INTMASK *mask
); int im_check_dmask (const char *domain
,DOUBLEMASK *mask
); gboolean vips_bandfmt_isint (VipsBandFmt fmt
); gboolean vips_bandfmt_isuint (VipsBandFmt fmt
); gboolean vips_bandfmt_isfloat (VipsBandFmt fmt
); gboolean vips_bandfmt_iscomplex (VipsBandFmt fmt
); gboolean im_isfile (IMAGE *im
); gboolean im_ispartial (IMAGE *im
); gboolean im_isMSBfirst (IMAGE *im
);
These functions perform simple checks on an IMAGE, or indicate that you intend to use an IMAGE in a certain way.
im_incheck()
, im_pincheck()
and friends indicate the image IO style you
intend to use, transforming the underlying IMAGE structure if
necessary.
im_check_mono()
and friends and convenience functions that test an IMAGE
for having various properties
and signal an error if the condition is not met. They are useful for
writing image processing operations which can only work on certain types of
image.
int im_rwcheck (IMAGE *im
);
Gets an image ready for an in-place operation, such as im_insertplace()
.
Operations like this both read and write with IM_IMAGE_ADDR()
.
See also: im_insertplace()
, im_incheck()
.
|
image to make read-write |
Returns : |
0 on succeess, or -1 on error. |
int im_iocheck (IMAGE *in
,IMAGE *out
);
A convenience function to check a pair of images for IO via IM_IMAGE_ADDR()
and im_writeline()
.
See also: im_incheck()
, im_outcheck()
.
|
input image |
|
output image |
Returns : |
0 on succeess, or -1 on error. |
int im_incheck (IMAGE *im
);
Check that an image is readable via the IM_IMAGE_ADDR()
macro. If it isn't,
try to transform it so that IM_IMAGE_ADDR()
can work.
See also: im_outcheck()
, im_pincheck()
, im_rwcheck()
, IM_IMAGE_ADDR()
.
|
image to check |
Returns : |
0 on succeess, or -1 on error. |
int im_outcheck (IMAGE *im
);
Check that an image is writeable by im_writeline()
. If it isn't,
try to transform it so that im_writeline()
can work.
Set the image properties (like size, type and so on), then call
im_setupout()
, then call im_writeline()
for each scan line.
See also: im_incheck()
, im_poutcheck()
.
|
image to check |
Returns : |
0 on succeess, or -1 on error. |
int im_piocheck (IMAGE *in
,IMAGE *out
);
A convenience function to check a pair of images for IO via im_prepare()
and im_generate()
.
See also: im_pincheck()
, im_poutcheck()
.
|
input image |
|
output image |
Returns : |
0 on succeess, or -1 on error. |
int im_pincheck (IMAGE *im
);
Check that an image is readable with im_prepare()
and friends. If it isn't,
try to transform the image so that im_prepare()
can work.
See also: im_incheck()
, im_poutcheck()
, im_prepare()
.
|
image to check |
Returns : |
0 on succeess, or -1 on error. |
int im_poutcheck (IMAGE *im
);
Check that an image is writeable with im_generate()
. If it isn't,
try to transform the image so that im_generate()
can work.
See also: im_incheck()
, im_poutcheck()
, im_generate()
.
|
image to check |
Returns : |
0 on succeess, or -1 on error. |
int im_check_uncoded (const char *domain
,IMAGE *im
);
Check that the image is not coded. If not, set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 on OK, or -1 on error. |
int im_check_coding_known (const char *domain
,IMAGE *im
);
Check that the image is uncoded, LABQ coded or RAD coded. If not, set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 on OK, or -1 on error. |
int im_check_coding_labq (const char *domain
,IMAGE *im
);
Check that the image is in LABQ coding. If not, set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 on OK, or -1 on error. |
int im_check_coding_rad (const char *domain
,IMAGE *im
);
Check that the image is in Radiance coding. If not, set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 on OK, or -1 on error. |
int im_check_coding_same (const char *domain
,IMAGE *im1
,IMAGE *im2
);
Check that the images have the same coding. If not, set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
first image to check |
|
second image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_mono (const char *domain
,IMAGE *im
);
Check that the image has exactly one band. Otherwise set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_bands (const char *domain
,IMAGE *im
,int bands
);
Check that the image has bands
bands.
Otherwise set an error message
and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
|
must have this many bands |
Returns : |
0 if OK, -1 otherwise. |
int im_check_bands_1orn (const char *domain
,IMAGE *im1
,IMAGE *im2
);
Check that the images have the same number of bands, or that one of the images has just 1 band. If not, set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
first image to check |
|
second image to check |
Returns : |
0 on OK, or -1 on error. |
int im_check_bands_same (const char *domain
,IMAGE *im1
,IMAGE *im2
);
Check that the images have the same number of bands. If not, set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
first image to check |
|
second image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_bandno (const char *domain
,IMAGE *im
,int bandno
);
bandno
should be a valid band number (ie. 0 to im->Bands - 1), or can be
-1, meaning all bands.
If not, set an error message
and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
|
band number |
Returns : |
0 if OK, -1 otherwise. |
int im_check_int (const char *domain
,IMAGE *im
);
Check that the image is in one of the integer formats. Otherwise set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_uint (const char *domain
,IMAGE *im
);
Check that the image is in one of the unsigned integer formats. Otherwise set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_uintorf (const char *domain
,IMAGE *im
);
Check that the image is unsigned int or float. Otherwise set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_noncomplex (const char *domain
,IMAGE *im
);
Check that the image is not complex. Otherwise set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_complex (const char *domain
,IMAGE *im
);
Check that the image is complex. Otherwise set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_format (const char *domain
,IMAGE *im
,VipsBandFmt fmt
);
Check that the image has the specified format. Otherwise set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
|
format to test for |
Returns : |
0 if OK, -1 otherwise. |
int im_check_u8or16 (const char *domain
,IMAGE *im
);
Check that the image is 8 or 16-bit unsigned integer. Otherwise set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_8or16 (const char *domain
,IMAGE *im
);
Check that the image is 8 or 16-bit integer, signed or unsigned. Otherwise set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_u8or16orf (const char *domain
,IMAGE *im
);
Check that the image is 8 or 16-bit unsigned integer, or float. Otherwise set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_format_same (const char *domain
,IMAGE *im1
,IMAGE *im2
);
Check that the images have the same format. If not, set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
first image to check |
|
second image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_size_same (const char *domain
,IMAGE *im1
,IMAGE *im2
);
Check that the images have the same size. If not, set an error message and return non-zero.
See also: im_error()
.
|
the originating domain for the error message |
|
first image to check |
|
second image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_vector (const char *domain
,int n
,IMAGE *im
);
Operations with a vector constant need a 1-element vector, or a vector with the same number of elements as there are bands in the image.
See also: im_error()
.
|
the originating domain for the error message |
|
number of elements in vector |
|
image to check against |
Returns : |
0 if OK, -1 otherwise. |
int im_check_hist (const char *domain
,IMAGE *im
);
Histogram images must have width or height 1, and must not have more than 65536 elements. Return 0 if the image will pass as a histogram, or -1 and set an error message otherwise.
See also: im_error()
.
|
the originating domain for the error message |
|
image to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_imask (const char *domain
,INTMASK *mask
);
Sanity-check a mask parameter.
See also: im_error()
.
|
the originating domain for the error message |
|
mask to check |
Returns : |
0 if OK, -1 otherwise. |
int im_check_dmask (const char *domain
,DOUBLEMASK *mask
);
Sanity-check a mask parameter.
See also: im_error()
.
|
the originating domain for the error message |
|
mask to check |
Returns : |
0 if OK, -1 otherwise. |
gboolean vips_bandfmt_isint (VipsBandFmt fmt
);
Return TRUE
if fmt
is one of the integer types.
|
format to test |
gboolean vips_bandfmt_isuint (VipsBandFmt fmt
);
Return TRUE
if fmt
is one of the unsigned integer types.
|
format to test |
gboolean vips_bandfmt_isfloat (VipsBandFmt fmt
);
Return TRUE
if fmt
is one of the float types.
|
format to test |
gboolean vips_bandfmt_iscomplex (VipsBandFmt fmt
);
Return TRUE
if fmt
is one of the complex types.
|
image to test |
gboolean im_isfile (IMAGE *im
);
Return TRUE
if im
represents a file on disc in some way.
|
image to test |
gboolean im_ispartial (IMAGE *im
);
Return TRUE
if im
represents a partial image (a delayed calculation).
|
image to test |