Top |
void | (*abydos_plugin_info_func_t) () |
void | (*abydos_plugin_progress_func_t) () |
#define | ABYDOS_PLUGIN_INFO_HAS() |
abydos_plugin_interface_t * | (*abydos_plugin_func_t) () |
To create a image loading plugin for abydos you must implement a function called "Abydos0" which returns a pointer to an abydos_plugin_interface_t. Which in turn must be filled with points to some functions.
These functions are mandatory:
get_mime_types
new
free
And at least one way to load an image. More than one can be provided. But implementing one by calling another is pointless since abydos knows how to do that anyway. One of these are mandatory:
progressive_begin, progressive_feed and progressive_end
create_from_data
create_from_file
And at least one way to get an image. Both can be provided. But implementing one by calling the other is pointless since abydos knows how to do that anyway. One of these are mandatory:
render
get_image_surface
If the plugin supports variants it also needs to implement:
get_variant_size
If the plugin supports animation it also needs to implement:
get_duration
The rest of the functions are optional.
void (*abydos_plugin_progress_func_t) (void *Param1
,cairo_rectangle_int_t *Param2
);
#define ABYDOS_PLUGIN_INFO_HAS(info,member) (offsetof(abydos_plugin_info_t,member)<(info)->version)
Macro to check if the version of the abydos_plugin_page_info_t info
has member
.
typedef struct _abydos_plugin_handle_t abydos_plugin_handle_t;
A pointer to an object provided by a plugin.
typedef struct { int version; const char *error; int width; int height; double pixel_ratio; /* multi page */ int page_count; /* layers */ int layer_count; /* variants */ int variant_count; /* animation */ int frame_count; /* flags */ cairo_bool_t scalable_size; cairo_bool_t scalable_time; cairo_bool_t threadsafe; /* 0.2 */ int default_page; int default_frame; cairo_bool_t threadsafe_render; } abydos_plugin_info_t;
#define ABYDOS_PLUGIN_INFO_VERSION sizeof(abydos_plugin_info_t)
The compile time version of abydos_plugin_info_t.
typedef struct { int version; void(*done)(void); const char **(*get_mime_types)(void); abydos_plugin_handle_t *(*new)(const char *mime_type,abydos_plugin_info_t *); void(*free)(abydos_plugin_handle_t *); void(*progressive_begin)(abydos_plugin_handle_t *,abydos_plugin_info_func_t,abydos_plugin_progress_func_t,void *); int(*progressive_feed)(abydos_plugin_handle_t *,const char *data,size_t len); int(*progressive_end)(abydos_plugin_handle_t *); int (*create_from_data)(abydos_plugin_handle_t *,const char *data, size_t len); int (*create_from_file)(abydos_plugin_handle_t *,const char *filename); void(*render)(abydos_plugin_handle_t *, cairo_t *cr,int page,cairo_bool_t *visible_layers,int prefered_variant,double time,int frame); cairo_surface_t *(*get_image_surface)(abydos_plugin_handle_t *,int page,cairo_bool_t *visible_layers,int prefered_variant,double time,int frame); void(*get_layer_visibility_OLD)(abydos_plugin_handle_t *,cairo_bool_t *visibility); int(*get_variant_size_OLD)(abydos_plugin_handle_t *,abydos_size_t *size); void(*get_duration_OLD)(abydos_plugin_handle_t *,double *frame_duration); void(*get_page_info)(abydos_plugin_handle_t *, int page, abydos_plugin_page_info_t *); void(*get_layer_visibility)(abydos_plugin_handle_t *,int page, cairo_bool_t *visibility); void(*get_variant_size)(abydos_plugin_handle_t *,int page, abydos_size_t *size); void(*get_duration)(abydos_plugin_handle_t *,int page, double *frame_duration); } abydos_plugin_interface_t;
Version of this structure supported by the plugin. Must always
be set to |
||
Function to be called before the plugin is unloaded. (optional) |
||
Function to get supported mime types. If must return a NULL terminated array. |
||
Function to create a new instance of |
||
Function to free all resources associated with the abydos_handle_t. May be called before or after the image has been loaded as well as in the middle of a progressive load. |
||
Function to render the image using cairo. The arguments passed
to the function has already been checked by abydos and are
valid. The arguments |
||
Function to get an image surface for the image (according to the supplied arguments). Usually just return a reference to an internal image surface created during the load stage. |
||
#define ABYDOS_PLUGIN_INTERFACE_VERSION sizeof(abydos_plugin_interface_t)
The compile time version of abydos_plugin_interface_t.