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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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_webp;
256int gp_match_webp(
const void *buf);
258int gp_read_webp_ex(
gp_io *io,
gp_pixmap **img, gp_storage *storage,
261static inline gp_pixmap *gp_load_webp(
const char *src_path,
264 return gp_loader_load_image(&gp_webp, src_path, callback);
269 return gp_loader_read_image(&gp_webp, io, callback);
275static inline int gp_save_webp(
const gp_pixmap *src,
const char *dst_path,
278 return gp_loader_save_image(&gp_webp, src, dst_path, callback);
283extern const gp_loader gp_ico;
285int gp_match_ico(
const void *buf);
287int gp_read_ico_ex(
gp_io *io,
gp_pixmap **img, gp_storage *storage,
290static inline gp_pixmap *gp_load_ico(
const char *src_path,
293 return gp_loader_load_image(&gp_ico, src_path, callback);
298 return gp_loader_read_image(&gp_ico, io, callback);
302extern const gp_loader gp_jp2;
304int gp_match_jp2(
const void *buf);
306int gp_read_jp2_ex(
gp_io *io,
gp_pixmap **img, gp_storage *storage,
309static inline gp_pixmap *gp_load_jp2(
const char *src_path,
312 return gp_loader_load_image(&gp_jp2, src_path, callback);
317 return gp_loader_read_image(&gp_jp2, io, callback);
321extern const gp_loader gp_pcx;
323int gp_match_pcx(
const void *buf);
325int gp_read_pcx_ex(
gp_io *io,
gp_pixmap **img, gp_storage *storage,
328static inline gp_pixmap *gp_load_pcx(
const char *src_path,
331 return gp_loader_load_image(&gp_pcx, src_path, callback);
336 return gp_loader_read_image(&gp_pcx, io, callback);
340extern const gp_loader gp_gif;
342int gp_match_gif(
const void *buf);
344int gp_read_gif_ex(
gp_io *io,
gp_pixmap **img, gp_storage *storage,
347static inline gp_pixmap *gp_load_gif(
const char *src_path,
350 return gp_loader_load_image(&gp_gif, src_path, callback);
355 return gp_loader_read_image(&gp_gif, io, callback);
359extern const gp_loader gp_psp;
361int gp_match_psp(
const void *buf);
363int gp_read_psp_ex(
gp_io *io,
gp_pixmap **img, gp_storage *storage,
366static inline gp_pixmap *gp_load_psp(
const char *src_path,
369 return gp_loader_load_image(&gp_psp, src_path, callback);
374 return gp_loader_read_image(&gp_psp, io, callback);
378extern const gp_loader gp_psd;
380int gp_match_psd(
const void *buf);
382int gp_read_psd_ex(
gp_io *io,
gp_pixmap **img, gp_storage *storage,
385static inline gp_pixmap *gp_load_psd(
const char *src_path,
388 return gp_loader_load_image(&gp_psd, src_path, callback);
393 return gp_loader_read_image(&gp_psd, io, callback);
397extern const gp_loader gp_heif;
399int gp_match_heif(
const void *buf);
401int gp_read_heif_ex(
gp_io *io,
gp_pixmap **img, gp_storage *storage,
404static inline gp_pixmap *gp_load_heif(
const char *src_path,
407 return gp_loader_load_image(&gp_heif, src_path, callback);
412 return gp_loader_read_image(&gp_heif, io, callback);