Top | Description | Object Hierarchy | ![]() | ![]() | ![]() | ![]() |
GBoxed├── VipsArea├── VipsArrayDouble├── VipsArrayImage├── VipsArrayInt├── VipsBlob├── VipsRefString├── VipsSaveString╰── VipsThing
VipsArea *vips_area_new (VipsCallbackFn free_fn
,void *data
);
A VipsArea wraps a chunk of memory. It adds reference counting and a freefunction. It also keeps a count and aGType
, so the area can be an array.
This type is used for things like passing an array of double or an array ofVipsObject pointers to operations, and for reference-counted immutablestrings.
Initial count == 1, so_unref()
after attaching somewhere.
See also:vips_area_unref()
.
free_fn |
| [scope async][nullable] |
data | data will be freed with this function. | [transfer full] |
VipsArea *vips_area_new_array (GType type
,size_t sizeof_type
,int n
);
An area which holds an array of elements of someGType
. To set values forthe elements, get the pointer and write.
See also:vips_area_unref()
.
VipsArea *vips_area_new_array_object (int n
);
An area which holds an array ofGObject
s. Seevips_area_new_array()
. Whenthe area is freed, eachGObject
will be unreffed.
Add an extra NULL element at the end, handy for eg.vips_image_pipeline_array()
etc.
See also:vips_area_unref()
.
void *vips_area_get_data (VipsArea *area
,size_t *length
,int *n
,GType *type
,size_t *sizeof_type
);
Return the data pointer plus optionally the length in bytes of an area,the number of elements, theGType
of each element and thesizeof()
eachelement.
VipsRefString *vips_ref_string_new (constchar *str
);
Create a new refstring. These are reference-counted immutable strings, usedto store string data in vips image metadata.
Strings must be valid utf-8; use blob for binary data.
See also:vips_area_unref()
.
constchar *vips_ref_string_get (VipsRefString *refstr
,size_t *length
);
Get a pointer to the private string inside a refstr. Handy for languagebindings.
See also:vips_value_get_ref_string()
.
VipsBlob *vips_blob_new (VipsCallbackFn free_fn
,constvoid *data
,size_t length
);
Likevips_area_new()
, but track a length as well. The returnedVipsBlobtakes ownership ofdata
and will free it withfree_fn
. PassNULL
forfree_fn
to not transfer ownership.
An area of mem with a free func and a length (some sort of binary object,like an ICC profile).
See also:vips_area_unref()
.
free_fn |
| [scope async][allow-none] |
data | data to store. | [array length=length][element-type guint8][transfer full] |
length | number of bytes in |
VipsBlob *vips_blob_copy (constvoid *data
,size_t length
);
Likevips_blob_new()
, but take a copy of the data. Useful for bindingswhich struggle with callbacks.
See also:vips_blob_new()
.
data | data to store. | [array length=length][element-type guint8][transfer none] |
length | number of bytes in |
constvoid *vips_blob_get (VipsBlob *blob
,size_t *length
);
Get the data from aVipsBlob.
See also:vips_blob_new()
.
voidvips_blob_set (VipsBlob *blob
,VipsCallbackFn free_fn
,constvoid *data
,size_t length
);
Any old data is freed and new data attached.
It's sometimes useful to be able to create blobs as empty and then fillthem later.
See also:vips_blob_new()
.
blob | VipsBlob to set | |
free_fn |
| [scope async][allow-none] |
data | data to store. | [array length=length][element-type guint8][transfer full] |
length | number of bytes in |
VipsArrayDouble *vips_array_double_new (constdouble *array
,int n
);
Allocate a new array of doubles and copyarray
into it. Free withvips_area_unref()
.
See also:VipsArea.
VipsArrayDouble *vips_array_double_newv (int n
,...
);
Allocate a new array ofn
doubles and copy @... into it. Free withvips_area_unref()
.
See also:vips_array_double_new()
double *vips_array_double_get (VipsArrayDouble *array
,int *n
);
Fetch a double array from aVipsArrayDouble. Useful for language bindings.
VipsArrayInt *vips_array_int_new (constint *array
,int n
);
Allocate a new array of ints and copyarray
into it. Free withvips_area_unref()
.
See also:VipsArea.
VipsArrayInt *vips_array_int_newv (int n
,...
);
Allocate a new array ofn
ints and copy @... into it. Free withvips_area_unref()
.
See also:vips_array_int_new()
int *vips_array_int_get (VipsArrayInt *array
,int *n
);
Fetch an int array from aVipsArrayInt. Useful for language bindings.
voidvips_value_set_area (GValue *value
,VipsCallbackFn free_fn
,void *data
);
Set value to be a ref-counted area of memory with a free function.
value | set this value | |
free_fn | data will be freed with this function. | [scope async][nullable] |
data | set | [transfer full] |
void *vips_value_get_area (constGValue *value
,size_t *length
);
Get the pointer from an area. Don't touch count (area is static).
constchar *vips_value_get_save_string (constGValue *value
);
Get the C string held internally by the GValue.
voidvips_value_set_save_string (GValue *value
,constchar *str
);
Copies the C string intovalue
.
str
should be a valid utf-8 string.
voidvips_value_set_save_stringf (GValue *value
,constchar *fmt
,...
);
Generates a string and copies it intovalue
.
value | GValue to set. | [out] |
fmt | printf()-style format string | |
... | arguments to |
constchar *vips_value_get_ref_string (constGValue *value
,size_t *length
);
Get the C string held internally by theGValue
.
voidvips_value_set_ref_string (GValue *value
,constchar *str
);
Copies the C stringstr
intovalue
.
vips_ref_string are immutable C strings that are copied between images bycopying reference-counted pointers, making them much more efficient thanregularGValue
strings.
str
should be a valid utf-8 string.
void *vips_value_get_blob (constGValue *value
,size_t *length
);
Returns the data pointer from a blob. Optionally returns the length too.
blobs are things like ICC profiles or EXIF data. They are relocatable, andare saved to VIPS files for you coded as base64 inside the XML. They arecopied by copying reference-counted pointers.
See also:vips_value_set_blob()
voidvips_value_set_blob (GValue *value
,VipsCallbackFn free_fn
,constvoid *data
,size_t length
);
Setsvalue
to hold adata
. Whenvalue
is freed,data
will befreed withfree_fn
.value
also holds a note of the size of the memoryarea.
blobs are things like ICC profiles or EXIF data. They are relocatable, andare saved to VIPS files for you coded as base64 inside the XML. They arecopied by copying reference-counted pointers.
See also:vips_value_get_blob()
value | GValue to set. | [out] |
free_fn | free function for | [scope async][nullable] |
data | pointer to area ofmemory. | [array length=length][element-type guint8][transfer full] |
length | length of memory area |
voidvips_value_set_blob_free (GValue *value
,void *data
,size_t length
);
Just likevips_value_set_blob()
, but whenvalue
is freed,data
will befreed withg_free()
.
This can be easier to call for language bindings.
See also:vips_value_set_blob()
voidvips_value_set_array (GValue *value
,int n
,GType type
,size_t sizeof_type
);
Setvalue
to be an array of things.
This allocates memory but does notinitialise the contents: get the pointer and write instead.
value |
| [out] |
n | number of elements | |
type | the type of each element | |
sizeof_type | the sizeof each element |
void *vips_value_get_array (constGValue *value
,int *n
,GType *type
,size_t *sizeof_type
);
Return the pointer to the array held byvalue
.Optionally return the other properties of the array inn
,type
,sizeof_type
.
See also:vips_value_set_array()
.
double *vips_value_get_array_double (constGValue *value
,int *n
);
Return the start of the array of doubles held byvalue
.optionally return the number of elements inn
.
See also:vips_array_double_new()
.
voidvips_value_set_array_double (GValue *value
,constdouble *array
,int n
);
Setvalue
to hold a copy ofarray
. Pass in the array length inn
.
See also:vips_array_double_get()
.
value |
| |
array | array of doubles. | [array length=n][allow-none] |
n | the number of elements |
int *vips_value_get_array_int (constGValue *value
,int *n
);
Return the start of the array of ints held byvalue
.optionally return the number of elements inn
.
See also:vips_array_int_new()
.
voidvips_value_set_array_int (GValue *value
,constint *array
,int n
);
Setvalue
to hold a copy ofarray
. Pass in the array length inn
.
See also:vips_array_int_get()
.
value |
| |
array | array of ints. | [array length=n][allow-none] |
n | the number of elements |
GObject **vips_value_get_array_object (constGValue *value
,int *n
);
Return the start of the array ofGObject
held byvalue
.Optionally return the number of elements inn
.
See also:vips_area_new_array_object()
.
voidvips_value_set_array_object (GValue *value
,int n
);
Setvalue
to hold an array ofGObject
. Pass in the array length inn
.
See also:vips_value_get_array_object()
.