gdk-pixbuf-gdk-pixbuf: The GdkPixbuf Structure

Description Methods and Functions Hierarchy Detailed Description Structures Convenient Construction Enums and Flags Properties Author(s) References

Description

Information that describes an image.

Methods and Functions

gdkPixbufGetColorspace(object)
gdkPixbufGetNChannels(object)
gdkPixbufGetHasAlpha(object)
gdkPixbufGetBitsPerSample(object)
gdkPixbufGetPixels(object)
gdkPixbufGetWidth(object)
gdkPixbufGetHeight(object)
gdkPixbufGetRowstride(object)
gdkPixbufGetOption(object, key)
gdkPixbuf(width = -1, height = -1, filename, colorspace, has.alpha, bits.per.sample, preserve.aspect.ratio = 1, data, stream, cancellable = NULL, rowstride, .errwarn = TRUE)

Hierarchy

1
2

Detailed Description

The GdkPixbuf structure contains information that describes an image in memory.

Structures

GdkPixbuf

This is the main structure in the gdk-pixbuf library. It is used to represent images. It contains information about the image's pixel data, its color space, bits per sample, width and height, and the rowstride (the number of bytes between the start of one row and the start of the next).

Convenient Construction

gdkPixbuf is the result of collapsing the constructors of GdkPixbuf (gdkPixbufNew, gdkPixbufNewFromFile, gdkPixbufNewFromFileAtSize, gdkPixbufNewFromFileAtScale, gdkPixbufNewFromData, gdkPixbufNewFromXpmData, NULL, gdkPixbufNewFromStream, gdkPixbufNewFromStreamAtScale) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors.

Enums and Flags

GdkPixbufError

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.

corrupt-image

An image file was broken somehow.

insufficient-memory

Not enough memory.

bad-option-value

A bad option was passed to a pixbuf save module.

unknown-type

Unknown image type.

unsupported-operation

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

failed

Generic failure code, something went wrong.

GdkColorspace

This enumeration defines the color spaces that are supported by the gdk-pixbuf library. Currently only RGB is supported.

b

Indicates a red/green/blue additive color space.

GdkPixbufAlphaMode

These values can be passed to gdkPixbufRenderToDrawableAlpha 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.

bilevel

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

For now falls back to GDK_PIXBUF_ALPHA_BILEVEL. In the future it will do full alpha compositing.

Properties

bits-per-sample [integer : Read / Write / Construct Only]

The number of bits per sample. Currently only 8 bit per sample are supported. Allowed values: [1,16] Default value: 8

colorspace [GdkColorspace : Read / Write / Construct Only]

The colorspace in which the samples are interpreted. Default value: GDK_COLORSPACE_RGB

has-alpha [logical : Read / Write / Construct Only]

Whether the pixbuf has an alpha channel. Default value: FALSE

height [integer : Read / Write / Construct Only]

The number of rows of the pixbuf. Allowed values: >= 1 Default value: 1

n-channels [integer : Read / Write / Construct Only]

The number of samples per pixel. Currently, only 3 or 4 samples per pixel are supported. Allowed values: >= 0 Default value: 3

pixels [R object : Read / Write / Construct Only]

A pointer to the pixel data of the pixbuf.

rowstride [integer : Read / Write / Construct Only]

The number of bytes between the start of a row and the start of the next row. This number must (obviously) be at least as large as the width of the pixbuf. Allowed values: >= 1 Default value: 1

width [integer : Read / Write / Construct Only]

The number of columns of the pixbuf. Allowed values: >= 1 Default value: 1

Author(s)

Derived by RGtkGen from GTK+ documentation

References

https://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-The-GdkPixbuf-Structure.html


RGtk2 documentation built on Oct. 14, 2021, 5:08 p.m.