| .TH IM_HEADER 3 "7 May 2002" |
| .SH NAME |
| im_header_int, im_header_double, im_header_string, im_header_get, |
| im_header_get_type, im_header_map \- read fields from the image header |
| .SH SYNOPSIS |
| #include <vips/vips.h> |
| |
| int im_header_int( IMAGE *image, const char *field, int *out ) |
| .br |
| int im_header_double( IMAGE *image, const char *field, double *out ) |
| .br |
| int im_header_string( IMAGE *image, const char *field, char **out ) |
| .br |
| GType im_header_get_type( IMAGE *im, const char *field ); |
| .br |
| int im_header_get( IMAGE *im, const char *field, GValue *value_copy ); |
| .br |
| typedef void *(*im_header_map_fn)( IMAGE *, |
| const char *, GValue *, void *, void * ); |
| .br |
| void *im_header_map( IMAGE *im, |
| im_header_map_fn fn, void *a, void *b ); |
| |
| .SH DESCRIPTION |
| .B im_header_int(3) |
| reads the value of an integer header field. These are |
| "Xsize", "Ysize", "Bands", "Bbits", "BandFmt", "Coding", and "Type", or any |
| integer meta field. |
| |
| .B im_header_double(3) |
| reads the value of the integer header fields. These are |
| "Xres", and "Yres", or any double meta field. |
| |
| .B im_header_string(3) |
| reads the value of the integer header fields. These are |
| "Hist", and "filename" or any string meta field. |
| |
| .B im_header_get_type(3) |
| returns the GType (eg. G_TYPE_INT) for a field. It returns zero if the field |
| does not exist. It does not set |
| .B im_error(3), |
| so it's useful for test for a field's existence. |
| |
| .B im_header_get(3) |
| fills the GValue with a copy of the field value, if the field exists. The |
| value should be zeroed but otherwise uninitialised. The value should be unset |
| once the user has finished with it. |
| |
| .B im_header_map(3) |
| maps a function over all header fields, presenting the value of each field as |
| a GValue. Return non-NULL from the map function to stop iteration early. It |
| maps over the builtin fields first, then any meta fields. |
| |
| .SH RETURN VALUE |
| All functions returns 0 on success and -1 on error. |
| .SH SEE ALSO |
| im_close(3), im_open(3). |