AppStreamGlib.Image¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class AppStreamGlib.Image(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod kind_from_string(kind)[source]¶
- Parameters:
kind (
str
) – the string.- Returns:
a
AppStreamGlib.ImageKind
, orAppStreamGlib.ImageKind.UNKNOWN
for unknown.- Return type:
Converts the text representation to an enumerated value.
New in version 0.1.0.
- classmethod kind_to_string(kind)[source]¶
- Parameters:
kind (
AppStreamGlib.ImageKind
) – theAppStreamGlib.ImageKind
.- Returns:
string version of kind
- Return type:
Converts the enumerated value to an text representation.
New in version 0.1.0.
- classmethod new()[source]¶
- Returns:
- Return type:
Creates a new
AppStreamGlib.Image
.New in version 0.1.0.
- equal(image2)[source]¶
- Parameters:
image2 (
AppStreamGlib.Image
) – aAppStreamGlib.Image
instance.- Returns:
True
for success- Return type:
Checks if two images are the same.
New in version 0.5.7.
- get_basename()[source]¶
- Returns:
filename
- Return type:
Gets the suggested basename the image, including file extension.
New in version 0.1.6.
- get_height()[source]¶
- Returns:
height in pixels
- Return type:
Gets the image height.
New in version 0.1.0.
- get_pixbuf()[source]¶
- Returns:
the
GdkPixbuf.Pixbuf
, orNone
- Return type:
Gets the image pixbuf if set.
New in version 0.1.6.
- get_url()[source]¶
- Returns:
URL
- Return type:
Gets the full qualified URL for the image, usually pointing at some mirror.
New in version 0.1.0.
- get_width()[source]¶
- Returns:
width in pixels
- Return type:
Gets the image width.
New in version 0.1.0.
- load_filename(filename)[source]¶
-
Reads a pixbuf from a file.
NOTE: This function also sets the suggested filename which can be retrieved using
AppStreamGlib.Image.get_basename
(). This can be overridden if required.New in version 0.1.6.
- load_filename_full(filename, dest_size, src_size_min, flags)[source]¶
- Parameters:
filename (
str
) – filename to read fromdest_size (
int
) – The size of the constructed pixbuf, or 0 for the native sizesrc_size_min (
int
) – The smallest source size allowed, or 0 for noneflags (
AppStreamGlib.ImageLoadFlags
) – aAppStreamGlib.ImageLoadFlags
, e.g.AppStreamGlib.ImageLoadFlags.NONE
- Raises:
- Returns:
True
for success- Return type:
Reads an image from a file.
New in version 0.5.6.
- save_filename(filename, width, height, flags)[source]¶
- Parameters:
filename (
str
) – filename to write towidth (
int
) – target width, or 0 for defaultheight (
int
) – target height, or 0 for defaultflags (
AppStreamGlib.ImageSaveFlags
) – someAppStreamGlib.ImageSaveFlags
values, e.g.AppStreamGlib.ImageSaveFlags.PAD_16_9
- Raises:
- Returns:
True
for success- Return type:
Saves a pixbuf to a file.
New in version 0.1.6.
- save_pixbuf(width, height, flags)[source]¶
- Parameters:
width (
int
) – target width, or 0 for defaultheight (
int
) – target height, or 0 for defaultflags (
AppStreamGlib.ImageSaveFlags
) – someAppStreamGlib.ImageSaveFlags
values, e.g.AppStreamGlib.ImageSaveFlags.PAD_16_9
- Returns:
A
GdkPixbuf.Pixbuf
of the specified size- Return type:
Resamples a pixbuf to a specific size.
New in version 0.1.6.
- set_basename(basename)[source]¶
- Parameters:
basename (
str
) – the new filename basename.
Sets the image basename filename.
New in version 0.1.6.
- set_height(height)[source]¶
- Parameters:
height (
int
) – the height in pixels.
Sets the image height.
New in version 0.1.0.
- set_kind(kind)[source]¶
- Parameters:
kind (
AppStreamGlib.ImageKind
) – theAppStreamGlib.ImageKind
, e.g.AppStreamGlib.ImageKind.THUMBNAIL
.
Sets the image kind.
New in version 0.1.0.
- set_pixbuf(pixbuf)[source]¶
- Parameters:
pixbuf (
GdkPixbuf.Pixbuf
) – theGdkPixbuf.Pixbuf
, orNone
Sets the image pixbuf.
New in version 0.1.6.