00001 #ifndef _FL_IMAGE_IO_H_
00002 #define _FL_IMAGE_IO_H_
00003
00004 #include "Enumerations.h"
00005 #include "Fl_Renderer.h"
00006 #include "Fl_PtrList.h"
00007 #include "Fl_Export.h"
00008
00009 #include <stdio.h>
00010
00015 typedef enum Fl_ImageQualityEnum {
00016 FL_QUALITY_POOR = 0,
00017 FL_QUALITY_NORMAL,
00018 FL_QUALITY_GOOD,
00019 FL_QUALITY_BEST
00020 } Fl_ImageQuality;
00021
00031 typedef struct FL_API Fl_Image_IO_Struct
00032 {
00033
00034
00038 char *name;
00039
00044 char *extensions;
00045
00046
00047
00054 bool (*is_valid_file)(const char *filename);
00055
00063 bool (*is_valid_mem)(const uint8 *data, uint32 size);
00064
00065
00066
00078 bool (*read_file)(const char *filename, int quality, uint8 *&data, Fl_PixelFormat &data_format, int &w, int &h);
00079
00092 bool (*read_mem)(const uint8 *stream, uint32 size, int quality, uint8 *&data, Fl_PixelFormat &data_format, int &w, int &h);
00093
00094
00095
00108 bool (*write_mem)(uint8 *&stream, int &size, int quality, const uint8 *data, const Fl_PixelFormat &data_format, int w, int h);
00109
00121 bool (*write_file)(const char *filename, int quality, const uint8 *data, const Fl_PixelFormat &data_format, int w, int h);
00122
00123 } Fl_Image_IO;
00124
00125
00126 extern FL_API void fl_register_imageio(Fl_Image_IO *reader);
00127 extern FL_API void fl_unregister_imageio(Fl_Image_IO *reader);
00128
00129 extern FL_API Fl_Image_IO *fl_find_imageio(Fl_Image_IO *reader);
00130 extern FL_API Fl_Image_IO *fl_find_imageio(const char *name, const char *extension);
00131
00132 extern FL_API unsigned fl_count_imageio();
00133 extern FL_API Fl_Image_IO * fl_get_imageio(unsigned index);
00134
00135 #endif
00136