Movatterモバイル変換


[0]ホーム

URL:


libvips

A fast image processing library with low memory needs.

DownloadInstallDocumentationIssuesWikilibvips projectslibvips on GitHub
Top  | Description  | Object HierarchyHomeUpPrevNext

type

type — basic types

Stability Level

Stable, unless otherwise indicated

Functions

VipsThing *vips_thing_new ()
VipsArea *vips_area_copy ()
intvips_area_free_cb ()
voidvips_area_unref ()
VipsArea *vips_area_new ()
VipsArea *vips_area_new_array ()
VipsArea *vips_area_new_array_object ()
void *vips_area_get_data ()
#defineVIPS_ARRAY_ADDR()
VipsRefString *vips_ref_string_new ()
constchar *vips_ref_string_get ()
VipsBlob *vips_blob_new ()
VipsBlob *vips_blob_copy ()
constvoid *vips_blob_get ()
voidvips_blob_set ()
VipsArrayDouble *vips_array_double_new ()
VipsArrayDouble *vips_array_double_newv ()
double *vips_array_double_get ()
VipsArrayInt *vips_array_int_new ()
VipsArrayInt *vips_array_int_newv ()
int *vips_array_int_get ()
voidvips_value_set_area ()
void *vips_value_get_area ()
constchar *vips_value_get_save_string ()
voidvips_value_set_save_string ()
voidvips_value_set_save_stringf ()
constchar *vips_value_get_ref_string ()
voidvips_value_set_ref_string ()
void *vips_value_get_blob ()
voidvips_value_set_blob ()
voidvips_value_set_blob_free ()
voidvips_value_set_array ()
void *vips_value_get_array ()
double *vips_value_get_array_double ()
voidvips_value_set_array_double ()
int *vips_value_get_array_int ()
voidvips_value_set_array_int ()
GObject **vips_value_get_array_object ()
voidvips_value_set_array_object ()

Object Hierarchy

GBoxed├── VipsArea├── VipsArrayDouble├── VipsArrayImage├── VipsArrayInt├── VipsBlob├── VipsRefString├── VipsSaveString╰── VipsThing

Includes

#include <vips/vips.h>

Description

A selection ofGType definitions used by VIPS.

Functions

vips_thing_new ()

VipsThing *vips_thing_new (int i);

Returns

a newVipsThing.

[transfer full]


vips_area_copy ()

VipsArea *vips_area_copy (VipsArea *area);

vips_area_free_cb ()

intvips_area_free_cb (void *mem,VipsArea *area);

vips_area_unref ()

voidvips_area_unref (VipsArea *area);

vips_area_new ()

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().

Parameters

free_fn

datawill be freed with this function.

[scope async][nullable]

data

data will be freed with this function.

[transfer full]

Returns

the newVipsArea.

[transfer full]


vips_area_new_array ()

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().

Parameters

type

GType of elements to store

 

sizeof_type

sizeof() an element in the array

 

n

number of elements in the array

 

Returns

the newVipsArea.

[transfer full]


vips_area_new_array_object ()

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().

[constructor]

Parameters

n

number of elements in the array

 

Returns

the newVipsArea.

[transfer full]


vips_area_get_data ()

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.

Parameters

area

VipsArea to fetch from

 

length

optionally return length in bytes here.

[out][optional]

n

optionally return number of elements here.

[out][optional]

type

optionally return element type here.

[out][optional]

sizeof_type

optionally returnsizeof() element type here.

[out][optional]

Returns

The pointer held byarea.

[transfer none]


VIPS_ARRAY_ADDR()

#define             VIPS_ARRAY_ADDR(X, I)

vips_ref_string_new ()

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().

Parameters

str

string to store.

[transfer none]

Returns

the newVipsRefString, or NULL on error.

[transfer full][nullable]


vips_ref_string_get ()

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().

Parameters

refstr

theVipsRefString to fetch from

 

length

return length here, optionally.

[out][optional]

Returns

The C string held byrefstr.

[transfer none]


vips_blob_new ()

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().

Parameters

free_fn

datawill be freed with this function.

[scope async][allow-none]

data

data to store.

[array length=length][element-type guint8][transfer full]

length

number of bytes indata

 

Returns

the newVipsBlob.

[transfer full]


vips_blob_copy ()

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().

Parameters

data

data to store.

[array length=length][element-type guint8][transfer none]

length

number of bytes indata

 

Returns

the newVipsBlob.

[transfer full]


vips_blob_get ()

constvoid *vips_blob_get (VipsBlob *blob,size_t *length);

Get the data from aVipsBlob.

See also:vips_blob_new().

Parameters

blob

VipsBlob to fetch from

 

length

return number of bytes of data

 

Returns

thedata.

[array length=length][element-type guint8][transfer none]


vips_blob_set ()

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().

Parameters

blob

VipsBlob to set

 

free_fn

datawill be freed with this function.

[scope async][allow-none]

data

data to store.

[array length=length][element-type guint8][transfer full]

length

number of bytes indata

 

vips_array_double_new ()

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.

Parameters

