### Namespace

# AppStreamCompose – 1.0

Library to compose AppStream catalog metadata

Version | 1.2.0
Authors | AppStream Developers
License | LGPL-2.1-or-later
Website | https://www.freedesktop.org/software/appstream/docs/
Source | https://github.com/ximion/appstream

#### Build

C headers | `appstream-compose.h`
pkg-config files | `appstream-compose`

#### Dependencies

GObject—2.0 | The base type system library
| Browse documentation
Gio—2.0 | A modern, easy-to-use VFS API
| Browse documentation
AppStream—1.0 | Library to work with AppStream metadata
| Browse documentation

#### Additional documentation

- Classes Hierarchy

#### Classes

Compose |
DirectoryUnit |
Hint |
IconPolicy |
Media |
Result |
Unit |

#### Structs

IconPolicyIter | A `AscIconPolicyIter` structure represents an iterator that can be used to iterate over the icon sizes / policy entries of an `AscIconPolicy`. `AscIconPolicyIter` structures are typically allocated on the stack and then initialized with asc_icon_policy_iter_init(). since: 0.15.2
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. since: 1.2.0
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 %asc_image_target_get_skipped will return `TRUE`. since: 1.2.0

#### Enumerations

IconState | Designated state for an icon of a given size. since: 0.15.2
ImageFormat | File format of an image. since: 0.14.0
ImageScaleMode | How an image rendition should be scaled. Every mode preserves the aspect ratio of the source image - an image is never stretched or cropped to fill a target size. since: 1.2.0

#### Bitfields

ComposeFlags | Flags that affect the compose process. since: 0.14.5
ImageSaveFlags | The flags used for saving images. since: 0.14.0

#### Error Domains

ComposeError | A metadata composition error. since: 0.13.0
MediaError | A media processing error. since: 1.2.0

#### Callbacks

CheckMetadataEarlyFn | Function which is called after all metainfo and related data (e.g. desktop-entry files) has been loaded, but before any expensive operations such as screenshot downloads or font searches are performed. since: 0.15.1
TranslateDesktopTextFn | Function which is called while parsing a desktop-entry file to allow external translations of string values. This is used in e.g. the Ubuntu distribution. since: 0.14.2

#### Functions

build_component_global_id | Builds a global component ID from a component-id and a checksum (usually Blake3) generated from the component data. since: 0.13.0
component_get_source_icon | Find the unprocessed icon that a component was created with, that is the icon reference that came straight from its metainfo or desktop-entry file. A stock icon is preferred, but a local one is accepted as well to accommodate for applications that used the “local” icon type wrong. since: 1.2.0
compute_content_checksum_for_data | Compute a checksum for the given content. since: 1.1.3
globals_add_hint_tag | Register a new hint tag. If a previous tag with the given name already existed, the existing tag will not be replaced unless `override_existing` is set to `TRUE`. Please be careful when overriding tags! Tag severities can not be lowered by overriding a tag. since: 0.14.0
globals_fetch_hint_tags | Retrieve all hint tags that we know. since: 0.14.0
globals_get_ffprobe_binary | Get path to the “ffprobe” binary we should use. since: 0.14.6
globals_get_optipng_binary | Get path to the “optipng” binary we should use. since: 0.13.0
globals_get_tmp_dir | Get temporary directory used by appstream-compose. since: 0.13.0
globals_get_use_optipng | Get whether images should be optimized using optipng. since: 0.13.0
globals_hint_tag_exists | Check whether a hint tag with the given name is registered. since: 1.2.0
globals_hint_tag_explanation | Retrieve the explanation template of the given hint tag. since: 0.14.0
globals_hint_tag_severity | Retrieve the severity of the given hint tag. since: 0.14.0
globals_set_ffprobe_binary | Set path to the “ffprobe” binary we should use. since: 0.14.6
globals_set_optipng_binary | Set path to the “optipng” binary we should use. since: 0.13.0
globals_set_tmp_dir | Set temporary directory used by appstream-compose. since: 0.13.0
globals_set_use_optipng | Set whether images should be optimized using optipng. since: 0.13.0