Enums

Details

class GdkPixbuf.Colorspace(value)

Bases: GObject.GEnum

This enumeration defines the color spaces that are supported by the gdk-pixbuf library.

Currently only RGB is supported.

RGB = 0

Indicates a red/green/blue additive color space.

class GdkPixbuf.InterpType(value)

Bases: GObject.GEnum

Interpolation modes for scaling functions.

The GDK_INTERP_NEAREST mode is the fastest scaling method, but has horrible quality when scaling down; GDK_INTERP_BILINEAR is the best choice if you aren’t sure what to choose, it has a good speed/quality balance.

**Note**: Cubic filtering is missing from the list; hyperbolic interpolation is just as fast and results in higher quality.

NEAREST = 0

Nearest neighbor sampling; this is the fastest and lowest quality mode. Quality is normally unacceptable when scaling down, but may be OK when scaling up.

TILES = 1

This is an accurate simulation of the PostScript image operator without any interpolation enabled. Each pixel is rendered as a tiny parallelogram of solid color, the edges of which are implemented with antialiasing. It resembles nearest neighbor for enlargement, and bilinear for reduction.

BILINEAR = 2

Best quality/speed balance; use this mode by default. Bilinear interpolation. For enlargement, it is equivalent to point-sampling the ideal bilinear-interpolated image. For reduction, it is equivalent to laying down small tiles and integrating over the coverage area.

HYPER = 3

This is the slowest and highest quality reconstruction function. It is derived from the hyperbolic filters in Wolberg’s “Digital Image Warping”, and is formally defined as the hyperbolic-filter sampling the ideal hyperbolic-filter interpolated image (the filter is designed to be idempotent for 1:1 pixel mapping). **Deprecated**: this interpolation filter is deprecated, as in reality it has a lower quality than the GdkPixbuf.InterpType.BILINEAR filter

New in version 2.38.

class GdkPixbuf.PixbufAlphaMode(value)

Bases: GObject.GEnum

Control the alpha channel for drawables.

These values can be passed to gdk_pixbuf_xlib_render_to_drawable_alpha() in gdk-pixbuf-xlib to control how the alpha channel of an image should be handled.

This function can create a bilevel clipping mask (black and white) and use it while painting the image.

In the future, when the X Window System gets an alpha channel extension, it will be possible to do full alpha compositing onto arbitrary drawables. For now both cases fall back to a bilevel clipping mask.

Deprecated since version 2.42: There is no user of GdkPixbuf.PixbufAlphaMode in GdkPixbuf.Pixbuf, and the Xlib utility functions have been split out to their own library, gdk-pixbuf-xlib

BILEVEL = 0

A bilevel clipping mask (black and white) will be created and used to draw the image. Pixels below 0.5 opacity will be considered fully transparent, and all others will be considered fully opaque.

FULL = 1

For now falls back to GdkPixbuf.PixbufAlphaMode.BILEVEL. In the future it will do full alpha compositing.

class GdkPixbuf.PixbufError(value)

Bases: GObject.GEnum

An error code in the GDK_PIXBUF_ERROR domain.

Many gdk-pixbuf operations can cause errors in this domain, or in the G_FILE_ERROR domain.

classmethod quark()[source]
Return type:

int

CORRUPT_IMAGE = 0

An image file was broken somehow.

INSUFFICIENT_MEMORY = 1

Not enough memory.

BAD_OPTION = 2

A bad option was passed to a pixbuf save module.

UNKNOWN_TYPE = 3

Unknown image type.

UNSUPPORTED_OPERATION = 4

Don’t know how to perform the given operation on the type of image at hand.

FAILED = 5

Generic failure code, something went wrong.

INCOMPLETE_ANIMATION = 6

Only part of the animation was loaded.

class GdkPixbuf.PixbufRotation(value)

Bases: GObject.GEnum

The possible rotations which can be passed to GdkPixbuf.Pixbuf.rotate_simple().

To make them easier to use, their numerical values are the actual degrees.

NONE = 0

No rotation.

UPSIDEDOWN = 180

Rotate by 180 degrees.

CLOCKWISE = 270

Rotate by 270 degrees.

COUNTERCLOCKWISE = 90

Rotate by 90 degrees.