wmaker: fix crash when switching workspace with "Affiche.app"
[wmaker-crm.git] / wrlib / imgformat.h
blob6bb0610ad8b0c3be25746ec787e1c7d65cfcf528
1 /*
2 * Raster graphics library
4 * Copyright (c) 1997-2003 Alfredo K. Kojima
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
23 * Functions to load and save RImage from/to file in a specific file format
25 * These functions are for WRaster library's internal use only, please use
26 * the RLoadImage function defined in 'wraster.h'
29 #ifndef IMGFORMAT_INTERNAL_H
30 #define IMGFORMAT_INTERNAL_H
33 typedef enum {
34 IM_ERROR = -1,
35 IM_UNKNOWN = 0,
36 IM_XPM = 1,
37 IM_TIFF = 2,
38 IM_PNG = 3,
39 IM_PPM = 4,
40 IM_JPEG = 5,
41 IM_GIF = 6,
42 IM_WEBP = 7
43 } WRImgFormat;
45 /* How many image types we have. */
46 /* Increase this when adding new image types! */
47 #define IM_TYPES 7
50 * Function for Loading in a specific format
52 RImage *RLoadPPM(const char *file);
54 RImage *RLoadXPM(RContext *context, const char *file);
56 #ifdef USE_TIFF
57 RImage *RLoadTIFF(const char *file, int index);
58 #endif
60 #ifdef USE_PNG
61 RImage *RLoadPNG(RContext *context, const char *file);
62 #endif
64 #ifdef USE_JPEG
65 RImage *RLoadJPEG(const char *file);
66 #endif
68 #ifdef USE_GIF
69 RImage *RLoadGIF(const char *file, int index);
70 #endif
72 #ifdef USE_WEBP
73 RImage *RLoadWEBP(const char *file);
74 #endif
76 #ifdef USE_MAGICK
77 RImage *RLoadMagick(const char *file_name);
79 void RReleaseMagick(void);
80 #endif
83 * Function for Saving in a specific format
85 Bool RSaveXPM(RImage *image, const char *file);
89 * Function to terminate properly
91 void RReleaseCache(void);
94 #endif