DYT/Tool/OpenSceneGraph-3.6.5/include/osgEarth/ImageMosaic

80 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

2024-12-24 23:49:36 +00:00
/* -*-c++-*- */
/* osgEarth - Geospatial SDK for OpenSceneGraph
* Copyright 2020 Pelican Mapping
* http://osgearth.org
*
* osgEarth is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef OSGEARTH_COMPOSITING_H
#define OSGEARTH_COMPOSITING_H 1
#include <osgEarth/Common>
#include <osgEarth/TileKey>
#include <osg/Referenced>
#include <osg/Image>
#include <vector>
namespace osgEarth { namespace Util
{
/**
* Pairs an OSG image with TileKey parameters.
*/
struct OSGEARTH_EXPORT TileImage
{
/**
*Constructor
*/
TileImage(const osg::Image* image, const TileKey& key);
/** dtor */
virtual ~TileImage() { }
/**
*Gets a reference to the Image held by this GeoImage
*/
const osg::Image* getImage() {return _image.get();}
osg::ref_ptr<const osg::Image> _image;
double _minX, _minY, _maxX, _maxY;
unsigned int _tileX;
unsigned int _tileY;
};
/**
* Utility class for extracting a single image from a collection of image tiles
*/
class OSGEARTH_EXPORT ImageMosaic : public osg::Referenced
{
public:
ImageMosaic();
virtual ~ImageMosaic();
osg::Image* createImage();
/** A list of GeoImages */
typedef std::vector<TileImage> TileImageList;
/** Gets the images for this ImageMosaic */
TileImageList& getImages() {return _images;}
void getExtents(double &minX, double &minY, double &maxX, double &maxY);
protected:
TileImageList _images;
};
} }
#endif // OSGEARTH_COMPOSITING_H