Movatterモバイル変換


[0]ホーム

URL:


libvips

A fast image processing library with low memory needs.

DownloadInstallDocumentationIssuesWikilibvips projectslibvips on GitHub
Top  | DescriptionHomeUpPrevNext

error

error

Functions

constchar *vips_error_buffer ()
char *vips_error_buffer_copy ()
voidvips_error_clear ()
voidvips_error_freeze ()
voidvips_error_thaw ()
voidvips_error ()
voidvips_verror ()
voidvips_error_system ()
voidvips_verror_system ()
voidvips_error_g ()
voidvips_g_error ()
voidvips_error_exit ()
intvips_check_uncoded ()
intvips_check_coding ()
intvips_check_coding_known ()
intvips_check_coding_noneorlabq ()
intvips_check_coding_same ()
intvips_check_mono ()
intvips_check_bands ()
intvips_check_bands_1or3 ()
intvips_check_bands_atleast ()
intvips_check_bands_1orn ()
intvips_check_bands_1orn_unary ()
intvips_check_bands_same ()
intvips_check_bandno ()
intvips_check_int ()
intvips_check_uint ()
intvips_check_uintorf ()
intvips_check_noncomplex ()
intvips_check_complex ()
intvips_check_twocomponents ()
intvips_check_format ()
intvips_check_u8or16 ()
intvips_check_8or16 ()
intvips_check_u8or16orf ()
intvips_check_format_same ()
intvips_check_size_same ()
intvips_check_oddsquare ()
intvips_check_vector_length ()
intvips_check_vector ()
intvips_check_hist ()
intvips_check_matrix ()
intvips_check_separable ()
intvips_check_precision_intfloat ()

Includes

#include <vips/vips.h>

Description

Functions

vips_error_buffer ()

constchar *vips_error_buffer (void);

Get a pointer to the start of the error buffer as a C string.The string is owned by the error system and must not be freed.

See also:vips_error_clear().

Returns

the error buffer as a C string which must not be freed


vips_error_buffer_copy ()

char *vips_error_buffer_copy (void);

Return a copy of the vips error buffer, and clear it.

Returns

a copy of the libvips error buffer


vips_error_clear ()

voidvips_error_clear (void);

Clear and reset the error buffer. This is typically called after presentingan error to the user.

See also:vips_error_buffer().


vips_error_freeze ()

voidvips_error_freeze (void);

Stop errors being logged. Usevips_error_thaw() to unfreeze. You cannest freeze/thaw pairs.


vips_error_thaw ()

voidvips_error_thaw (void);

Re-enable error logging.


vips_error ()

voidvips_error (constchar *domain,constchar *fmt,...);

Format the string in the style ofprintf() and append to the error buffer.

See also:vips_error_system(),vips_verror().

Parameters

domain

the source of the error

 

fmt

printf()-style format string for the error

 

...

arguments to the format string

 

vips_verror ()

voidvips_verror (constchar *domain,constchar *fmt,va_list ap);

Append a message to the error buffer.

See also:vips_error().

Parameters

domain

the source of the error

 

fmt

printf()-style format string for the error

 

ap

arguments to the format string

 

vips_error_system ()

voidvips_error_system (int err,constchar *domain,constchar *fmt,...);

Format the string in the style ofprintf() and append to the error buffer.Then create and append a localised message based on the system error code,usually the value of errno.

See also:vips_verror_system().

Parameters

err

the system error code

 

domain

the source of the error

 

fmt

printf()-style format string for the error

 

...

arguments to the format string

 

vips_verror_system ()

voidvips_verror_system (int err,constchar *domain,constchar *fmt,va_list ap);

Format the string in the style ofprintf() and append to the error buffer.Then create and append a localised message based on the system error code,usually the value of errno.

See also:vips_error_system().

Parameters

err

the system error code

 

domain

the source of the error

 

fmt

printf()-style format string for the error

 

ap

arguments to the format string

 

vips_error_g ()

voidvips_error_g (GError **error);

This function sets the glib error pointer from the vips error buffer andclears it. It's handy for returning errors to glib functions from vips.

Seevips_g_error() for the inverse operation.

See also:g_set_error(),vips_g_error().

Parameters

error

glib error pointer.

[out]

vips_g_error ()

voidvips_g_error (GError **error);

This function adds theGError to the vips error buffer and clears it. It'sthe opposite ofvips_error_g().

See also:vips_error_g().

Parameters

error

glib error pointer

 

vips_error_exit ()

voidvips_error_exit (constchar *fmt,...);

Sends a formatted error message to stderr, then sends the contents of theerror buffer, if any, then shuts down vips and terminates the program withan error code.

fmt may beNULL, in which case only the error buffer is printed beforeexiting.

See also:vips_error().

Parameters

fmt

printf()-style format string for the message

 

...

arguments to the format string

 

vips_check_uncoded ()

intvips_check_uncoded (constchar *domain,VipsImage *im);

Check that the image is not coded.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 on OK, or -1 on error.


vips_check_coding ()

intvips_check_coding (constchar *domain,VipsImage *im,VipsCoding coding);

Check that the image has the requiredcoding.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

coding

required coding

 

Returns

0 on OK, or -1 on error.


vips_check_coding_known ()

intvips_check_coding_known (constchar *domain,VipsImage *im);

Check that the image is uncoded, LABQ coded or RAD coded.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 on OK, or -1 on error.


vips_check_coding_noneorlabq ()

intvips_check_coding_noneorlabq (constchar *domain,VipsImage *im);

Check that the image is uncoded or LABQ coded.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 on OK, or -1 on error.


vips_check_coding_same ()

intvips_check_coding_same (constchar *domain,VipsImage *im1,VipsImage *im2);

Check that the images have the same coding.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im1

first image to check

 

