/usr/include/osgEarthSymbology/Skins is in libosgearth-dev 2.9.0+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | /* -*-c++-*- */
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph
* Copyright 2016 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 OSGEARTHSYMBOLOGY_SKIN_RESOURCE_H
#define OSGEARTHSYMBOLOGY_SKIN_RESOURCE_H 1
#include <osgEarthSymbology/Common>
#include <osgEarthSymbology/Resource>
#include <osgEarthSymbology/Symbol>
#include <osgEarth/URI>
#include <osg/TexEnv>
#include <osg/Image>
namespace osgEarth { namespace Symbology
{
using namespace osgEarth;
/**
* A resource that points to a "skin", which is a Texture image paired with
* a collection of metadata that describes its suitability for use in a scene.
*/
class OSGEARTHSYMBOLOGY_EXPORT SkinResource : public Resource
{
public:
/** Constructs a new skin resource. */
SkinResource( const Config& conf =Config() );
/** dtor */
virtual ~SkinResource() { }
/**
* Creates a new StateSet containing a Texture based on this Skin.
*/
osg::StateSet* createStateSet( const osgDB::Options* dbOptions ) const;
/**
* Creates an image for this SkinResource.
*/
osg::ref_ptr<osg::Image> createImage( const osgDB::Options* options ) const;
osg::Texture* createTexture(const osgDB::Options* readOptions) const;
osg::Texture* createTexture(osg::Image* image) const;
/**
* A key string that can uniquely identify this object for the purposes
* of creating its state set (e.g., for a cache)
*/
std::string getUniqueID() const;
public:
/** inline image (not serializable) */
osg::ref_ptr<osg::Image>& image() { return _image; }
const osg::ref_ptr<osg::Image>& image() const { return _image; }
/** Source location of the actual texture image. */
optional<URI>& imageURI() { return _imageURI; }
const optional<URI>& imageURI() const { return _imageURI; }
/** Real-world width of the image, in meters */
optional<float>& imageWidth() { return _imageWidth; }
const optional<float>& imageWidth() const { return _imageWidth; }
/** Real-world height of the image, in meters */
optional<float>& imageHeight() { return _imageHeight; }
const optional<float>& imageHeight() const { return _imageHeight; }
/** Minimum acceptable real-world object height (meters) for which this image would make an appropriate texture */
optional<float>& minObjectHeight() { return _minObjHeight; }
const optional<float>& minObjectHeight() const { return _minObjHeight; }
/** Maximum acceptable real-world object height (meters) for which this image would make an appropriate texture */
optional<float>& maxObjectHeight() { return _maxObjHeight; }
const optional<float>& maxObjectHeight() const { return _maxObjHeight; }
/** Whether this image is suitable for use as a vertically repeating texture */
optional<bool>& isTiled() { return _isTiled; }
const optional<bool>& isTiled() const { return _isTiled; }
/** Image offset within a source atlas (S dimension [0..1]) */
optional<float>& imageBiasS() { return _imageBiasS; }
const optional<float>& imageBiasS() const { return _imageBiasS; }
/** Image offset (pixels) within a source atlas (T dimension [0..1]) */
optional<float>& imageBiasT() { return _imageBiasT; }
const optional<float>& imageBiasT() const { return _imageBiasT; }
/** Image layer index within a source atlas (R dimension) */
optional<unsigned>& imageLayer() { return _imageLayer; }
const optional<unsigned>& imageLayer() const { return _imageLayer; }
/** Image scalke factor within a source atlas (S dimension) */
optional<float>& imageScaleS() { return _imageScaleS; }
const optional<float>& imageScaleS() const { return _imageScaleS; }
/** Image scalke factor within a source atlas (T dimension) */
optional<float>& imageScaleT() { return _imageScaleT; }
const optional<float>& imageScaleT() const { return _imageScaleT; }
/** GL texture application mode */
optional<osg::TexEnv::Mode>& texEnvMode() { return _texEnvMode; }
const optional<osg::TexEnv::Mode>& texEnvMode() const { return _texEnvMode; }
/** The maximum allowable size of a texture (in either dimension) that uses this image. */
optional<unsigned> maxTextureSpan() { return _maxTexSpan; }
const optional<unsigned> maxTextureSpan() const { return _maxTexSpan; }
/** Whether this image is suitable for texture atlasing */
optional<bool>& atlasHint() { return _atlasHint; }
const optional<bool>& atlasHint() const { return _atlasHint; }
/** Options string to pass in when reading the image */
optional<std::string>& readOptions() { return _readOptions; }
const optional<std::string>& readOptions() const { return _readOptions; }
public: // serialization methods
virtual Config getConfig() const;
void mergeConfig( const Config& conf );
protected:
osg::StateSet* createStateSet( osg::Image* image ) const;
protected:
optional<std::string> _name;
optional<URI> _imageURI;
optional<float> _imageWidth;
optional<float> _imageHeight;
optional<float> _minObjHeight;
optional<float> _maxObjHeight;
optional<bool> _isTiled;
optional<osg::TexEnv::Mode> _texEnvMode;
optional<unsigned> _maxTexSpan;
optional<float> _imageBiasS;
optional<float> _imageBiasT;
optional<unsigned> _imageLayer;
optional<float> _imageScaleS;
optional<float> _imageScaleT;
optional<bool> _atlasHint;
optional<std::string> _readOptions;
osg::ref_ptr<osg::Image> _image;
};
/**
* Query object that you can use to search for applicable Skin resources from the
* ResourceLibrary.
*/
class OSGEARTHSYMBOLOGY_EXPORT SkinSymbol : public Taggable<Symbol>
{
public:
META_Object(osgEarthSymbology, SkinSymbol);
SkinSymbol(const SkinSymbol& rhs,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
SkinSymbol( const Config& conf =Config() );
/** dtor */
virtual ~SkinSymbol() { }
public: // query parameters
/** Name of the resource library to use with this symbol. */
optional<std::string>& library() { return _library; }
const optional<std::string>& library() const { return _library; }
/** Object height in meters (must fall in the skin's min/max object height range to be accepted) */
optional<float>& objectHeight() { return _objHeight; }
const optional<float>& objectHeight() const { return _objHeight; }
/** Minimum acceptable real-world object height for which this image would make an appropriate texture */
optional<float>& minObjectHeight() { return _minObjHeight; }
const optional<float>& minObjectHeight() const { return _minObjHeight; }
/** Maximum acceptable real-world object height for which this image would make an appropriate texture */
optional<float>& maxObjectHeight() { return _maxObjHeight; }
const optional<float>& maxObjectHeight() const { return _maxObjHeight; }
/** Whether this image is suitable for use as a vertically repeating texture */
optional<bool>& isTiled() { return _isTiled; }
const optional<bool>& isTiled() const { return _isTiled; }
/** Random number seed value (for picking a candidate) */
optional<unsigned>& randomSeed() { return _randomSeed; }
const optional<unsigned>& randomSeed() const { return _randomSeed; }
/** Name of a specific skin in the catalog */
optional<StringExpression>& name() { return _name; }
const optional<StringExpression>& name() const { return _name; }
public:
void mergeConfig(const Config& conf);
Config getConfig() const;
static void parseSLD(const Config& c, class Style& style);
protected:
optional<std::string> _library;
optional<float> _objHeight;
optional<float> _minObjHeight;
optional<float> _maxObjHeight;
optional<bool> _isTiled;
optional<unsigned> _randomSeed;
optional<StringExpression> _name;
};
typedef std::vector< osg::ref_ptr<SkinResource> > SkinResourceVector;
} } // namespace osgEarth::Symbology
#endif // OSGEARTHSYMBOLOGY_SKIN_RESOURCE_H
|