freeimage.h
FreeImage_RegisterLocalPlugin
DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_RegisterLocalPlugin(FI_InitProc proc_address, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0));
Registra un nuevo plugin para ser usado en FreeImage. El The reside directamente en la aplicación que maneja FreeImage. El primer parámetro es un puntero a una función que se usa para inicializar el plugin. La función de inicialización es responsable de rellenar una estructura de Plugin y de almacenar un número de formato asignado por el sistema y usado para el registro de mensajes.
static int s_format_id; void stdcall Init(Plugin *plugin, int format_id) { s_format_id = format_id; // pointer to a function that returns a type-string // for the bitmap. For example, a plugin that loads // BMPs returns the string “BMP”. plugin->format_proc = Format; // pointer to a function that returns a descriptive // string for the bitmap type. For example, a plugin // that loads BMPs may return “Windows or OS/2 Bitmap” plugin->description_proc = Description; // pointer to a function that returns a comma delimited // list of possible file extension that are valid for // this plugin. A JPEG plugin would return “jpeg,jif,jfif” plugin->extension_proc = Extension; // pointer to a function that is used to load the bitmap plugin->load_proc = Load; // pointer to a function that is used to save the bitmap plugin->save_proc = Save; // pointer to a function that will try to identify a // bitmap by looking at the first few bytes of the bitmap. plugin->validate_proc = Validate; }