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_width, dest_height, flags, format_hint)

class

new_from_file (fname, dest_width, dest_height, flags)

class

supported_format_names ()

get_height ()

get_width ()

load_filename (filename, dest_width, dest_height, src_size_min, flags)

save_filename (filename, width, height, flags)

scale (new_width, new_height)

scale_to_fit (size)

scale_to_height (new_height)

scale_to_width (new_width)

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_width, dest_height, flags, format_hint)
Parameters:
Raises:

GLib.Error

Return type:

AppStreamCompose.Image

Creates a new AppStreamCompose.Image from data in memory.

classmethod new_from_file(fname, dest_width, dest_height, 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).

get_height()
Return type:

int

Gets the image height.

get_width()
Return type:

int

Gets the image width.

load_filename(filename, dest_width, dest_height, 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.

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.