AppStreamCompose.ImageTarget¶
Fields¶
None
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class AppStreamCompose.ImageTarget¶
Describes one requested output rendition of a media operation, and carries its result data after the operation was run. Renditions that were skipped due to one of their source-size conditions are not an error: the operation still succeeds, and
AppStreamCompose.ImageTarget.get_skippedwill returnTrue.Added in version 1.2.0.
- classmethod new(name, scale_mode, width, height)¶
- Parameters:
name (
str) – Filename the rendition should be stored as.scale_mode (
AppStreamCompose.ImageScaleMode) – anAppStreamCompose.ImageScaleModewidth (
int) – Target width (used depending on scale_mode).height (
int) – Target height (used depending on scale_mode).
- Returns:
- Return type:
Create a new
AppStreamCompose.ImageTarget. The image format the rendition is stored in is derived from the file extension of name.name must be a single path segment: it is resolved relative to the output directory of the media operation, and must not contain any directory components or refer to a parent directory.
Added in version 1.2.0.
- copy()¶
- Returns:
- Return type:
Create a deep copy of an
AppStreamCompose.ImageTarget, including any result data it may already carry.Added in version 1.2.0.
- get_error_message()¶
-
Get the error message in case creating this particular rendition failed. A failed rendition does not fail the media operation as a whole.
Added in version 1.2.0.
- get_height()¶
- Returns:
The requested height in pixels.
- Return type:
Get the requested height of this rendition. Depending on the scale mode, this may differ from the height the rendition is actually stored at.
Added in version 1.2.0.
- get_name()¶
- Returns:
The rendition filename.
- Return type:
Get the filename this rendition is stored as.
Added in version 1.2.0.
- get_only_downscale()¶
-
Get whether this rendition should be skipped rather than considering to upscale it to the target size(s).
Added in version 1.2.0.
- get_result_height()¶
- Returns:
The rendition height in pixels, or 0 if it was not stored.
- Return type:
Get the actual height of the stored rendition.
Added in version 1.2.0.
- get_result_width()¶
- Returns:
The rendition width in pixels, or 0 if it was not stored.
- Return type:
Get the actual width of the stored rendition.
Added in version 1.2.0.
- get_save_flags()¶
- Returns:
the
AppStreamCompose.ImageSaveFlagsin use.- Return type:
Get the flags used when storing this rendition.
Added in version 1.2.0.
- get_scale_mode()¶
- Returns:
- Return type:
Get the scaling mode this rendition is created with.
Added in version 1.2.0.
- get_skipped()¶
-
Check whether this rendition was skipped because the source image did not satisfy its source-size conditions. Only valid after the media operation this target was passed to has completed successfully.
Added in version 1.2.0.
- get_source_size_range()¶
- Returns:
- min_width:
Destination of the minimum source image width.
- min_height:
Destination of the minimum source image height.
- max_width:
Destination of the maximum source image width.
- max_height:
Destination of the maximum source image height.
- Return type:
(min_width:
int, min_height:int, max_width:int, max_height:int)
Get the source image dimensions this rendition is restricted to. A value of 0 means that the respective dimension is not limited.
Added in version 1.2.0.
- get_width()¶
- Returns:
The requested width in pixels.
- Return type:
Get the requested width of this rendition. Depending on the scale mode, this may differ from the width the rendition is actually stored at.
Added in version 1.2.0.
- set_only_downscale(only_downscale)¶
-
Set whether this rendition should be skipped in case creating it would mean upscaling the source image.
Added in version 1.2.0.
- set_save_flags(flags)¶
- Parameters:
flags (
AppStreamCompose.ImageSaveFlags) – theAppStreamCompose.ImageSaveFlagsto use.
Set the flags used when storing this rendition.
Added in version 1.2.0.
- set_source_size_range(min_width, min_height, max_width, max_height)¶
- Parameters:
Restrict the source images this rendition is created for. If the source image’s dimensions fall outside of the given range, the rendition is skipped and no file is written for it, while the media operation as a whole still succeeds.
Added in version 1.2.0.