/* -*-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
*/
#ifndef OSGEARTH_COMPOSITING_H
#define OSGEARTH_COMPOSITING_H 1
#include
#include
#include
#include
#include
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 _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 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