Blender V2.27

IMB_filetype.h

00001 
00025 #ifndef IMB_FILETYPE_H
00026 #define IMB_FILETYPE_H
00027 
00028 /* Generic File Type */
00029 
00030 struct ImBuf;
00031 
00032 #define IM_FTYPE_FLOAT  1
00033 
00034 typedef struct ImFileType {
00035         void (*init)(void);
00036         void (*exit)(void);
00037 
00038         int (*is_a)(unsigned char *buf);
00039         int (*ftype)(struct ImFileType *type, struct ImBuf *ibuf);
00040         struct ImBuf *(*load)(unsigned char *mem, size_t size, int flags);
00041         int (*save)(struct ImBuf *ibuf, const char *name, int flags);
00042         void (*load_tile)(struct ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int ty, unsigned int *rect);
00043 
00044         int flag;
00045         int filetype;
00046 } ImFileType;
00047 
00048 extern ImFileType IMB_FILE_TYPES[];
00049 
00050 void imb_filetypes_init(void);
00051 void imb_filetypes_exit(void);
00052 
00053 void imb_tile_cache_init(void);
00054 void imb_tile_cache_exit(void);
00055 
00056 void imb_loadtile(struct ImBuf *ibuf, int tx, int ty, unsigned int *rect);
00057 void imb_tile_cache_tile_free(struct ImBuf *ibuf, int tx, int ty);
00058 
00059 /* Type Specific Functions */
00060 
00061 /* png */
00062 int imb_is_a_png(unsigned char *buf);
00063 struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags);
00064 int imb_savepng(struct ImBuf *ibuf, const char *name, int flags);
00065 
00066 /* targa */
00067 int imb_is_a_targa(unsigned char *buf);
00068 struct ImBuf *imb_loadtarga(unsigned char *mem, size_t size, int flags);
00069 int imb_savetarga(struct ImBuf * ibuf, const char *name, int flags);
00070 
00071 /* iris */
00072 int imb_is_a_iris(unsigned char *mem);
00073 struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags);
00074 int imb_saveiris(struct ImBuf * ibuf, const char *name, int flags);
00075 
00076 /* jp2 */
00077 int imb_is_a_jp2(unsigned char *buf);
00078 struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags);
00079 int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags);
00080 
00081 /* jpeg */
00082 int imb_is_a_jpeg(unsigned char *mem);
00083 int imb_savejpeg(struct ImBuf *ibuf, const char *name, int flags);
00084 struct ImBuf * imb_ibJpegImageFromFilename (const char * filename, int flags);
00085 struct ImBuf * imb_load_jpeg (unsigned char * buffer, size_t size, int flags);
00086 
00087 /* bmp */
00088 int imb_is_a_bmp(unsigned char *buf);
00089 struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags);
00090 int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags);
00091 
00092 /* cocoa */
00093 struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, size_t size, int flags);
00094 short imb_cocoaSaveImage(struct ImBuf *ibuf, const char *name, int flags);
00095 
00096 /* cineon */
00097 int imb_savecineon(struct ImBuf *buf, const char *name, int flags);
00098 struct ImBuf *imb_loadcineon(unsigned char *mem, size_t size, int flags);
00099 int imb_is_cineon(unsigned char *buf);
00100 
00101 /* dpx */
00102 int imb_save_dpx(struct ImBuf *buf, const char *name, int flags);
00103 struct ImBuf *imb_loaddpx(unsigned char *mem, size_t size, int flags);
00104 int imb_is_dpx(unsigned char *buf);
00105 
00106 /* hdr */
00107 int imb_is_a_hdr(unsigned char *buf);
00108 struct ImBuf *imb_loadhdr(unsigned char *mem, size_t size, int flags);
00109 int imb_savehdr(struct ImBuf * ibuf, const char *name, int flags);
00110 
00111 /* tiff */
00112 void imb_inittiff(void);
00113 int imb_is_a_tiff(unsigned char *buf);
00114 struct ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags);
00115 void imb_loadtiletiff(struct ImBuf *ibuf, unsigned char *mem, size_t size,
00116         int tx, int ty, unsigned int *rect);
00117 int imb_savetiff(struct ImBuf *ibuf, const char *name, int flags);
00118 void *libtiff_findsymbol(char *name);
00119 
00120 #endif  /* IMB_FILETYPE_H */
00121