AppStreamCompose.Image¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class AppStreamCompose.Image(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Return type:
Creates a new
AppStreamCompose.Image.
- classmethod new_from_data(data, len, dest_width, dest_height, flags, format_hint)¶
- Parameters:
len (
int) – Length of the data to load.dest_width (
int) – The suggested width of the constructed pixbuf, or 0 for the native sizedest_height (
int) – The suggested height of the constructed pixbuf, or 0 for the native sizeflags (
AppStreamCompose.ImageLoadFlags) – aAppStreamCompose.ImageLoadFlags, e.g.AppStreamCompose.ImageLoadFlags.NONEformat_hint (
AppStreamCompose.ImageFormat) – Assume the specified image format for data, useAppStreamCompose.ImageFormat.UNKNOWNto guess.
- Raises:
- Return type:
Creates a new
AppStreamCompose.Imagefrom data in memory.
- classmethod new_from_file(fname, dest_width, dest_height, flags)¶
- Parameters:
fname (
str) – Name of the file to load.dest_width (
int) – The suggested width of the constructed pixbuf, or 0 for the native sizedest_height (
int) – The suggested height of the constructed pixbuf, or 0 for the native sizeflags (
AppStreamCompose.ImageLoadFlags) – aAppStreamCompose.ImageLoadFlags, e.g.AppStreamCompose.ImageLoadFlags.NONE
- Raises:
- Return type:
Creates a new
AppStreamCompose.Imagefrom a file on the filesystem.
- classmethod supported_format_names()¶
-
Get a set of image format names we can currently read (via GdkPixbuf).
- load_filename(filename, dest_width, dest_height, src_size_min, flags)¶
- Parameters:
filename (
str) – filename to read fromdest_width (
int) – The suggested width of the constructed pixbuf, or 0 for the native sizedest_height (
int) – The suggested height of the constructed pixbuf, or 0 for the native sizesrc_size_min (
int) – The smallest source size (width or height) allowed, or 0 for no limitflags (
AppStreamCompose.ImageLoadFlags) – aAppStreamCompose.ImageLoadFlags, e.g.AppStreamCompose.ImageLoadFlags.NONE
- Raises:
- Returns:
Truefor success- Return type:
Reads an image from a file.
- save_filename(filename, width, height, flags)¶
- Parameters:
filename (
str) – filename to write towidth (
int) – target width, or 0 for defaultheight (
int) – target height, or 0 for defaultflags (
AppStreamCompose.ImageSaveFlags) – someAppStreamCompose.ImageSaveFlagsvalues, e.g.AppStreamCompose.ImageSaveFlags.PAD_16_9
- Raises:
- Returns:
Truefor success- Return type:
Saves the image to a file.
- scale(new_width, 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.