exrinput.h

Go to the documentation of this file.
00001 /**
00002  * Copyright (C) 2003 Billy Biggs <vektor@dumbterm.net>.
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining
00005  * a copy of this software and associated documentation files (the
00006  * "Software"), to deal in the Software without restriction, including
00007  * without limitation the rights to use, copy, modify, merge, publish,
00008  * distribute, sublicense, and/or sell copies of the Software, and to
00009  * permit persons to whom the Software is furnished to do so, subject to
00010  * the following conditions:
00011  *
00012  * The above copyright notice and this permission notice shall be
00013  * included in all copies or substantial portions of the Software.
00014  *
00015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00016  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00017  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00018  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00019  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00020  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00021  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00022  * SOFTWARE.
00023  */
00024 
00025 #ifdef HAVE_OPENEXR
00026 
00027 #ifndef EXRINPUT_H_INCLUDED
00028 #define EXRINPUT_H_INCLUDED
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00034 /**
00035  * Example usage:
00036  *
00037  * exrinput_t *exrin = exrinput_new( "myimage.exr" );
00038  *
00039  * for( i = 0; i < exrinput_get_height( exrin ); i++ ) {
00040  *     double *scanline = exrinput_get_scanline( exrin, i );
00041  *
00042  *     for( x = 0; x < exrinput_get_width( exrin ); x++ ) {
00043  *         r = scanline[ (x * 4) + 0 ];
00044  *         g = scanline[ (x * 4) + 1 ];
00045  *         b = scanline[ (x * 4) + 2 ];
00046  *         a = scanline[ (x * 4) + 3 ];
00047  *     }
00048  * }
00049  *
00050  * exrinput_delete( exrin );
00051  */
00052 
00053 typedef struct exrinput_s exrinput_t;
00054 
00055 /**
00056  * Opens the filename as an exr file.  Returns 0 on error.
00057  */
00058 exrinput_t *exrinput_new( const char *filename );
00059 
00060 /**
00061  * Closes the exr file.
00062  */
00063 void exrinput_delete( exrinput_t *exrinput );
00064 
00065 /**
00066  * Returns the width of the exr file.
00067  */
00068 unsigned int exrinput_get_width( exrinput_t *exrinput );
00069 
00070 /**
00071  * Returns the height of the exr file.
00072  */
00073 unsigned int exrinput_get_height( exrinput_t *exrinput );
00074 
00075 /**
00076  * Returns a pointer to the given scanline data from 0 to height-1.
00077  */
00078 double *exrinput_get_scanline( exrinput_t *exrinput, int num );
00079 
00080 #ifdef __cplusplus
00081 };
00082 #endif
00083 
00084 #endif /* EXRINPUT_H_INCLUDED */
00085 
00086 #endif /* HAVE_OPENEXR */
00087 

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6