Nori
|
00001 /* 00002 This file is part of Nori, a simple educational ray tracer 00003 00004 Copyright (c) 2012 by Wenzel Jakob and Steve Marschner. 00005 00006 Nori is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License Version 3 00008 as published by the Free Software Foundation. 00009 00010 Nori is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #if !defined(__BITMAP_H) 00020 #define __BITMAP_H 00021 00022 #include <nori/color.h> 00023 #include <nori/vector.h> 00024 00025 NORI_NAMESPACE_BEGIN 00026 00027 /** 00028 * \brief Stores a RGB high dynamic-range bitmap 00029 * 00030 * The bitmap class provides I/O support using the OpenEXR file format 00031 */ 00032 class Bitmap : public Eigen::Array<Color3f, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> { 00033 public: 00034 typedef Eigen::Array<Color3f, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> Base; 00035 00036 /** 00037 * \brief Allocate a new bitmap of the specified size 00038 * 00039 * The contents will initially be undefined, so make sure 00040 * to call \ref clear() if necessary 00041 */ 00042 Bitmap(const Vector2i &size) : Base(size.y(), size.x()) { } 00043 00044 /// Load an OpenEXR file with the specified filename 00045 Bitmap(const QString &filename); 00046 00047 /// Save the bitmap as an EXR file with the specified filename 00048 void save(const QString &filename); 00049 }; 00050 00051 NORI_NAMESPACE_END 00052 00053 #endif /* __BITMAP_H */