~ubuntu-branches/debian/sid/osgearth/sid

« back to all changes in this revision

Viewing changes to src/osgEarth/ImageMosaic

  • Committer: Bazaar Package Importer
  • Author(s): Pirmin Kalberer
  • Date: 2011-07-14 22:13:36 UTC
  • Revision ID: james.westby@ubuntu.com-20110714221336-94igk9rskxveh794
Tags: upstream-2.0+dfsg
ImportĀ upstreamĀ versionĀ 2.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*-c++-*- */
 
2
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
 
3
 * Copyright 2008-2010 Pelican Mapping
 
4
 * http://osgearth.org
 
5
 *
 
6
 * osgEarth is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU Lesser General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU Lesser General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU Lesser General Public License
 
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 
18
 */
 
19
#ifndef OSGEARTH_COMPOSITING_H
 
20
#define OSGEARTH_COMPOSITING_H 1
 
21
 
 
22
#include <osg/Referenced>
 
23
#include <osg/Image>
 
24
#include <osg/MixinVector>
 
25
#include <osgEarth/Common>
 
26
#include <osgEarth/GeoData>
 
27
#include <osgEarth/TileKey>
 
28
#include <osgEarth/TileSource>
 
29
 
 
30
#include <vector>
 
31
 
 
32
namespace osgEarth
 
33
{
 
34
    /**
 
35
     * Pairs an OSG image with TileKey parameters.
 
36
     */
 
37
    struct TileImage
 
38
    {
 
39
        /**
 
40
        *Constructor
 
41
        */
 
42
        TileImage(osg::Image* image, const TileKey& key);
 
43
 
 
44
        /**
 
45
        *Gets a reference to the Image held by this GeoImage
 
46
        */
 
47
        osg::Image* getImage() {return _image.get();}
 
48
 
 
49
        osg::ref_ptr<osg::Image> _image;       
 
50
        double _minX, _minY, _maxX, _maxY;
 
51
        unsigned int _tileX;
 
52
        unsigned int _tileY;
 
53
    };
 
54
 
 
55
    /**
 
56
     * Utility class for extracting a single image from a collection of image tiles
 
57
     */
 
58
    class ImageMosaic : public osg::Referenced
 
59
    {
 
60
    public:
 
61
        ImageMosaic();
 
62
 
 
63
        osg::Image* createImage();
 
64
 
 
65
        /** A list of GeoImages */
 
66
        typedef std::vector<TileImage> TileImageList;
 
67
 
 
68
        /** Gets the images for this ImageMosaic */
 
69
        TileImageList& getImages() {return _images;}
 
70
 
 
71
        void getExtents(double &minX, double &minY, double &maxX, double &maxY);
 
72
 
 
73
    protected:
 
74
 
 
75
        ~ImageMosaic();
 
76
        TileImageList _images;
 
77
    };
 
78
}
 
79
 
 
80
#endif // OSGEARTH_COMPOSITING_H