Utility

Utility — A few conveniency functions.

Functions

Includes

#include <abydos.h>

Description

Functions

abydos_load ()

cairo_surface_t *
abydos_load (const char *mime_type,
             const char *filename);

Loades an image file and returns it as a cairo image surface.

Parameters

mime_type

MIME type

 

filename

file to load the image from

 

Returns

A cairo image surface, or NULL on error.


abydos_create_from_file ()

abydos_t *
abydos_create_from_file (const char *mime_type,
                         const char *filename);

Creates a new abydos_t object and loads an image file. This is identical to abydos_create() followed by abydos_from_file(). If the operation fails you can call abydos_error() to get an error message. Apart fram that nothing more can be done with ar and it must be destroyed.

Parameters

mime_type

MIME type

 

filename

file to load the image from

 

Returns

An abydos_t, Or NULL on error.


abydos_can_animate ()

cairo_bool_t
abydos_can_animate (abydos_t *ar);

Check if animation can be achieved in some way. That is, if it makes sence to call abydos_get_delay() and update after that specified time.

Parameters

ar

an abydos_t

 

Returns

True if animation is possible.


abydos_write_to_png ()

cairo_status_t
abydos_write_to_png (abydos_t *ar,
                     const char *filename);

Creates a PNG file with the current state of ar . Since the PNG format only supports a single image, only one variant of the current frame on the current page will be saved. Also any scalable element will be converted to pixels. You may want to call abydos_set_page_default() and abydos_set_frame_default() before calling this if you don't have a particular wish to save a certain page and/or frame.

Parameters

ar

an abydos_t

 

filename

file to write to

 

abydos_write_to_svg ()

cairo_status_t
abydos_write_to_svg (abydos_t *ar,
                     const char *filename);

Creates an SVG file with the current state of ar . Since the SVG format only supports a single image, only one variant of the current frame on the current page will be saved. You may want to call abydos_set_page_default() and * abydos_set_frame_default() before calling this if you don't have a particular wish to save a certain page and/or frame.

Parameters

ar

an abydos_t

 

filename

file to write to

 

abydos_write_to_webp ()

cairo_status_t
abydos_write_to_webp (abydos_t *ar,
                      const char *filename);

Creates a WEBP file with the current state of ar . Since the WEBP format supports animation (as separate frames) the animation will be perserved but only one variant of the current page. Also any scalable element will be converted to pixels. You may want to call abydos_set_page_default() before calling this if you don't have a particular wish to save a certain page. This function is only available if WEBP support was enabled at compile time.

Parameters

ar

an abydos_t

 

filename

file to write to