osgEarth 2.1.1
|
00001 /* -*-c++-*- */ 00002 /* osgEarth - Dynamic map generation toolkit for OpenSceneGraph 00003 * Copyright 2008-2010 Pelican Mapping 00004 * http://osgearth.org 00005 * 00006 * osgEarth is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program 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 Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public License 00017 * along with this program. If not, see <http://www.gnu.org/licenses/> 00018 */ 00019 #ifndef OSGEARTH_COMPOSITING_H 00020 #define OSGEARTH_COMPOSITING_H 1 00021 00022 #include <osg/Referenced> 00023 #include <osg/Image> 00024 #include <osg/MixinVector> 00025 #include <osgEarth/Common> 00026 #include <osgEarth/GeoData> 00027 #include <osgEarth/TileKey> 00028 #include <osgEarth/TileSource> 00029 00030 #include <vector> 00031 00032 namespace osgEarth 00033 { 00037 struct TileImage 00038 { 00042 TileImage(osg::Image* image, const TileKey& key); 00043 00047 osg::Image* getImage() {return _image.get();} 00048 00049 osg::ref_ptr<osg::Image> _image; 00050 double _minX, _minY, _maxX, _maxY; 00051 unsigned int _tileX; 00052 unsigned int _tileY; 00053 }; 00054 00058 class ImageMosaic : public osg::Referenced 00059 { 00060 public: 00061 ImageMosaic(); 00062 00063 osg::Image* createImage(); 00064 00066 typedef std::vector<TileImage> TileImageList; 00067 00069 TileImageList& getImages() {return _images;} 00070 00071 void getExtents(double &minX, double &minY, double &maxX, double &maxY); 00072 00073 protected: 00074 00075 ~ImageMosaic(); 00076 TileImageList _images; 00077 }; 00078 } 00079 00080 #endif // OSGEARTH_COMPOSITING_H