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.CallbackFn
orNone
) – data will be freed with this functiondata (
object
orNone
) – data will be freed with this function
- Returns:
the new
Vips.Area
.- Return type:
A
Vips.Area
wraps a chunk of memory. It adds reference counting and a free function. It also keeps a count and aGObject.GType
, so the area can be an array.This type is used for things like passing an array of double or an array of
Vips.Object
pointers to operations, and for reference-counted immutable strings.Initial count == 1, so _unref() after attaching somewhere.
See also:
Vips.Area.unref
().
- classmethod new_array(type, sizeof_type, n)¶
- Parameters:
type (
GObject.GType
) –GObject.GType
of elements to storesizeof_type (
int
) – sizeof() an element in the arrayn (
int
) – number of elements in the array
- Returns:
the new
Vips.Area
.- Return type:
An area which holds an array of elements of some
GObject.GType
. To set values for the elements, get the pointer and write.See also:
Vips.Area.unref
().
- classmethod new_array_object(n)¶
-
An area which holds an array of
GObject.Object
s. SeeVips.Area.new_array
(). When the area is freed, eachGObject.Object
will be unreffed.Add an extra
None
element at the end, handy for eg. vips_image_pipeline_array() etc.See also:
Vips.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:
(
object
orNone
, 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
GObject.GType
of each element and the sizeof() each element.
- unref()¶