GValue

This module defines the pyvips GValue class. You can use instances of this class to get and set GObject properties.

class pyvips.gvalue.GValue[source]

Wrap GValue in a Python class.

This class wraps GValue in a convenient interface. You can use instances of this class to get and set GObject properties.

On construction, GValue is all zero (empty). You can pass it to a get function to have it filled by GObject, or use init to set a type, set to set a value, then use it to set an object property.

GValue lifetime is managed automatically.

static gtype_to_python(gtype)[source]

Map a gtype to the name of the Python type we use to represent it.

static to_enum(gtype, value)[source]

Turn a string into an enum value ready to be passed into libvips.

static from_enum(gtype, enum_value)[source]

Turn an int back into an enum string.

set_type(gtype)[source]

Set the type of a GValue.

GValues have a set type, fixed at creation time. Use set_type to set the type of a GValue before assigning to it.

GTypes are 32 or 64-bit integers (depending on the platform). See type_find.

set(value)[source]

Set a GValue.

The value is converted to the type of the GValue, if possible, and assigned.

get()[source]

Get the contents of a GValue.

The contents of the GValue are read out as a Python type.