array

array of double.

[array length=n]

n

number of doubles

 

Returns

A newVipsArrayDouble.

[transfer full]


vips_array_double_newv ()

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()

Parameters

n

number of doubles

 

...

list of double arguments

 

Returns

A newVipsArrayDouble.

[transfer full]


vips_array_double_get ()

double *vips_array_double_get (VipsArrayDouble *array,int *n);

Fetch a double array from aVipsArrayDouble. Useful for language bindings.

Parameters

array

theVipsArrayDouble to fetch from

 

n

length of array

 

Returns

array of double.

[array length=n][transfer none]


vips_array_int_new ()

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.

Parameters

array

array of int.

[array length=n]

n

number of ints

 

Returns

A newVipsArrayInt.

[transfer full]


vips_array_int_newv ()

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()

Parameters

n

number of ints

 

...

list of int arguments

 

Returns

A newVipsArrayInt.

[transfer full]


vips_array_int_get ()

int *vips_array_int_get (VipsArrayInt *array,int *n);

Fetch an int array from aVipsArrayInt. Useful for language bindings.

Parameters

array

theVipsArrayInt to fetch from

 

n

length of array

 

Returns

array of int.

[array length=n][transfer none]


vips_value_set_area ()

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.

Parameters

value

set this value

 

free_fn

data will be freed with this function.

[scope async][nullable]

data

setvalueto track this pointer.

[transfer full]

vips_value_get_area ()

void *vips_value_get_area (constGValue *value,size_t *length);

Get the pointer from an area. Don't touch count (area is static).

Parameters

value

get from this value

 

length

optionally return length here.

[out][optional]

Returns

The pointer held byvalue.

[transfer none]


vips_value_get_save_string ()

constchar *vips_value_get_save_string (constGValue *value);

Get the C string held internally by the GValue.

Parameters

value

GValue to get from

 

Returns

The C string held byvalue.

[transfer none]


vips_value_set_save_string ()

voidvips_value_set_save_string (GValue *value,constchar *str);

Copies the C string intovalue.

str should be a valid utf-8 string.

Parameters

value

GValue to set.

[out]

str

C string to copy into the GValue

 

vips_value_set_save_stringf ()

voidvips_value_set_save_stringf (GValue *value,constchar *fmt,...);

Generates a string and copies it intovalue.

Parameters

value

GValue to set.

[out]

fmt

printf()-style format string

 

...

arguments toprintf()-formattedfmt

 

vips_value_get_ref_string ()

constchar *vips_value_get_ref_string (constGValue *value,size_t *length);

Get the C string held internally by theGValue.

Parameters

value

GValue to get from

 

length

return length here, optionally.

[out][optional]

Returns

The C string held byvalue.

[transfer none]


vips_value_set_ref_string ()

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.

Parameters

value

GValue to set.

[out]

str

C string to copy into the GValue

 

vips_value_get_blob ()

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()

Parameters

value

GValue to set

 

length

optionally return length of memory area.

[out][optional]

Returns

The pointer heldbyvalue.

[transfer none][array length=length][element-type guint8]


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()

Parameters

value

GValue to set.

[out]

free_fn

free function fordata.

[scope async][nullable]

data

pointer to area ofmemory.

[array length=length][element-type guint8][transfer full]

length

length of memory area

 

vips_value_set_blob_free ()

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()

Parameters

value

GValue to set

 

data

(transfer full) (array length=length) (element-type guint8) : pointer to area ofmemory

 

length

length of memory area

 

vips_value_set_array ()

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.

Parameters

value

GValue to set.

[out]

n

number of elements

 

type

the type of each element

 

sizeof_type

the sizeof each element

 

vips_value_get_array ()

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().

Parameters

value

GValue to get from

 

n

return the number of elements here, optionally.

[out][optional]

type

return the type of each element here, optionally.

[out][optional]

sizeof_type

return the sizeof each element here, optionally.

[out][optional]

Returns

The array address.

[transfer none]


vips_value_get_array_double ()

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().

Parameters

value

GValue to get from

 

n

return the number of elements here, optionally.

[out][optional]

Returns

The array address.

[transfer none][array length=n]


vips_value_set_array_double ()

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().

Parameters

value

GValue to get from

 

array

array of doubles.

[array length=n][allow-none]

n

the number of elements

 

vips_value_get_array_int ()

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().

Parameters

value

GValue to get from

 

n

return the number of elements here, optionally.

[out][optional]

Returns

The array address.

[transfer none][array length=n]


vips_value_set_array_int ()

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().

Parameters

value

GValue to get from

 

array

array of ints.

[array length=n][allow-none]

n

the number of elements

 

vips_value_get_array_object ()

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().

[skip]

Parameters

value

GValue to get from

 

n

return the number of elements here, optionally.

[out][optional]

Returns

The array address.

[transfer none][array length=n]


vips_value_set_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().

Parameters

value

GValue to set.

[out]

n

the number of elements

 

See Also

header

Generated by GTK-Doc V1.34.0

[8]ページ先頭

©2009-2025 Movatter.jp