# `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

  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)

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

  static to_enum(gtype, value)

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

  static from_enum(gtype, enum_value)

    Turn an int back into an enum string.

  static to_flag(gtype, value)

    Turn a string into a flag value ready to be passed into libvips.

  set_type(gtype)

    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)

    Set a GValue.

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

  get()

    Get the contents of a GValue.

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