Vips.Area¶
Fields¶
Name |
Type |
Access |
Description |
|---|---|---|---|
client |
r |
||
count |
r |
||
data |
r/w |
||
free_fn |
r |
||
length |
r/w |
||
lock |
r |
||
n |
r/w |
||
sizeof_type |
r |
||
type |
r |
Methods¶
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
Details¶
- class Vips.Area¶
- classmethod free_cb(mem, area)¶
- classmethod new(free_fn, *data)¶
- Parameters:
free_fn (
Vips.CallbackFnorNone) – data will be freed with this functiondata (
objectorNone) – data will be freed with this function
- Returns:
the new [struct`Area`].
- Return type:
A
Vips.Areawraps a chunk of memory. It adds reference counting and a free function. It also keeps a count and a [alias`GObject`.Type], so the area can be an array.This type is used for things like passing an array of double or an array of [class`Object`] pointers to operations, and for reference-counted immutable strings.
Initial count == 1, so [method`Area`.unref] after attaching somewhere.
::: seealso [method`Area`.unref].
- classmethod new_array(type, sizeof_type, n)¶
- Parameters:
type (
GObject.GType) – [alias`GObject`.Type] of elements to storesizeof_type (
int) –sizeof()an element in the arrayn (
int) – number of elements in the array
- Returns:
the new [struct`Area`].
- Return type:
An area which holds an array of elements of some [alias`GObject`.Type]. To set values for the elements, get the pointer and write.
::: seealso [method`Area`.unref].
- classmethod new_array_object(n)¶
- Parameters:
n (
int) – number of elements in the array- Returns:
the new [struct`Area`].
- Return type:
An area which holds an array of [class`GObject`.Object] s. See [ctor`Area`.new_array]. When the area is freed, each [class`GObject`.Object] will be unreffed.
Add an extra
NULLelement at the end, handy for eg. [func`Image`.pipeline_array] etc.::: seealso [method`Area`.unref].
- get_data()¶
- Returns:
The pointer held by self.
- length:
optionally return length in bytes here
- n:
optionally return number of elements here
- type:
optionally return element type here
- sizeof_type:
optionally return
sizeof()element type here
- Return type:
(
objectorNone, length:int, n:int, type:GObject.GType, sizeof_type:int)
Return the data pointer plus optionally the length in bytes of an area, the number of elements, the [alias`GObject`.Type] of each element and the
sizeof()each element.
- unref()¶