XviewerImage: Xviewer Reference Manual

## XviewerImage

XviewerImage

## Functions

GQuark | xviewer_image_error_quark ()
XviewerImage * | xviewer_image_new ()
XviewerImage * | xviewer_image_new_file ()
gboolean | xviewer_image_load ()
void | xviewer_image_cancel_load ()
gboolean | xviewer_image_has_data ()
void | xviewer_image_data_ref ()
void | xviewer_image_data_unref ()
void | xviewer_image_set_thumbnail ()
gboolean | xviewer_image_save_as_by_info ()
gboolean | xviewer_image_save_by_info ()
GdkPixbuf * | xviewer_image_get_pixbuf ()
GdkPixbuf * | xviewer_image_get_thumbnail ()
void | xviewer_image_get_size ()
goffset | xviewer_image_get_bytes ()
gboolean | xviewer_image_is_modified ()
void | xviewer_image_modified ()
const gchar * | xviewer_image_get_caption ()
const gchar * | xviewer_image_get_collate_key ()
ExifData * | xviewer_image_get_exif_info ()
gpointer | xviewer_image_get_xmp_info ()
GFile * | xviewer_image_get_file ()
gchar * | xviewer_image_get_uri_for_display ()
XviewerImageStatus | xviewer_image_get_status ()
void | xviewer_image_transform ()
void | xviewer_image_autorotate ()
cmsHPROFILE | xviewer_image_get_profile ()
void | xviewer_image_apply_display_profile ()
void | xviewer_image_undo ()
GList * | xviewer_image_get_supported_mime_types ()
gboolean | xviewer_image_is_supported_mime_type ()
void | xviewer_image_file_changed ()
gboolean | xviewer_image_is_file_changed ()
XviewerImageMetadataStatus | xviewer_image_get_metadata_status ()
RsvgHandle * | xviewer_image_get_svg ()
XviewerTransform * | xviewer_image_get_transform ()
gboolean | xviewer_image_is_animation ()
gboolean | xviewer_image_is_svg ()
gboolean | xviewer_image_start_animation ()

## Types and Values

enum | XviewerImageData
#define | XVIEWER_IMAGE_DATA_ALL
enum | XviewerImageError
#define | XVIEWER_IMAGE_ERROR
enum | XviewerImageMetadataStatus
enum | XviewerImageStatus
| XviewerImage

## Description

## Functions

### xviewer_image_error_quark ()

    GQuark
    xviewer_image_error_quark (void);

### xviewer_image_new ()

    XviewerImage *
    xviewer_image_new (const char *txt_uri);

### xviewer_image_new_file ()

    XviewerImage *
    xviewer_image_new_file (GFile *file);

### xviewer_image_load ()

    gboolean
    xviewer_image_load (XviewerImage *img,
                        XviewerImageData data2read,
                        XviewerJob *job,
                        GError **error);

### xviewer_image_cancel_load ()

    void
    xviewer_image_cancel_load (XviewerImage *img);

### xviewer_image_has_data ()

    gboolean
    xviewer_image_has_data (XviewerImage *img,
                            XviewerImageData data);

### xviewer_image_data_ref ()

    void
    xviewer_image_data_ref (XviewerImage *img);

### xviewer_image_data_unref ()

    void
    xviewer_image_data_unref (XviewerImage *img);

### xviewer_image_set_thumbnail ()

    void
    xviewer_image_set_thumbnail (XviewerImage *img,
                                 GdkPixbuf *pixbuf);

### xviewer_image_save_as_by_info ()

    gboolean
    xviewer_image_save_as_by_info (XviewerImage *img,
                                   XviewerImageSaveInfo *source,
                                   XviewerImageSaveInfo *target,
                                   GError **error);

### xviewer_image_save_by_info ()

    gboolean
    xviewer_image_save_by_info (XviewerImage *img,
                                XviewerImageSaveInfo *source,
                                GError **error);

### xviewer_image_get_pixbuf ()

    GdkPixbuf *
    xviewer_image_get_pixbuf (XviewerImage *img);

Gets the GdkPixbuf of the image

#### Parameters

img | a XviewerImage |

#### Returns

a GdkPixbuf.

[transfer full]

### xviewer_image_get_thumbnail ()

    GdkPixbuf *
    xviewer_image_get_thumbnail (XviewerImage *img);

Gets the thumbnail pixbuf for `img`

#### Parameters

img | a XviewerImage |

#### Returns

a GdkPixbuf with a thumbnail.

[transfer full]

### xviewer_image_get_size ()

    void
    xviewer_image_get_size (XviewerImage *img,
                            gint *width,
                            gint *height);

### xviewer_image_get_bytes ()

    goffset
    xviewer_image_get_bytes (XviewerImage *img);

### xviewer_image_is_modified ()

    gboolean
    xviewer_image_is_modified (XviewerImage *img);

### xviewer_image_modified ()

    void
    xviewer_image_modified (XviewerImage *img);

### xviewer_image_get_caption ()

    const gchar *
    xviewer_image_get_caption (XviewerImage *img);

### xviewer_image_get_collate_key ()

    const gchar *
    xviewer_image_get_collate_key (XviewerImage *img);

### xviewer_image_get_exif_info ()

    ExifData *
    xviewer_image_get_exif_info (XviewerImage *img);

