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) #

def self.new(data : LibGdkPixbuf::PixbufModule, transfer : GICrystal::Transfer) #

def self.new(load : GdkPixbuf::PixbufModuleLoadFunc? = nil, load_xpm_data : GdkPixbuf::PixbufModuleLoadXpmDataFunc? = nil, stop_load : GdkPixbuf::PixbufModuleStopLoadFunc? = nil, load_increment : GdkPixbuf::PixbufModuleIncrementLoadFunc? = nil, load_animation : GdkPixbuf::PixbufModuleLoadAnimationFunc? = nil, save : GdkPixbuf::PixbufModuleSaveFunc? = nil, is_save_option_supported : GdkPixbuf::PixbufModuleSaveOptionSupportedFunc? = nil) #

Instance Method Detail

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

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


def _reserved1 : Pointer(Void)? #

def _reserved1! #

def _reserved2 : Pointer(Void)? #

def _reserved2! #

def _reserved3 : Pointer(Void)? #

def _reserved3! #

def _reserved4 : Pointer(Void)? #

def _reserved4! #

def begin_load : Pointer(Void)? #

def begin_load! #


def info! #

def is_save_option_supported : GdkPixbuf::PixbufModuleSaveOptionSupportedFunc #

def is_save_option_supported=(value : GdkPixbuf::PixbufModuleSaveOptionSupportedFunc) #


def load=(value : GdkPixbuf::PixbufModuleLoadFunc) #


def load_animation=(value : GdkPixbuf::PixbufModuleLoadAnimationFunc) #


def load_increment=(value : GdkPixbuf::PixbufModuleIncrementLoadFunc) #


def load_xpm_data=(value : GdkPixbuf::PixbufModuleLoadXpmDataFunc) #

def module : GModule::Module? #

def module! #

def module_name : String? #

def module_name! #

def module_path : String? #

def module_path! #


def save=(value : GdkPixbuf::PixbufModuleSaveFunc) #

def save_to_callback : Pointer(Void)? #

def save_to_callback! #


def stop_load=(value : GdkPixbuf::PixbufModuleStopLoadFunc) #

def to_unsafe #