AsImage: AppStream Library Reference Manual

## AsImage

AsImage — Object representing a single image used in a screenshot.

## Functions

AsImageKind | as_image_kind_from_string ()
const gchar * | as_image_kind_to_string ()
AsImage * | as_image_new ()
AsImageKind | as_image_get_kind ()
void | as_image_set_kind ()
const gchar * | as_image_get_url ()
void | as_image_set_url ()
guint | as_image_get_width ()
void | as_image_set_width ()
guint | as_image_get_height ()
void | as_image_set_height ()
const gchar * | as_image_get_locale ()
void | as_image_set_locale ()

## Types and Values

#define | AS_TYPE_IMAGE
struct | AsImageClass
enum | AsImageKind
#define | AS_IMAGE_LARGE_HEIGHT
#define | AS_IMAGE_LARGE_WIDTH
#define | AS_IMAGE_NORMAL_HEIGHT
#define | AS_IMAGE_NORMAL_WIDTH
#define | AS_IMAGE_THUMBNAIL_HEIGHT
#define | AS_IMAGE_THUMBNAIL_WIDTH
| AsImage

## Description

Screenshot may have multiple versions of an image in different resolutions or aspect ratios. This object allows access to the location and size of a single image.

See also: AsScreenshot

## Functions

### as_image_kind_from_string ()

    AsImageKind
    as_image_kind_from_string (const gchar *kind);

Converts the text representation to an enumerated value.

#### Parameters

kind | the string. |

#### Returns

a AsImageKind, or `AS_IMAGE_KIND_UNKNOWN` for unknown.

[transfer full]

### as_image_kind_to_string ()

    const gchar *
    as_image_kind_to_string (AsImageKind kind);

Converts the enumerated value to an text representation.

#### Parameters

kind | the AsImageKind. |

#### Returns

string version of `kind`

### as_image_new ()

    AsImage *
    as_image_new (void);

Creates a new AsImage.

#### Returns

a AsImage.

[transfer full]

### as_image_get_kind ()

    AsImageKind
    as_image_get_kind (AsImage *image);

Gets the image kind.

#### Parameters

image | a AsImage instance. |

#### Returns

the AsImageKind

### as_image_set_kind ()

    void
    as_image_set_kind (AsImage *image,
                       AsImageKind kind);

Sets the image kind.

#### Parameters

image | a AsImage instance. |
kind | the AsImageKind, e.g. `AS_IMAGE_KIND_THUMBNAIL`. |

### as_image_get_url ()

    const gchar *
    as_image_get_url (AsImage *image);

Gets the full qualified URL for the image, usually pointing at some mirror.

#### Parameters

image | a AsImage instance. |

#### Returns

URL

### as_image_set_url ()

    void
    as_image_set_url (AsImage *image,
                      const gchar *url);

Sets the fully-qualified mirror URL to use for the image.

#### Parameters

image | a AsImage instance. |
url | the URL. |

### as_image_get_width ()

    guint
    as_image_get_width (AsImage *image);

Gets the image width.

#### Parameters

image | a AsImage instance. |

#### Returns

width in pixels

### as_image_set_width ()

    void
    as_image_set_width (AsImage *image,
                        guint width);

Sets the image width.

#### Parameters

image | a AsImage instance. |
width | the width in pixels. |

### as_image_get_height ()

    guint
    as_image_get_height (AsImage *image);

Gets the image height.

#### Parameters

image | a AsImage instance. |

#### Returns

height in pixels

### as_image_set_height ()

    void
    as_image_set_height (AsImage *image,
                         guint height);

Sets the image height.

#### Parameters

image | a AsImage instance. |
height | the height in pixels. |

### as_image_get_locale ()

    const gchar *
    as_image_get_locale (AsImage *image);

Get locale for this image.

#### Parameters

image | a AsImage instance. |

#### Returns

Locale string

Since: 0.9.5

### as_image_set_locale ()

    void
    as_image_set_locale (AsImage *image,
                         const gchar *locale);

Sets the locale for this image.

#### Parameters

image | a AsImage instance. |
locale | the locale string. |

Since: 0.9.5

## Types and Values

### AS_TYPE_IMAGE

    #define AS_TYPE_IMAGE (as_image_get_type ())

### struct AsImageClass

    struct AsImageClass {
    	GObjectClass		parent_class;
    };

### enum AsImageKind

The image type.

#### Members

AS_IMAGE_KIND_UNKNOWN | Type invalid or not known |
AS_IMAGE_KIND_SOURCE | The source image at full resolution |
AS_IMAGE_KIND_THUMBNAIL | A thumbnail at reduced resolution |

### AS_IMAGE_LARGE_HEIGHT

    #define AS_IMAGE_LARGE_HEIGHT		423 /* Since: 0.14.0 */

### AS_IMAGE_LARGE_WIDTH

    #define AS_IMAGE_LARGE_WIDTH		752 /* Since: 0.14.0 */

### AS_IMAGE_NORMAL_HEIGHT

    #define AS_IMAGE_NORMAL_HEIGHT		351 /* Since: 0.14.0 */

### AS_IMAGE_NORMAL_WIDTH

    #define AS_IMAGE_NORMAL_WIDTH		624 /* Since: 0.14.0 */

### AS_IMAGE_THUMBNAIL_HEIGHT

    #define AS_IMAGE_THUMBNAIL_HEIGHT 63 /* Since: 0.14.0 */

### AS_IMAGE_THUMBNAIL_WIDTH

    #define AS_IMAGE_THUMBNAIL_WIDTH 	112 /* Since: 0.14.0 */

### AsImage

    typedef struct _AsImage AsImage;