### xviewer_image_get_xmp_info ()

    gpointer
    xviewer_image_get_xmp_info (XviewerImage *img);

Gets the XMP info for `img` or NULL if compiled without libexempi support.

#### Parameters

img | a XviewerImage |

#### Returns

the xmp data.

[transfer full]

### xviewer_image_get_file ()

    GFile *
    xviewer_image_get_file (XviewerImage *img);

Gets the GFile associated with `img`

#### Parameters

img | a XviewerImage |

#### Returns

a GFile.

[transfer full]

### xviewer_image_get_uri_for_display ()

    gchar *
    xviewer_image_get_uri_for_display (XviewerImage *img);

### xviewer_image_get_status ()

    XviewerImageStatus
    xviewer_image_get_status (XviewerImage *img);

### xviewer_image_transform ()

    void
    xviewer_image_transform (XviewerImage *img,
                             XviewerTransform *trans,
                             XviewerJob *job);

### xviewer_image_autorotate ()

    void
    xviewer_image_autorotate (XviewerImage *img);

### xviewer_image_get_profile ()

    cmsHPROFILE
    xviewer_image_get_profile (XviewerImage *img);

### xviewer_image_apply_display_profile ()

    void
    xviewer_image_apply_display_profile (XviewerImage *img,
                                         cmsHPROFILE display_profile);

### xviewer_image_undo ()

    void
    xviewer_image_undo (XviewerImage *img);

### xviewer_image_get_supported_mime_types ()

    GList *
    xviewer_image_get_supported_mime_types
                                   (void);

Gets the list of supported mimetypes

#### Returns

a GList of supported mimetypes.

[transfer none][element-type utf8]

### xviewer_image_is_supported_mime_type ()

    gboolean
    xviewer_image_is_supported_mime_type (const char *mime_type);

### xviewer_image_file_changed ()

    void
    xviewer_image_file_changed (XviewerImage *img);

Marks the image file contents as changed. Also, emits XviewerImage::file-changed signal.

#### Parameters

img | a XviewerImage |

### xviewer_image_is_file_changed ()

    gboolean
    xviewer_image_is_file_changed (XviewerImage *img);

### xviewer_image_get_metadata_status ()

    XviewerImageMetadataStatus
    xviewer_image_get_metadata_status (XviewerImage *img);

Returns the current status of the image metadata, that is, whether the metadata has not been read yet, is ready, or not available at all.

#### Parameters

img | a XviewerImage |

#### Returns

one of XviewerImageMetadataStatus

### xviewer_image_get_svg ()

    RsvgHandle *
    xviewer_image_get_svg (XviewerImage *img);

### xviewer_image_get_transform ()

    XviewerTransform *
    xviewer_image_get_transform (XviewerImage *img);

### xviewer_image_is_animation ()

    gboolean
    xviewer_image_is_animation (XviewerImage *img);

Checks whether a given image is animated.

#### Parameters

img | a XviewerImage |

#### Returns

TRUE if it is an animated image, FALSE otherwise.

### xviewer_image_is_svg ()

    gboolean
    xviewer_image_is_svg (XviewerImage *img);

### xviewer_image_start_animation ()

    gboolean
    xviewer_image_start_animation (XviewerImage *img);

Starts playing an animated image.

#### Parameters

img | a XviewerImage |

#### Returns

`TRUE` on success, `FALSE` if `img` is already playing or isn't an animated image.

## Types and Values

### enum XviewerImageData

#### Members

XVIEWER_IMAGE_DATA_IMAGE |  |
XVIEWER_IMAGE_DATA_DIMENSION |  |
XVIEWER_IMAGE_DATA_EXIF |  |
XVIEWER_IMAGE_DATA_XMP |  |

### XVIEWER_IMAGE_DATA_ALL

    #define             XVIEWER_IMAGE_DATA_ALL

### enum XviewerImageError

#### Members

XVIEWER_IMAGE_ERROR_SAVE_NOT_LOCAL |  |
XVIEWER_IMAGE_ERROR_NOT_LOADED |  |
XVIEWER_IMAGE_ERROR_NOT_SAVED |  |
XVIEWER_IMAGE_ERROR_VFS |  |
XVIEWER_IMAGE_ERROR_FILE_EXISTS |  |
XVIEWER_IMAGE_ERROR_TMP_FILE_FAILED |  |
XVIEWER_IMAGE_ERROR_GENERIC |  |
XVIEWER_IMAGE_ERROR_UNKNOWN |  |

### XVIEWER_IMAGE_ERROR

    #define XVIEWER_IMAGE_ERROR xviewer_image_error_quark ()

### enum XviewerImageMetadataStatus

#### Members

XVIEWER_IMAGE_METADATA_NOT_READ |  |
XVIEWER_IMAGE_METADATA_NOT_AVAILABLE |  |
XVIEWER_IMAGE_METADATA_READY |  |

### enum XviewerImageStatus

#### Members

XVIEWER_IMAGE_STATUS_UNKNOWN |  |
XVIEWER_IMAGE_STATUS_LOADING |  |
XVIEWER_IMAGE_STATUS_LOADED |  |
XVIEWER_IMAGE_STATUS_SAVING |  |
XVIEWER_IMAGE_STATUS_FAILED |  |

### XviewerImage

    typedef struct {
    	GObject parent;

    	XviewerImagePrivate *priv;
    } XviewerImage;