9#ifndef GP_LOADERS_GEN_H
10#define GP_LOADERS_GEN_H
17#include <loaders/gp_loader.h>
22extern const gp_loader gp_bmp;
24int gp_match_bmp(
const void *buf);
26int gp_read_bmp_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
29static inline gp_pixmap *gp_load_bmp(
const char *src_path,
32 return gp_loader_load_image(&gp_bmp, src_path, callback);
37 return gp_loader_read_image(&gp_bmp, io, callback);
40int gp_write_bmp(
const gp_pixmap *src, gp_io *io,
43static inline int gp_save_bmp(
const gp_pixmap *src,
const char *dst_path,
46 return gp_loader_save_image(&gp_bmp, src, dst_path, callback);
51extern const gp_loader gp_jpg;
53int gp_match_jpg(
const void *buf);
55int gp_read_jpg_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
58static inline gp_pixmap *gp_load_jpg(
const char *src_path,
61 return gp_loader_load_image(&gp_jpg, src_path, callback);
66 return gp_loader_read_image(&gp_jpg, io, callback);
69int gp_write_jpg(
const gp_pixmap *src, gp_io *io,
72static inline int gp_save_jpg(
const gp_pixmap *src,
const char *dst_path,
75 return gp_loader_save_image(&gp_jpg, src, dst_path, callback);
80extern const gp_loader gp_png;
82int gp_match_png(
const void *buf);
84int gp_read_png_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
87static inline gp_pixmap *gp_load_png(
const char *src_path,
90 return gp_loader_load_image(&gp_png, src_path, callback);
95 return gp_loader_read_image(&gp_png, io, callback);
98int gp_write_png(
const gp_pixmap *src, gp_io *io,
101static inline int gp_save_png(
const gp_pixmap *src,
const char *dst_path,
104 return gp_loader_save_image(&gp_png, src, dst_path, callback);
109extern const gp_loader gp_tiff;
111int gp_match_tiff(
const void *buf);
113int gp_read_tiff_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
116static inline gp_pixmap *gp_load_tiff(
const char *src_path,
119 return gp_loader_load_image(&gp_tiff, src_path, callback);
124 return gp_loader_read_image(&gp_tiff, io, callback);
127int gp_write_tiff(
const gp_pixmap *src, gp_io *io,
130static inline int gp_save_tiff(
const gp_pixmap *src,
const char *dst_path,
133 return gp_loader_save_image(&gp_tiff, src, dst_path, callback);
138extern const gp_loader gp_pbm;
140int gp_match_pbm(
const void *buf);
142int gp_read_pbm_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
145static inline gp_pixmap *gp_load_pbm(
const char *src_path,
148 return gp_loader_load_image(&gp_pbm, src_path, callback);
153 return gp_loader_read_image(&gp_pbm, io, callback);
156int gp_write_pbm(
const gp_pixmap *src, gp_io *io,
159static inline int gp_save_pbm(
const gp_pixmap *src,
const char *dst_path,
162 return gp_loader_save_image(&gp_pbm, src, dst_path, callback);
167extern const gp_loader gp_pgm;
169int gp_match_pgm(
const void *buf);
171int gp_read_pgm_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
174static inline gp_pixmap *gp_load_pgm(
const char *src_path,
177 return gp_loader_load_image(&gp_pgm, src_path, callback);
182 return gp_loader_read_image(&gp_pgm, io, callback);
185int gp_write_pgm(
const gp_pixmap *src, gp_io *io,
188static inline int gp_save_pgm(
const gp_pixmap *src,
const char *dst_path,
191 return gp_loader_save_image(&gp_pgm, src, dst_path, callback);
196extern const gp_loader gp_ppm;
198int gp_match_ppm(
const void *buf);
200int gp_read_ppm_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
203static inline gp_pixmap *gp_load_ppm(
const char *src_path,
206 return gp_loader_load_image(&gp_ppm, src_path, callback);
211 return gp_loader_read_image(&gp_ppm, io, callback);
214int gp_write_ppm(
const gp_pixmap *src, gp_io *io,
217static inline int gp_save_ppm(
const gp_pixmap *src,
const char *dst_path,
220 return gp_loader_save_image(&gp_ppm, src, dst_path, callback);
225extern const gp_loader gp_pnm;
227int gp_match_pnm(
const void *buf);
229int gp_read_pnm_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
232static inline gp_pixmap *gp_load_pnm(
const char *src_path,
235 return gp_loader_load_image(&gp_pnm, src_path, callback);
240 return gp_loader_read_image(&gp_pnm, io, callback);
243int gp_write_pnm(
const gp_pixmap *src, gp_io *io,
246static inline int gp_save_pnm(
const gp_pixmap *src,
const char *dst_path,
249 return gp_loader_save_image(&gp_pnm, src, dst_path, callback);
254extern const gp_loader gp_ico;
256int gp_match_ico(
const void *buf);
258int gp_read_ico_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
261static inline gp_pixmap *gp_load_ico(
const char *src_path,
264 return gp_loader_load_image(&gp_ico, src_path, callback);
269 return gp_loader_read_image(&gp_ico, io, callback);
273extern const gp_loader gp_webp;
275int gp_match_webp(
const void *buf);
277int gp_read_webp_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
280static inline gp_pixmap *gp_load_webp(
const char *src_path,
283 return gp_loader_load_image(&gp_webp, src_path, callback);
288 return gp_loader_read_image(&gp_webp, io, callback);
292extern const gp_loader gp_jp2;
294int gp_match_jp2(
const void *buf);
296int gp_read_jp2_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
299static inline gp_pixmap *gp_load_jp2(
const char *src_path,
302 return gp_loader_load_image(&gp_jp2, src_path, callback);
307 return gp_loader_read_image(&gp_jp2, io, callback);
311extern const gp_loader gp_pcx;
313int gp_match_pcx(
const void *buf);
315int gp_read_pcx_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
318static inline gp_pixmap *gp_load_pcx(
const char *src_path,
321 return gp_loader_load_image(&gp_pcx, src_path, callback);
326 return gp_loader_read_image(&gp_pcx, io, callback);
330extern const gp_loader gp_gif;
332int gp_match_gif(
const void *buf);
334int gp_read_gif_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
337static inline gp_pixmap *gp_load_gif(
const char *src_path,
340 return gp_loader_load_image(&gp_gif, src_path, callback);
345 return gp_loader_read_image(&gp_gif, io, callback);
349extern const gp_loader gp_psp;
351int gp_match_psp(
const void *buf);
353int gp_read_psp_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
356static inline gp_pixmap *gp_load_psp(
const char *src_path,
359 return gp_loader_load_image(&gp_psp, src_path, callback);
364 return gp_loader_read_image(&gp_psp, io, callback);
368extern const gp_loader gp_psd;
370int gp_match_psd(
const void *buf);
372int gp_read_psd_ex(gp_io *io,
gp_pixmap **img, gp_storage *storage,
375static inline gp_pixmap *gp_load_psd(
const char *src_path,
378 return gp_loader_load_image(&gp_psd, src_path, callback);
383 return gp_loader_read_image(&gp_psd, io, callback);