1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
14#ifndef OSGDB_IMAGEOPTIONS
15#define OSGDB_IMAGEOPTIONS 1
17#include <osgDB/Options>
21class OSGDB_EXPORT ImageOptions : public osgDB::Options
27 ImageOptions(const std::string& str);
29 ImageOptions(const ImageOptions& options,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
30 osgDB::Options(options,copyop),
31 _sourceImageSamplingMode(options._sourceImageSamplingMode),
32 _sourceImageWindowMode(options._sourceImageWindowMode),
33 _sourceRatioWindow(options._sourceRatioWindow),
34 _sourcePixelWindow(options._sourcePixelWindow),
35 _destinationImage(options._destinationImage),
36 _destinationImageWindowMode(options._destinationImageWindowMode),
37 _destinationRatioWindow(options._destinationRatioWindow),
38 _destinationPixelWindow(options._destinationPixelWindow),
39 _destinationDataType(options._destinationDataType),
40 _destinationPixelFormat(options._destinationPixelFormat) {}
43 META_Object(osgDB,ImageOptions);
45 /** RatioWindow stores the window (as ratios of 0.0 to 1.0) from the overall imagery from which to extract the osg::Image*/
54 void set(double x, double y, double w, double h)
68 /** PixelWindow stores the window (in exact pixels) from the overall imagery from which to extract the osg::Image*/
77 void set(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
87 unsigned int windowWidth;
88 unsigned int windowHeight;
98 enum ImageSamplingMode
105 /** Used as UserData attached to generated osg::Image's*/
106 struct TexCoordRange : public osg::Referenced
114 void set(double x,double y, double w, double h)
124 virtual ~TexCoordRange() {}
129 ImageSamplingMode _sourceImageSamplingMode;
130 ImageWindowMode _sourceImageWindowMode;
131 RatioWindow _sourceRatioWindow;
132 PixelWindow _sourcePixelWindow;
135 osg::ref_ptr<osg::Image> _destinationImage;
137 ImageWindowMode _destinationImageWindowMode;
138 RatioWindow _destinationRatioWindow;
139 PixelWindow _destinationPixelWindow;
141 GLenum _destinationDataType;
142 GLenum _destinationPixelFormat;
151#endif // OSGDB_IMAGEOPTIONS