Blender  V2.59
openexr_multi.h
Go to the documentation of this file.
00001 /*
00002  * $Id: openexr_multi.h 35239 2011-02-27 20:23:21Z jesterking $ 
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version. 
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2006 Blender Foundation
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): Ton Roosendaal.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00035 #ifndef _OPENEXR_MULTI_H
00036 #define _OPENEXR_MULTI_H
00037 
00038 /* experiment with more advanced exr api */
00039 
00040 /* Note: as for now openexr only supports 32 chars in channel names.
00041    This api also supports max 8 channels per pass now. easy to fix! */
00042 #define EXR_LAY_MAXNAME         19
00043 #define EXR_PASS_MAXNAME        11
00044 #define EXR_TOT_MAXNAME         32
00045 #define EXR_PASS_MAXCHAN        8
00046 
00047 
00048 #ifdef WITH_OPENEXR
00049 void *  IMB_exr_get_handle                      (void);
00050 void    IMB_exr_add_channel                     (void *handle, const char *layname, const char *passname, int xstride, int ystride, float *rect);
00051 
00052 int             IMB_exr_begin_read                      (void *handle, const char *filename, int *width, int *height);
00053 void    IMB_exr_begin_write                     (void *handle, const char *filename, int width, int height, int compress);
00054 void    IMB_exrtile_begin_write         (void *handle, const char *filename, int mipmap, int width, int height, int tilex, int tiley);
00055 
00056 void    IMB_exr_set_channel                     (void *handle, const char *layname, const char *passname, int xstride, int ystride, float *rect);
00057 
00058 void    IMB_exr_read_channels           (void *handle);
00059 void    IMB_exr_write_channels          (void *handle);
00060 void    IMB_exrtile_write_channels      (void *handle, int partx, int party, int level);
00061 void    IMB_exrtile_clear_channels      (void *handle);
00062 
00063 void    IMB_exr_multilayer_convert      (void *handle, void *base,  
00064                                                                          void * (*addlayer)(void *base, char *str), 
00065                                                                          void (*addpass)(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id));
00066 
00067 void    IMB_exr_close                           (void *handle);
00068 
00069 
00070 #else
00071 
00072 /* ugly... but we only use it on pipeline.c, render module, now */
00073 
00074 void *  IMB_exr_get_handle                      (void) {return NULL;}
00075 void    IMB_exr_add_channel                     (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) {  (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; }
00076 
00077 int             IMB_exr_begin_read                      (void *handle, const char *filename, int *width, int *height) { (void)handle; (void)filename; (void)width; (void)height; return 0;}
00078 void    IMB_exr_begin_write                     (void *handle, const char *filename, int width, int height, int compress) { (void)handle; (void)filename; (void)width; (void)height; (void)compress; }
00079 void    IMB_exrtile_begin_write         (void *handle, const char *filename, int mipmap, int width, int height, int tilex, int tiley) { (void)handle; (void)filename; (void)mipmap; (void)width; (void)height; (void)tilex; (void)tiley; }
00080 
00081 void    IMB_exr_set_channel                     (void *handle, char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; }
00082 
00083 void    IMB_exr_read_channels           (void *handle) { (void)handle; }
00084 void    IMB_exr_write_channels          (void *handle) { (void)handle; }
00085 void    IMB_exrtile_write_channels      (void *handle, int partx, int party, int level) { (void)handle; (void)partx; (void)party; (void)level; }
00086 void    IMB_exrtile_clear_channels      (void *handle) { (void)handle; }
00087 
00088 void    IMB_exr_multilayer_convert      (void *handle, void *base,  
00089                                                                          void * (*addlayer)(void *base, char *str), 
00090                                                                          void (*addpass)(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id))
00091                                                                         {
00092                                                                                 (void)handle; (void)base; (void)addlayer; (void)addpass;
00093                                                                         }
00094 
00095 void    IMB_exr_close                           (void *handle) { (void)handle; }
00096 
00097 #endif
00098 
00099 
00100 
00101 #endif /* __OPENEXR_MULTI_H */