![]() |
![]() |
![]() |
libMirage Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <mirage.h> MirageDebugMaskInfo; gboolean (*MirageEnumFilterStreamInfoCallback) (const MirageFilterStreamInfo *info
,gpointer user_data
); gboolean (*MirageEnumParserInfoCallback) (const MirageParserInfo *info
,gpointer user_data
); gboolean (*MirageEnumWriterInfoCallback) (const MirageWriterInfo *info
,gpointer user_data
); MirageWriter * mirage_create_writer (const gchar *writer_id
,GError **error
); gboolean mirage_enumerate_filter_streams (MirageEnumFilterStreamInfoCallback func
,gpointer user_data
,GError **error
); gboolean mirage_enumerate_parsers (MirageEnumParserInfoCallback func
,gpointer user_data
,GError **error
); gboolean mirage_enumerate_writers (MirageEnumWriterInfoCallback func
,gpointer user_data
,GError **error
); gboolean mirage_get_filter_streams_info (const MirageFilterStreamInfo **info
,gint *num_filter_streams
,GError **error
); gboolean mirage_get_filter_streams_type (const GType **types
,gint *num_filter_streams
,GError **error
); gboolean mirage_get_parsers_info (const MirageParserInfo **info
,gint *num_parsers
,GError **error
); gboolean mirage_get_parsers_type (const GType **types
,gint *num_parsers
,GError **error
); gboolean mirage_get_supported_debug_masks (const MirageDebugMaskInfo **masks
,gint *num_masks
,GError **error
); gboolean mirage_get_writers_info (const MirageWriterInfo **info
,gint *num_writers
,GError **error
); gboolean mirage_get_writers_type (const GType **types
,gint *num_writers
,GError **error
); gboolean mirage_initialize (GError **error
); gboolean mirage_shutdown (GError **error
);
These functions represent the core of the libMirage API. Before the
library can be used, it must be initialized using mirage_initialize()
,
which loads the plugins containing image parsers, writers and filter
streams. When library is no longer needed, it can be shut down using
mirage_shutdown()
, which unloads the plugins.
The core functions listed in this section enable enumeration of
supported parsers, writers and filter streams. Most of the core functionality
of libMirage, such as loading images, is encapsulated in MirageContext
object, which can be obtained using GLib's g_object_new()
.
typedef struct { gchar *name; gint value; } MirageDebugMaskInfo;
Structure containing debug mask information.
gboolean (*MirageEnumFilterStreamInfoCallback) (const MirageFilterStreamInfo *info
,gpointer user_data
);
Callback function type used with mirage_enumerate_filter_streams()
.
A pointer to filter stream information structure is stored in info
; the
structure belongs to the filter stream object and should not be modified.
user_data
is user data passed to enumeration function.
|
filter stream info. [in] |
|
user data passed to enumeration function. [in][closure] |
Returns : |
TRUE on success, otherwise FALSE
|
gboolean (*MirageEnumParserInfoCallback) (const MirageParserInfo *info
,gpointer user_data
);
Callback function type used with mirage_enumerate_parsers()
.
A pointer to parser information structure is stored in info
; the
structure belongs to the parser object and should not be modified.
user_data
is user data passed to enumeration function.
|
parser info. [in] |
|
user data passed to enumeration function. [in][closure] |
Returns : |
TRUE on success, otherwise FALSE
|
gboolean (*MirageEnumWriterInfoCallback) (const MirageWriterInfo *info
,gpointer user_data
);
Callback function type used with mirage_enumerate_writers()
.
A pointer to writer information structure is stored in info
; the
structure belongs to the writer object and should not be modified.
user_data
is user data passed to enumeration function.
|
writer info. [in] |
|
user data passed to enumeration function. [in][closure] |
Returns : |
TRUE on success, otherwise FALSE
|
MirageWriter * mirage_create_writer (const gchar *writer_id
,GError **error
);
Attempts to create an instance of image writer whose ID is writer_id
.
|
ID of writer to create. [in] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
newly-created writer object on success, NULL
on failure. The reference to the object should be released using
g_object_unref() when no longer needed. [transfer full]
|
gboolean mirage_enumerate_filter_streams (MirageEnumFilterStreamInfoCallback func
,gpointer user_data
,GError **error
);
Iterates over list of supported filter streams, calling func
for each filter stream.
If func
returns FALSE
, the function immediately returns FALSE
.
|
callback function. [in][scope call] |
|
data to be passed to callback function. [in][closure] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_enumerate_parsers (MirageEnumParserInfoCallback func
,gpointer user_data
,GError **error
);
Iterates over list of supported parsers, calling func
for each parser.
If func
returns FALSE
, the function immediately returns FALSE
.
|
callback function. [in][scope call] |
|
data to be passed to callback function. [in][closure] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_enumerate_writers (MirageEnumWriterInfoCallback func
,gpointer user_data
,GError **error
);
Iterates over list of supported writers, calling func
for each writers.
If func
returns FALSE
, the function immediately returns FALSE
.
|
callback function. [in][scope call] |
|
data to be passed to callback function. [in][closure] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_get_filter_streams_info (const MirageFilterStreamInfo **info
,gint *num_filter_streams
,GError **error
);
Retrieves information structures for supported filter streams.
|
array of filter streams' information structures. [out][array length=num_filter_streams][transfer none] |
|
number of supported filter streams. [out] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_get_filter_streams_type (const GType **types
,gint *num_filter_streams
,GError **error
);
Retrieves GType values for supported filter streams.
|
array of filter streams' GType values. [out][array length=num_filter_streams][transfer none] |
|
number of supported filter streams. [out] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_get_parsers_info (const MirageParserInfo **info
,gint *num_parsers
,GError **error
);
Retrieves information structures for supported parsers.
|
array of parsers' information structures. [out][array length=num_parsers][transfer none] |
|
number of supported parsers. [out] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_get_parsers_type (const GType **types
,gint *num_parsers
,GError **error
);
Retrieves GType values for supported parsers.
|
array of parsers' GType values. [out][array length=num_parsers][transfer none] |
|
number of supported parsers. [out] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_get_supported_debug_masks (const MirageDebugMaskInfo **masks
,gint *num_masks
,GError **error
);
Retrieves the pointer to array of supported debug masks and stores it in masks
.
The array consists of one or more structures of type MirageDebugMaskInfo. The
number of elements in the array is stored in num_masks
. The array belongs to
libMirage and should not be altered or freed.
|
location to store pointer to masks array. [out][transfer none][array length=num_masks] |
|
location to store number of elements in masks array. [out] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_get_writers_info (const MirageWriterInfo **info
,gint *num_writers
,GError **error
);
Retrieves information structures for supported parsers.
|
array of writers' information structures. [out][array length=num_writers][transfer none] |
|
number of supported writers. [out] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_get_writers_type (const GType **types
,gint *num_writers
,GError **error
);
Retrieves GType values for supported writers.
|
array of writers' GType values. [out][array length=num_writers][transfer none] |
|
number of supported writers. [out] |
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |
gboolean mirage_initialize (GError **error
);
Initializes libMirage library. It should be called before any other of libMirage functions.
|
location to store error, or NULL . [out][allow-none]
|
Returns : |
TRUE on success, FALSE on failure |