Blender V2.61 - r43446

openexr_multi.h

Go to the documentation of this file.
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  * The Original Code is Copyright (C) 2006 Blender Foundation
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): Ton Roosendaal.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 
00033 #ifndef _OPENEXR_MULTI_H
00034 #define _OPENEXR_MULTI_H
00035 
00036 /* experiment with more advanced exr api */
00037 
00038 /* Note: as for now openexr only supports 32 chars in channel names.
00039    This api also supports max 8 channels per pass now. easy to fix! */
00040 #define EXR_LAY_MAXNAME     19
00041 #define EXR_PASS_MAXNAME    11
00042 #define EXR_TOT_MAXNAME     32
00043 #define EXR_PASS_MAXCHAN    8
00044 
00045 
00046 #ifdef WITH_OPENEXR
00047 void *  IMB_exr_get_handle          (void);
00048 void    IMB_exr_add_channel         (void *handle, const char *layname, const char *passname, int xstride, int ystride, float *rect);
00049 
00050 int     IMB_exr_begin_read          (void *handle, const char *filename, int *width, int *height);
00051 int     IMB_exr_begin_write         (void *handle, const char *filename, int width, int height, int compress);
00052 void    IMB_exrtile_begin_write     (void *handle, const char *filename, int mipmap, int width, int height, int tilex, int tiley);
00053 
00054 void    IMB_exr_set_channel         (void *handle, const char *layname, const char *passname, int xstride, int ystride, float *rect);
00055 
00056 void    IMB_exr_read_channels       (void *handle);
00057 void    IMB_exr_write_channels      (void *handle);
00058 void    IMB_exrtile_write_channels  (void *handle, int partx, int party, int level);
00059 void    IMB_exrtile_clear_channels  (void *handle);
00060 
00061 void    IMB_exr_multilayer_convert  (void *handle, void *base,  
00062                                      void * (*addlayer)(void *base, char *str), 
00063                                      void (*addpass)(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id));
00064 
00065 void    IMB_exr_close               (void *handle);
00066 
00067 
00068 #else
00069 
00070 /* ugly... but we only use it on pipeline.c, render module, now */
00071 
00072 void *  IMB_exr_get_handle          (void) {return NULL;}
00073 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; }
00074 
00075 int     IMB_exr_begin_read          (void *handle, const char *filename, int *width, int *height) { (void)handle; (void)filename; (void)width; (void)height; return 0;}
00076 int     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; return 0;}
00077 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; }
00078 
00079 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; }
00080 
00081 void    IMB_exr_read_channels       (void *handle) { (void)handle; }
00082 void    IMB_exr_write_channels      (void *handle) { (void)handle; }
00083 void    IMB_exrtile_write_channels  (void *handle, int partx, int party, int level) { (void)handle; (void)partx; (void)party; (void)level; }
00084 void    IMB_exrtile_clear_channels  (void *handle) { (void)handle; }
00085 
00086 void    IMB_exr_multilayer_convert  (void *handle, void *base,  
00087                                      void * (*addlayer)(void *base, char *str), 
00088                                      void (*addpass)(void *base, void *lay, char *str, float *rect, int totchan, char *chan_id))
00089                                     {
00090                                         (void)handle; (void)base; (void)addlayer; (void)addpass;
00091                                     }
00092 
00093 void    IMB_exr_close               (void *handle) { (void)handle; }
00094 
00095 #endif
00096 
00097 
00098 
00099 #endif /* __OPENEXR_MULTI_H */