| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2000-2004 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: textureatlascreator.h 6198 2008-01-14 18:48:38Z Manuel_Wellmann $ 00019 // 00020 // $Log$ 00021 // Revision 1.7 2006/05/26 17:12:55 buchholz 00022 // atlasIndices management added 00023 // 00024 // Revision 1.6 2006/02/07 10:35:52 baumann 00025 // - comments added 00026 // - new method createSubImagePlacement() added 00027 // 00028 // Revision 1.5 2006/02/03 11:22:04 baumann 00029 // method atlasSubImages() added 00030 // 00031 // Revision 1.4 2006/02/02 16:43:13 baumann 00032 // rewritten 00033 // 00034 // Revision 1.3 2005/04/22 17:45:04 baumann 00035 // missing includes added 00036 // 00037 // Revision 1.2 2005/01/03 01:43:09 klimetschek 00038 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00039 // - removed vrs.vcproj 00040 // minor things: 00041 // - added all glutexamples to vrs4glut.sln 00042 // - fixed some problems in glutexamples 00043 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00044 // 00045 // Revision 1.1 2004/09/02 09:49:09 baumann 00046 // new class TextureAtlasCreator added 00047 // 00048 00049 #ifndef VRS_IMAGE_TEXTUREATLASCREATOR_H 00050 #define VRS_IMAGE_TEXTUREATLASCREATOR_H 00051 00052 #include <vrs/area.h> 00053 #include <vrs/matrix.h> 00054 #include <vrs/sharedobj.h> 00055 #include <vector> 00056 00057 namespace VRS { 00058 00059 class Image; 00060 00062 class VRS_CORE_API TextureAtlasCreator : 00063 public VRS::SharedObj 00064 { 00065 public: 00069 TextureAtlasCreator( 00070 SO<Iterator<SO<Image> > > images, 00071 unsigned int maxAtlasSizeX = 1024, 00072 unsigned int maxAtlasSizeY = 1024 00073 ); 00074 00075 00083 static SO<Iterator<Area> > createSubImagePlacement( 00084 SO<Iterator<std::pair<unsigned int, unsigned int> > > imageSizes, 00085 unsigned int maxAtlasSizeX = 1024, 00086 unsigned int maxAtlasSizeY = 1024 00087 ); 00088 00089 00090 virtual unsigned int atlases() const; 00091 virtual SO<Image> atlasImage(unsigned int atlas) const; 00092 virtual double atlasUsage(unsigned int atlas) const; 00093 virtual unsigned int atlasSubImages(unsigned int atlas) const; 00094 00095 virtual bool containsImage(SO<Image> origImage) const; 00096 virtual unsigned int atlasIndex(SO<Image> origImage) const; 00097 virtual SO<Image> atlasImage(SO<Image> origImage) const; 00098 virtual SO<Image> atlasSubImage(SO<Image> origImage) const; 00099 virtual Area atlasArea(SO<Image> origImage) const; 00100 virtual Matrix texCoordTransform(SO<Image> origImage) const; 00101 virtual Matrix texCoordTransform(unsigned int atlas, unsigned int subImage) const; 00102 00108 virtual SO<Iterator<unsigned int> > getOriginalImageIndices(unsigned int atlas) const; 00109 00110 private: 00111 class Impl; 00112 SO<Impl> m_impl; 00113 std::vector<std::vector<unsigned int> > m_subImageIndices; 00114 }; //class TextureAtlasCreator 00115 00116 } // namespace VRS 00117 00118 #endif // VRS_IMAGE_TEXTUREATLASCREATOR_H