FLTK 1.5.0
|
Fl_Shared_Image class. More...
#include "Fl_Image.H"
Go to the source code of this file.
Classes | |
class | Fl_Shared_Image |
This class supports caching, loading, and drawing of image files. More... | |
Typedefs | |
typedef Fl_Image *(* | Fl_Shared_Handler) (const char *name, uchar *header, int headerlen) |
Test function (typedef) for adding new shared image formats. More... | |
Functions | |
void | fl_register_images () |
Register the known image formats. More... | |
Fl_Shared_Image class.
Test function (typedef) for adding new shared image formats.
This defines the function type you can use to add a handler for unknown image formats that can be opened and loaded as an Fl_Shared_Image.
fl_register_images() adds all image formats known to FLTK. Call Fl_Shared_Image::add_handler() to add your own check function to the list of known image formats.
Your function will be passed the filename (name
), some header
bytes already read from the image file and the size headerlen
of the data read. The max value of size is implementation dependent. If your handler function needs to check more bytes you must open the image file yourself.
The provided buffer header
must not be overwritten.
If your handler function can identify the file type you must open the file and return a valid Fl_Image or derived type, otherwise you must return NULL
. Example:
[in] | name | filename to be checked and opened if applicable |
[in] | header | portion of the file that has already been read |
[in] | headerlen | length of provided header data |
NULL
.void fl_register_images | ( | ) |
Register the known image formats.
This function is provided in the fltk_images library and registers all of the "extra" image file formats known to FLTK that are not part of the core FLTK library.
You may add your own image formats with Fl_Shared_Image::add_handler().