![]() |
![]() |
![]() |
VIPS Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <vips/vips.h> #define VIPS_META_EXIF_NAME #define VIPS_META_XMP_NAME #define VIPS_META_IPCT_NAME #define VIPS_META_ICC_NAME #define VIPS_META_XML #define VIPS_META_RESOLUTION_UNIT #define VIPS_META_LOADER guint64 vips_format_sizeof (VipsBandFormat format
); int vips_image_get_width (const VipsImage *image
); int vips_image_get_height (const VipsImage *image
); int vips_image_get_bands (const VipsImage *image
); VipsBandFormat vips_image_get_format (const VipsImage *image
); VipsCoding vips_image_get_coding (const VipsImage *image
); VipsInterpretation vips_image_get_interpretation (const VipsImage *image
); VipsInterpretation vips_image_guess_interpretation (const VipsImage *image
); double vips_image_get_xres (const VipsImage *image
); double vips_image_get_yres (const VipsImage *image
); int vips_image_get_xoffset (const VipsImage *image
); int vips_image_get_yoffset (const VipsImage *image
); const char * vips_image_get_filename (const VipsImage *image
); const char * vips_image_get_mode (const VipsImage *image
); double vips_image_get_scale (const VipsImage *array
); double vips_image_get_offset (const VipsImage *array
); void * vips_image_get_data (VipsImage *image
); void vips_image_init_fields (VipsImage *image
,int xsize
,int ysize
,int bands
,VipsBandFormat format
,VipsCoding coding
,VipsInterpretation interpretation
,double xres
,double yres
); int vips_image_copy_fields_array (VipsImage *out
,VipsImage *in[]
); int vips_image_copy_fieldsv (VipsImage *out
,VipsImage *in1
,...
); int vips_image_copy_fields (VipsImage *out
,VipsImage *in
); void vips_image_set (VipsImage *image
,const char *field
,GValue *value
); int vips_image_get (const VipsImage *image
,const char *field
,GValue *value_copy
); int vips_image_get_as_string (const VipsImage *image
,const char *field
,char **out
); GType vips_image_get_typeof (const VipsImage *image
,const char *field
); gboolean vips_image_remove (VipsImage *image
,const char *field
); void * (*VipsImageMapFn) (VipsImage *image
,const char *field
,GValue *value
,void *a
); void * vips_image_map (VipsImage *image
,VipsImageMapFn fn
,void *a
); void vips_image_set_area (VipsImage *image
,const char *field
,VipsCallbackFn free_fn
,void *data
); int vips_image_get_area (const VipsImage *image
,const char *field
,void **data
); void vips_image_set_blob (VipsImage *image
,const char *field
,VipsCallbackFn free_fn
,void *data
,size_t length
); int vips_image_get_blob (const VipsImage *image
,const char *field
,void **data
,size_t *length
); int vips_image_get_int (const VipsImage *image
,const char *field
,int *out
); void vips_image_set_int (VipsImage *image
,const char *field
,int i
); int vips_image_get_double (const VipsImage *image
,const char *field
,double *out
); void vips_image_set_double (VipsImage *image
,const char *field
,double d
); int vips_image_get_string (const VipsImage *image
,const char *field
,const char **out
); void vips_image_set_string (VipsImage *image
,const char *field
,const char *str
); int vips_image_history_printf (VipsImage *image
,const char *format
,...
); int vips_image_history_args (VipsImage *image
,const char *name
,int argc
,char *argv[]
); const char * vips_image_get_history (VipsImage *image
);
These functions let you get at image header data (including metadata) in a uniform way. They are handy for language bindings but less useful for C users.
They first search the
VIPS header
fields (see image), then search for
a metadata field of that name (see
meta).
Use vips_image_get_typeof()
to test for the
existance and GType
of a header field.
See meta for a set of functions for adding new metadata to an image.
#define VIPS_META_EXIF_NAME "exif-data"
The name that JPEG read and write operations use for the image's EXIF data.
#define VIPS_META_XMP_NAME "xmp-data"
The name that JPEG read and write operations use for the image's XMP data.
#define VIPS_META_IPCT_NAME "ipct-data"
The name that JPEG read and write operations use for the image's IPCT data.
#define VIPS_META_ICC_NAME "icc-profile-data"
The name we use to attach an ICC profile. The file read and write
operations for TIFF, JPEG, PNG and others use this item of metadata to
attach and save ICC profiles. The profile is updated by the
vips_icc_transform()
operations.
#define VIPS_META_XML "xml-header"
The original XML that was used to code the metadata after reading a VIPS format file.
#define VIPS_META_RESOLUTION_UNIT "resolution-unit"
The JPEG and TIFF read and write operations use this to record the file's preferred unit for resolution.
#define VIPS_META_LOADER "vips-loader"
Record the name of the original loader here. Handy for hinting file formats and for debugging.
VipsInterpretation vips_image_get_interpretation (const VipsImage *image
);
VipsInterpretation vips_image_guess_interpretation (const VipsImage *image
);
void * vips_image_get_data (VipsImage *image
);
Return a pointer to the image's pixel data, if possible. This can involve allocating large amounts of memory and performing a long computation. Image pixels are laid out in band-packed rows.
See also: vips_image_wio_input()
.
|
image to get data for |
Returns : |
a pointer to pixel data, if possible. |
void vips_image_init_fields (VipsImage *image
,int xsize
,int ysize
,int bands
,VipsBandFormat format
,VipsCoding coding
,VipsInterpretation interpretation
,double xres
,double yres
);
A convenience function to set the header fields after creating an image.
Normally you copy the fields from one of your input images with
vips_image_copy_fields()
and then make
any adjustments you need, but if you are creating an image from scratch,
for example im_black()
or im_jpeg2vips()
, you do need to set all the
fields yourself.
See also: vips_image_copy_fields()
.
|
image to init |
|
image width |
|
image height |
|
image bands |
|
band format |
|
image coding |
|
image type |
|
horizontal resolution, pixels per millimetre |
|
vertical resolution, pixels per millimetre |
int vips_image_copy_fields_array (VipsImage *out
,VipsImage *in[]
);
Copy fields from all the input images to the output image. There must be at least one input image.
The first input image is used to set the main fields of out
(width
,
coding
and so on).
Metadata from all the images is merged on to out
, with lower-numbered items
overriding higher. So for example, if in
[0] and in
[1] both have an item
called "icc-profile", it's the profile attached to in
[0] that will end up
on out
.
Image history is completely copied from all in
. out
will have the history
of all the input images.
See also: vips_image_copy_fieldsv()
, vips_image_copy_fields()
.
|
image to copy to |
|
NULL -terminated array of images to copy from |
Returns : |
0 on success, -1 on error. |
int vips_image_copy_fieldsv (VipsImage *out
,VipsImage *in1
,...
);
Copy fields from all the input images to the output image. A convenience
function over vips_image_copy_fields_array()
.
See also: vips_image_copy_fields_array()
, vips_image_copy_fields()
.
|
image to copy to |
|
first image to copy from |
Returns : |
0 on success, -1 on error. |
int vips_image_copy_fields (VipsImage *out
,VipsImage *in
);
Copy fields from in
to out
. A convenience
function over vips_image_copy_fields_array()
.
See also: vips_image_copy_fields_array()
, vips_image_copy_fieldsv()
.
|
image to copy to |
|
image to copy from |
Returns : |
0 on success, -1 on error. |
void vips_image_set (VipsImage *image
,const char *field
,GValue *value
);
Set a piece of metadata on image
. Any old metadata with that name is
destroyed. The GValue is copied into the image, so you need to unset the
value when you're done with it.
For example, to set an integer on an image (though you would use the
convenience function vips_image_set_int()
in practice), you would need:
1 2 3 4 5 6 7 8 9 10 11 |