class GdkPixbuf::PixbufModule

Overview

A Gdk::PixbufModule contains the necessary functions to load and save images in a certain file format.

If Gdk::Pixbuf has been compiled with GModule support, it can be extended by modules which can load (and perhaps also save) new image and animation formats.

Implementing modules

The Gdk::Pixbuf interfaces needed for implementing modules are contained in gdk-pixbuf-io.h (and gdk-pixbuf-animation.h if the module supports animations). They are not covered by the same stability guarantees as the regular Gdk::Pixbuf API. To underline this fact, they are protected by the GDK_PIXBUF_ENABLE_BACKEND pre-processor symbol.

Each loadable module must contain a Gdk::PixbufModuleFillVtableFunc function named fill_vtable, which will get called when the module is loaded and must set the function pointers of the Gdk::PixbufModule.

In order to make format-checking work before actually loading the modules (which may require calling dlopen to load image libraries), modules export their signatures (and other information) via the fill_info function. An external utility, gdk-pixbuf-query-loaders, uses this to create a text file containing a list of all available loaders and their signatures. This file is then read at runtime by Gdk::Pixbuf to obtain the list of available loaders and their signatures.

Modules may only implement a subset of the functionality available via Gdk::PixbufModule. If a particular functionality is not implemented, the fill_vtable function will simply not set the corresponding function pointers of the Gdk::PixbufModule structure. If a module supports incremental loading (i.e. provides #begin_load, #stop_load and #load_increment), it doesn't have to implement #load, since Gdk::Pixbuf can supply a generic #load implementation wrapping the incremental loading.

Installing modules

Installing a module is a two-step process:

Defined in:

lib/gi-crystal/src/auto/gdk_pixbuf-2.0/pixbuf_module.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pointer : Pointer(Void), transfer : GICrystal::Transfer) #

[View source]
def self.new(data : LibGdkPixbuf::PixbufModule, transfer : GICrystal::Transfer) #

[View source]
def self.new(load : GdkPixbuf::PixbufModuleLoadFunc | Nil = nil, load_xpm_data : GdkPixbuf::PixbufModuleLoadXpmDataFunc | Nil = nil, stop_load : GdkPixbuf::PixbufModuleStopLoadFunc | Nil = nil, load_increment : GdkPixbuf::PixbufModuleIncrementLoadFunc | Nil = nil, load_animation : GdkPixbuf::PixbufModuleLoadAnimationFunc | Nil = nil, save : GdkPixbuf::PixbufModuleSaveFunc | Nil = nil, is_save_option_supported : GdkPixbuf::PixbufModuleSaveOptionSupportedFunc | Nil = nil) #

[View source]

Instance Method Detail

def ==(other : self) : Bool #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


[View source]
def _reserved1 : Pointer(Void) | Nil #

[View source]
def _reserved1! #

[View source]
def _reserved2 : Pointer(Void) | Nil #

[View source]
def _reserved2! #

[View source]
def _reserved3 : Pointer(Void) | Nil #

[View source]
def _reserved3! #

[View source]
def _reserved4 : Pointer(Void) | Nil #

[View source]
def _reserved4! #

[View source]
def begin_load : Pointer(Void) | Nil #

[View source]
def begin_load! #

[View source]
def info : GdkPixbuf::PixbufFormat | Nil #

[View source]
def info! #

[View source]
def is_save_option_supported : GdkPixbuf::PixbufModuleSaveOptionSupportedFunc #

[View source]
def is_save_option_supported=(value : GdkPixbuf::PixbufModuleSaveOptionSupportedFunc) #

[View source]

[View source]
def load=(value : GdkPixbuf::PixbufModuleLoadFunc) #

[View source]

[View source]
def load_animation=(value : GdkPixbuf::PixbufModuleLoadAnimationFunc) #

[View source]

[View source]
def load_increment=(value : GdkPixbuf::PixbufModuleIncrementLoadFunc) #

[View source]

[View source]
def load_xpm_data=(value : GdkPixbuf::PixbufModuleLoadXpmDataFunc) #

[View source]
def module : GModule::Module | Nil #

[View source]
def module! #

[View source]
def module_name : String | Nil #

[View source]
def module_name! #

[View source]
def module_path : String | Nil #

[View source]
def module_path! #

[View source]

[View source]
def save=(value : GdkPixbuf::PixbufModuleSaveFunc) #

[View source]
def save_to_callback : Pointer(Void) | Nil #

[View source]
def save_to_callback! #

[View source]

[View source]
def stop_load=(value : GdkPixbuf::PixbufModuleStopLoadFunc) #

[View source]
def to_unsafe #

[View source]