00001 /*************************************************************************** 00002 * Copyright (C) 1998-2009 by authors (see AUTHORS.txt ) * 00003 * * 00004 * This file is part of LuxRender. * 00005 * * 00006 * Lux Renderer is free software; you can redistribute it and/or modify * 00007 * it under the terms of the GNU General Public License as published by * 00008 * the Free Software Foundation; either version 3 of the License, or * 00009 * (at your option) any later version. * 00010 * * 00011 * Lux Renderer 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, see <http://www.gnu.org/licenses/>. * 00018 * * 00019 * This project is based on PBRT ; see http://www.pbrt.org * 00020 * Lux Renderer website : http://www.luxrender.net * 00021 ***************************************************************************/ 00022 00023 #ifndef LUX_IGIIO_H 00024 #define LUX_IGIIO_H 00025 // igiio.h* 00026 00027 #include "lux.h" 00028 00029 namespace lux 00030 { 00031 00032 // Based on code from GPL Violet Tonemapper. 00033 static const int INDIGO_IMAGE_MAGIC_NUMBER = 66613373; 00034 00035 class IndigoImageHeader 00036 { 00037 public: 00038 IndigoImageHeader() {}; 00039 ~IndigoImageHeader() {}; 00040 00041 //all integers and unsigned integers are 32 bit 00042 //Byte order should be little endian (Intel byte order) 00043 int magic_number;//should be 66613373 00044 int format_version;//1 00045 double num_samples;//total num samples taken over entire image 00046 unsigned int width;//width of supersampled (large) image 00047 unsigned int height;//height of supersampled (large) image 00048 unsigned int supersample_factor;// >= 1 00049 int zipped;//boolean 00050 00051 int image_data_size;//size of image data in bytes 00052 //should be equal to width*height*12, if data is uncompressed. 00053 00054 unsigned int colour_space;//0 = XYZ 00055 unsigned char padding[5000];//padding in case i want more stuff in the header in future 00056 00057 //image data follows: 00058 //top row, then next-to-top row, etc... 00059 //left to right across the row. 00060 //3 32 bit floats per pixel. 00061 }; 00062 00063 void WriteIgiImage(const string &name, 00064 vector<RGBColor> &pixels, vector<float> &alpha, int XRes, int YRes, 00065 int totalXRes, int totalYRes, int xOffset, int yOffset); 00066 00067 } 00068 00069 #endif // LUX_IGIIO_H 00070