pywrap: Add make dependency for common.i.
[gfxprim.git] / include / loaders / GP_Loaders.h
blobc7aab954ea8edd03989c709596b233fbe006a3b0
1 /*****************************************************************************
2 * This file is part of gfxprim library. *
3 * *
4 * Gfxprim is free software; you can redistribute it and/or *
5 * modify it under the terms of the GNU Lesser General Public *
6 * License as published by the Free Software Foundation; either *
7 * version 2.1 of the License, or (at your option) any later version. *
8 * *
9 * Gfxprim is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12 * Lesser General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU Lesser General Public *
15 * License along with gfxprim; if not, write to the Free Software *
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
17 * Boston, MA 02110-1301 USA *
18 * *
19 * Copyright (C) 2009-2010 Jiri "BlueBear" Dluhos *
20 * <jiri.bluebear.dluhos@gmail.com> *
21 * *
22 * Copyright (C) 2009-2012 Cyril Hrubis <metan@ucw.cz> *
23 * *
24 *****************************************************************************/
28 Core include file for loaders API.
32 #ifndef LOADERS_GP_LOADERS_H
33 #define LOADERS_GP_LOADERS_H
35 #include "core/GP_Context.h"
36 #include "core/GP_ProgressCallback.h"
38 #include "GP_PBM.h"
39 #include "GP_PGM.h"
40 #include "GP_PPM.h"
42 #include "GP_BMP.h"
43 #include "GP_PNG.h"
44 #include "GP_JPG.h"
45 #include "GP_GIF.h"
47 #include "GP_MetaData.h"
50 * Tries to load image accordingly to the file extension.
52 * If operation fails NULL is returned and errno is filled.
54 GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback);
57 * Loads image Meta Data (if possible).
59 int GP_LoadMetaData(const char *src_path, GP_MetaData *data);
62 * Simple saving function, the image format is matched by file extension.
64 * Retruns zero on succes.
66 * On failure non-zero is returned.
68 * When file type wasn't recognized by extension or if support for requested
69 * image format wasn't compiled in non-zero is returned and errno is set to
70 * ENOSYS.
72 * The resulting errno may also be set to any possible error from fopen(3), open(3),
73 * write(3), fwrite(3), seek(3), etc..
75 int GP_SaveImage(const GP_Context *src, const char *dst_path,
76 GP_ProgressCallback *callback);
78 #endif /* LOADERS_GP_LOADERS_H */