AppStreamCompose.Image

g AppStreamCompose.Image AppStreamCompose.Image GObject.Object GObject.Object GObject.Object->AppStreamCompose.Image

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_from_data (data, len, dest_size, compressed, flags)

class

new_from_file (fname, dest_size, flags)

class

supported_format_names ()

get_height ()

get_pixbuf ()

get_width ()

load_filename (filename, dest_size, src_size_min, flags)

save_filename (filename, width, height, flags)

save_pixbuf (width, height, flags)

scale (new_width, new_height)

scale_to_fit (size)

scale_to_height (new_height)

scale_to_width (new_width)

set_pixbuf (pixbuf)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class AppStreamCompose.Image(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

AppStreamCompose.ImageClass

classmethod new()
Return type:

AppStreamCompose.Image

Creates a new AppStreamCompose.Image.

classmethod new_from_data(data, len, dest_size, compressed, flags)
Parameters:
Raises:

GLib.Error

Return type:

AppStreamCompose.Image

Creates a new AppStreamCompose.Image from data in memory.

classmethod new_from_file(fname, dest_size, flags)
Parameters:
Raises:

GLib.Error

Return type:

AppStreamCompose.Image

Creates a new AppStreamCompose.Image from a file on the filesystem.

classmethod supported_format_names()
Returns:

A hash set of format names.

Return type:

{object: object}

Get a set of image format names we can currently read (via GdkPixbuf.Pixbuf).

get_height()
Return type:

int

Gets the image height.

get_pixbuf()
Returns:

the GdkPixbuf.Pixbuf, or None

Return type:

GdkPixbuf.Pixbuf

Gets the image pixbuf if set.

get_width()
Return type:

int

Gets the image width.

load_filename(filename, dest_size, src_size_min, flags)
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Reads an image from a file.

save_filename(filename, width, height, flags)
Parameters:
Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Saves the image to a file.

save_pixbuf(width, height, flags)
Parameters:
Returns:

A GdkPixbuf.Pixbuf of the specified size

Return type:

GdkPixbuf.Pixbuf

Resamples a pixbuf to a specific size.

scale(new_width, new_height)
Parameters:
  • new_width (int) – The new width.

  • new_height (int) – the new height.

Scale the image to the given size.

scale_to_fit(size)
Parameters:

size (int) – the maximum edge length.

Scale the image to fir in a square with the given edge length, and keep its aspect ratio.

scale_to_height(new_height)
Parameters:

new_height (int) – the new height.

Scale the image to the given height, preserving its aspect ratio.

scale_to_width(new_width)
Parameters:

new_width (int) – The new width.

Scale the image to the given width, preserving its aspect ratio.

set_pixbuf(pixbuf)
Parameters:

pixbuf (GdkPixbuf.Pixbuf) – the GdkPixbuf.Pixbuf, or None

Sets the image pixbuf.