AppStreamCompose.ImageSource

Fields

None

Methods

class

new (data)

copy ()

get_data ()

get_height ()

get_render_size ()

get_width ()

set_render_size (width, height)

Details

class AppStreamCompose.ImageSource

Describes the image a media operation should read, and how it should be loaded. After the operation has run, it also carries the dimensions the source image was loaded at.

Added in version 1.2.0.

classmethod new(data)
Parameters:

data (GLib.Bytes) – The raw image data to process.

Returns:

an AppStreamCompose.ImageSource

Return type:

AppStreamCompose.ImageSource

Create a new AppStreamCompose.ImageSource for the given image data.

Added in version 1.2.0.

copy()
Returns:

a new AppStreamCompose.ImageSource

Return type:

AppStreamCompose.ImageSource

Create a copy of an AppStreamCompose.ImageSource, including any result data it may already carry.

Added in version 1.2.0.

get_data()
Returns:

The image data.

Return type:

GLib.Bytes

Get the raw image data this source was created for.

Added in version 1.2.0.

get_height()
Returns:

The source height in pixels, or 0 if it is not known yet.

Return type:

int

Get the height the source image was loaded at. Only valid after the media operation this source was passed to has completed successfully.

Added in version 1.2.0.

get_render_size()
Returns:

width:

Destination of the render width.

height:

Destination of the render height.

Return type:

(width: int, height: int)

Get the size vector graphics are rendered at.

Added in version 1.2.0.

get_width()
Returns:

The source width in pixels, or 0 if it is not known yet.

Return type:

int

Get the width the source image was loaded at. Only valid after the media operation this source was passed to has completed successfully.

Added in version 1.2.0.

set_render_size(width, height)
Parameters:
  • width (int) – Width to render at, or 0 for the native size.

  • height (int) – Height to render at, or 0 for the native size.

Set the size vector graphics should be rendered at. This has no effect on raster images, which are always loaded at their native size.

Added in version 1.2.0.