| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /********************************************************************** 00002 VRS - The Virtual Rendering System 00003 Copyright (C) 2001 Computer Graphics Systems Group at the 00004 Hasso-Plattner-Institute, Potsdam, Germany. 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 This library is distributed in the hope that it will be useful, but 00010 WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00012 See the GNU Lesser General Public License for more details. 00013 You should have received a copy of the GNU Lesser+ General Public 00014 License along with this library; if not, write to the FreeSoftware 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA, 02111-1307, USA. 00016 **********************************************************************/ 00017 00018 // $Id: normalizationcubemaptexturegl.h 6014 2007-08-09 07:51:16Z Konstantin_Baumann $ 00019 // $Date: 2007-08-09 09:51:16 +0200 (Thu, 09 Aug 2007) $ 00020 // $Revision: 6014 $ 00021 // $State$ 00022 // $Author: Konstantin_Baumann $ 00023 // 00024 // $Log$ 00025 // Revision 1.14 2005/10/13 09:52:35 baumann 00026 // mipmap handling improved 00027 // 00028 // Revision 1.13 2005/01/03 01:43:09 klimetschek 00029 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00030 // - removed vrs.vcproj 00031 // minor things: 00032 // - added all glutexamples to vrs4glut.sln 00033 // - fixed some problems in glutexamples 00034 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00035 // 00036 // Revision 1.12 2004/11/03 14:45:06 saar 00037 // Class comment changed (Doxygen style) 00038 // 00039 // Revision 1.11 2004/03/12 16:28:40 baumann 00040 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00041 // 00042 // Revision 1.10 2004/01/19 11:43:58 baumann 00043 // serialization mechanism improved 00044 // 00045 // Revision 1.9 2003/11/07 14:19:25 kirsch 00046 // removed leading underscore from include guards 00047 // 00048 // Revision 1.8 2003/07/23 17:04:49 baumann 00049 // code cleanup (especially untabified) 00050 // 00051 // Revision 1.7 2002/12/11 16:07:05 kirsch 00052 // use Matrix() instead of Matrix::identity in default constructor 00053 // 00054 // Revision 1.6 2002/11/13 07:20:50 baumann 00055 // changed TextureGL enum values to uppercase 00056 // added TextureGL::definesComponent() 00057 // 00058 // Revision 1.5 2002/11/11 20:12:25 nienhaus 00059 // added static method to share normalization cube maps of equal size 00060 // 00061 // Revision 1.4 2002/10/29 10:32:52 baumann 00062 // macros VRS_CLASSNAME_* and VRS_IMPL_TYPEINFO_* removed 00063 // 00064 // Revision 1.3 2002/08/06 10:32:38 baumann 00065 // added explicit casts for double to float or int conversions 00066 // 00067 // Revision 1.2 2002/04/07 17:14:11 baumann 00068 // Matrix::identity() changed to Matrix::identity 00069 // 00070 // Revision 1.1 2002/03/04 12:00:20 kersting 00071 // directory structure changes 00072 // 00073 // Revision 1.4 2002/03/03 21:44:26 kosta 00074 // VRS_TYPEINFO-macro rewritten 00075 // 00076 // Revision 1.3 2002/02/19 11:05:02 kosta 00077 // VRS_CLASSNAME() and VRS_IMPL_TYPEINFO() added 00078 // 00079 // Revision 1.2 2002/02/19 10:43:59 kosta 00080 // re-added new classes since 2002-02-15 00081 // 00082 // Revision 1.1 2002/02/19 07:06:32 kosta 00083 // renamed class NormalizationCubeMapGL to NormalizationCubeMapTextureGL 00084 // 00085 // Revision 1.2 2002/02/18 17:14:08 kosta 00086 // VRS_TYPEINFO(NormalizationCubeMapTextureGL, ImageCubeMapTextureGL); macros rewritten 00087 // no need for VRS_CLASSNAME for classes derived from SharedObj 00088 // 00089 // Revision 1.1 2002/02/18 15:27:47 nienhaus 00090 // add normalization cube map 00091 // 00092 // 00093 00094 #ifndef VRS_OPENGL_NORMALIZATIONCUBEMAPTEXTUREGL_H 00095 #define VRS_OPENGL_NORMALIZATIONCUBEMAPTEXTUREGL_H 00096 00097 #include <vrs/opengl/imagecubemaptexturegl.h> 00098 00099 namespace VRS { 00100 00102 class VRS_CORE_API NormalizationCubeMapTextureGL : public ImageCubeMapTextureGL { 00103 public: 00104 NormalizationCubeMapTextureGL(unsigned int size = 256, double alpha = 1.0, 00105 int dataType = Image::U8, 00106 TextureGL::FilterMode minFilter = TextureGL::TRILINEAR, 00107 TextureGL::FilterMode magFilter = TextureGL::LINEAR, 00108 GLfloat anisotropic = 1.0, 00109 const Matrix& matrix = Matrix()); 00111 00112 void setSize(unsigned int size); 00113 unsigned int getSize() const; 00115 00116 void setAlpha(double alpha); 00117 double getAlpha() const; 00119 00120 static SO<NormalizationCubeMapTextureGL> normalizationCubeMap(unsigned int size, bool reserve = true); 00125 VRS_TYPEINFO(NormalizationCubeMapTextureGL, ImageCubeMapTextureGL); 00126 VRS_SERIALIZABLE(NormalizationCubeMapTextureGL); 00127 00128 private: 00129 virtual void setImage(CubeMapTextureGL::Side, Image* image); 00130 virtual void setImages(Iterator<SO<Image> >* images, GLenum internalFormat = GL_ZERO); 00131 00132 void encodeNormalizedVector(int i, int size, int x, int y, double* v) const; 00133 Iterator<SO<Image> >* createNormalizationCubeMap(int size, double alphaValue, int datatype) const; 00134 }; 00135 00136 } // namespace VRS 00137 00138 #endif // VRS_OPENGL_NORMALIZATIONCUBEMAPTEXTUREGL_H