X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=eradicate;a=blobdiff_plain;f=libs%2Fimago%2Fsrc%2Fftmodule.h;fp=libs%2Fimago%2Fsrc%2Fftmodule.h;h=7c3bd54206f9c30adf5c544a3106b7c80b3157ed;hp=0000000000000000000000000000000000000000;hb=1ee7845621c04020321fa8dfb6dcbf3d8c6c9b51;hpb=02e7611eefd46380cbce65ace9da8399c27e78e8 diff --git a/libs/imago/src/ftmodule.h b/libs/imago/src/ftmodule.h new file mode 100644 index 0000000..7c3bd54 --- /dev/null +++ b/libs/imago/src/ftmodule.h @@ -0,0 +1,39 @@ +/* +libimago - a multi-format image file input/output library. +Copyright (C) 2010 John Tsiombikas + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published +by the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this program. If not, see . +*/ + +#ifndef FTYPE_MODULE_H_ +#define FTYPE_MODULE_H_ + +#include "imago2.h" + +struct ftype_module { + char *suffix; /* used for format autodetection during saving only */ + + int (*check)(struct img_io *io); + int (*read)(struct img_pixmap *img, struct img_io *io); + int (*write)(struct img_pixmap *img, struct img_io *io); +}; + +int img_register_module(struct ftype_module *mod); + +struct ftype_module *img_find_format_module(struct img_io *io); +struct ftype_module *img_guess_format(const char *fname); +struct ftype_module *img_get_module(int idx); + + +#endif /* FTYPE_MODULE_H_ */