im2

second image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_mono ()

intvips_check_mono (constchar *domain,VipsImage *im);

Check that the image has exactly one band.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_bands ()

intvips_check_bands (constchar *domain,VipsImage *im,int bands);

Check that the image hasbands bands.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

bands

must have this many bands

 

Returns

0 if OK, -1 otherwise.


vips_check_bands_1or3 ()

intvips_check_bands_1or3 (constchar *domain,VipsImage *im);

Check that the image has either one or three bands.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_bands_atleast ()

intvips_check_bands_atleast (constchar *domain,VipsImage *im,int bands);

Check that the image has at leastbands bands.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

bands

at least this many bands

 

Returns

0 if OK, -1 otherwise.


vips_check_bands_1orn ()

intvips_check_bands_1orn (constchar *domain,VipsImage *im1,VipsImage *im2);

Check that the images have the same number of bands, or that one of theimages has just 1 band.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im1

first image to check

 

im2

second image to check

 

Returns

0 on OK, or -1 on error.


vips_check_bands_1orn_unary ()

intvips_check_bands_1orn_unary (constchar *domain,VipsImage *im,int n);

Check that an image has 1 orn bands. Handy for unary operations, cf.vips_check_bands_1orn().If not, set an error messageand return non-zero.

See also:vips_check_bands_1orn().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

n

number of bands, or 1

 

Returns

0 on OK, or -1 on error.


vips_check_bands_same ()

intvips_check_bands_same (constchar *domain,VipsImage *im1,VipsImage *im2);

Check that the images have the same number of bands.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im1

first image to check

 

im2

second image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_bandno ()

intvips_check_bandno (constchar *domain,VipsImage *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 messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

bandno

band number

 

Returns

0 if OK, -1 otherwise.


vips_check_int ()

intvips_check_int (constchar *domain,VipsImage *im);

Check that the image is in one of the integer formats.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_uint ()

intvips_check_uint (constchar *domain,VipsImage *im);

Check that the image is in one of the unsigned integer formats.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_uintorf ()

intvips_check_uintorf (constchar *domain,VipsImage *im);

Check that the image is unsigned int or float.Otherwise set an error message and return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_noncomplex ()

intvips_check_noncomplex (constchar *domain,VipsImage *im);

Check that the image is not complex.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_complex ()

intvips_check_complex (constchar *domain,VipsImage *im);

Check that the image is complex.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_twocomponents ()

intvips_check_twocomponents (constchar *domain,VipsImage *im);

Check that the image is has two "components", ie. is a one-band complex ora two-band non-complex.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_format ()

intvips_check_format (constchar *domain,VipsImage *im,VipsBandFormat fmt);

Check that the image has the specified format.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

fmt

format to test for

 

Returns

0 if OK, -1 otherwise.


vips_check_u8or16 ()

intvips_check_u8or16 (constchar *domain,VipsImage *im);

Check that the image is 8 or 16-bit unsigned integer.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_8or16 ()

intvips_check_8or16 (constchar *domain,VipsImage *im);

Check that the image is 8 or 16-bit integer, signed or unsigned.Otherwise set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_u8or16orf ()

intvips_check_u8or16orf (constchar *domain,VipsImage *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:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_format_same ()

intvips_check_format_same (constchar *domain,VipsImage *im1,VipsImage *im2);

Check that the images have the same format.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im1

first image to check

 

im2

second image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_size_same ()

intvips_check_size_same (constchar *domain,VipsImage *im1,VipsImage *im2);

Check that the images have the same size.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im1

first image to check

 

im2

second image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_oddsquare ()

intvips_check_oddsquare (constchar *domain,VipsImage *im);

Check that the image is square and that the sides are odd.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_vector_length ()

intvips_check_vector_length (constchar *domain,int n,int len);

Check thatn ==len.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

n

number of elements in vector

 

len

number of elements vector should have

 

Returns

0 if OK, -1 otherwise.


vips_check_vector ()

intvips_check_vector (constchar *domain,int n,VipsImage *im);

Operations with a vector constant need a 1-element vector, or a vector withthe same number of elements as there are bands in the image, or a 1-bandimage and a many-element vector.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

n

number of elements in vector

 

im

image to check against

 

Returns

0 if OK, -1 otherwise.


vips_check_hist ()

intvips_check_hist (constchar *domain,VipsImage *im);

Histogram images must have width or height 1, and must not have more than65536 elements. Return 0 if the image will pass as a histogram, or -1 andset an error message otherwise.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_matrix ()

intvips_check_matrix (constchar *domain,VipsImage *im,VipsImage **out);

Matrix images must have width and height less than 100000 and have 1 band.

Return 0 if the image will pass as a matrix, or -1 and set an errormessage otherwise.

out is set to beim cast to double and stored in memory. UseVIPS_MATRIX() to address values inout.

You must unrefout when you are done with it.

See also:VIPS_MATRIX(),vips_object_local()

Parameters

domain

the originating domain for the error message

 

im

image to check

 

out

put image as in-memory doubles here.

[out]

Returns

0 if OK, -1 otherwise.


vips_check_separable ()

intvips_check_separable (constchar *domain,VipsImage *im);

Separable matrix images must have width or height 1.Return 0 if the image will pass, or -1 andset an error message otherwise.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

im

image to check

 

Returns

0 if OK, -1 otherwise.


vips_check_precision_intfloat ()

intvips_check_precision_intfloat (constchar *domain,VipsPrecision precision);

Check thatprec image is either float or int.If not, set an error messageand return non-zero.

See also:vips_error().

Parameters

domain

the originating domain for the error message

 

precision

precision to check

 

Returns

0 on OK, or -1 on error.


Generated by GTK-Doc V1.34.0

[8]ページ先頭

©2009-2025 Movatter.jp