Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * Contributor(s): Blender Foundation 2010. 00019 * 00020 * ***** END GPL LICENSE BLOCK ***** 00021 */ 00022 00028 #ifndef IMB_FILETYPE_H 00029 #define IMB_FILETYPE_H 00030 00031 /* Generic File Type */ 00032 00033 struct ImBuf; 00034 00035 #define IM_FTYPE_FLOAT 1 00036 00037 typedef struct ImFileType { 00038 void (*init)(void); 00039 void (*exit)(void); 00040 00041 int (*is_a)(unsigned char *buf); 00042 int (*ftype)(struct ImFileType *type, struct ImBuf *ibuf); 00043 struct ImBuf *(*load)(unsigned char *mem, size_t size, int flags); 00044 int (*save)(struct ImBuf *ibuf, const char *name, int flags); 00045 void (*load_tile)(struct ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int ty, unsigned int *rect); 00046 00047 int flag; 00048 int filetype; 00049 } ImFileType; 00050 00051 extern ImFileType IMB_FILE_TYPES[]; 00052 00053 void imb_filetypes_init(void); 00054 void imb_filetypes_exit(void); 00055 00056 void imb_tile_cache_init(void); 00057 void imb_tile_cache_exit(void); 00058 00059 void imb_loadtile(struct ImBuf *ibuf, int tx, int ty, unsigned int *rect); 00060 void imb_tile_cache_tile_free(struct ImBuf *ibuf, int tx, int ty); 00061 00062 /* Type Specific Functions */ 00063 00064 /* png */ 00065 int imb_is_a_png(unsigned char *buf); 00066 struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags); 00067 int imb_savepng(struct ImBuf *ibuf, const char *name, int flags); 00068 00069 /* targa */ 00070 int imb_is_a_targa(unsigned char *buf); 00071 struct ImBuf *imb_loadtarga(unsigned char *mem, size_t size, int flags); 00072 int imb_savetarga(struct ImBuf * ibuf, const char *name, int flags); 00073 00074 /* iris */ 00075 int imb_is_a_iris(unsigned char *mem); 00076 struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags); 00077 int imb_saveiris(struct ImBuf * ibuf, const char *name, int flags); 00078 00079 /* jp2 */ 00080 int imb_is_a_jp2(unsigned char *buf); 00081 struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags); 00082 int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags); 00083 00084 /* jpeg */ 00085 int imb_is_a_jpeg(unsigned char *mem); 00086 int imb_savejpeg(struct ImBuf *ibuf, const char *name, int flags); 00087 struct ImBuf * imb_load_jpeg (unsigned char * buffer, size_t size, int flags); 00088 00089 /* bmp */ 00090 int imb_is_a_bmp(unsigned char *buf); 00091 struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags); 00092 int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags); 00093 00094 /* cocoa */ 00095 struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, size_t size, int flags); 00096 short imb_cocoaSaveImage(struct ImBuf *ibuf, const char *name, int flags); 00097 00098 /* cineon */ 00099 int imb_savecineon(struct ImBuf *buf, const char *name, int flags); 00100 struct ImBuf *imb_loadcineon(unsigned char *mem, size_t size, int flags); 00101 int imb_is_cineon(unsigned char *buf); 00102 00103 /* dpx */ 00104 int imb_save_dpx(struct ImBuf *buf, const char *name, int flags); 00105 struct ImBuf *imb_loaddpx(unsigned char *mem, size_t size, int flags); 00106 int imb_is_dpx(unsigned char *buf); 00107 00108 /* hdr */ 00109 int imb_is_a_hdr(unsigned char *buf); 00110 struct ImBuf *imb_loadhdr(unsigned char *mem, size_t size, int flags); 00111 int imb_savehdr(struct ImBuf * ibuf, const char *name, int flags); 00112 00113 /* tiff */ 00114 void imb_inittiff(void); 00115 int imb_is_a_tiff(unsigned char *buf); 00116 struct ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags); 00117 void imb_loadtiletiff(struct ImBuf *ibuf, unsigned char *mem, size_t size, 00118 int tx, int ty, unsigned int *rect); 00119 int imb_savetiff(struct ImBuf *ibuf, const char *name, int flags); 00120 void *libtiff_findsymbol(char *name); 00121 00122 #endif /* IMB_FILETYPE_H */ 00123