OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ImageOptions.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2  *
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.
7  *
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.
12 */
13 
14 #ifndef OSGDB_IMAGEOPTIONS
15 #define OSGDB_IMAGEOPTIONS 1
16 
17 #include <osgDB/Options>
18 
19 namespace osgDB {
20 
22 {
23  public:
24 
25  ImageOptions();
26 
27  ImageOptions(const std::string& str);
28 
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) {}
41 
42 
44 
46  struct RatioWindow
47  {
49  windowX(0.0),
50  windowY(0.0),
51  windowWidth(1.0),
52  windowHeight(1.0) {}
53 
54  void set(double x, double y, double w, double h)
55  {
56  windowX = x;
57  windowY = y;
58  windowWidth = w;
59  windowHeight = h;
60  }
61 
62  double windowX;
63  double windowY;
64  double windowWidth;
65  double windowHeight;
66  };
67 
69  struct PixelWindow
70  {
72  windowX(0),
73  windowY(0),
74  windowWidth(0),
75  windowHeight(0) {}
76 
77  void set(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
78  {
79  windowX = x;
80  windowY = y;
81  windowWidth = w;
82  windowHeight = h;
83  }
84 
85  unsigned int windowX;
86  unsigned int windowY;
87  unsigned int windowWidth;
88  unsigned int windowHeight;
89  };
90 
92  {
95  PIXEL_WINDOW
96  };
97 
99  {
102  CUBIC
103  };
104 
107  {
109  _x(0.0),
110  _y(0.0),
111  _w(1.0),
112  _h(1.0) {}
113 
114  void set(double x,double y, double w, double h)
115  {
116  _x = x;
117  _y = y;
118  _w = w;
119  _h = h;
120  }
121 
122  double _x,_y,_w,_h;
123  };
124 
125 
126  // source
131 
132  // destination
134 
138 
141 
142  void init();
143 
144 };
145 
146 
147 }
148 
149 #endif // OSGDB_IMAGEOPTIONS
void set(double x, double y, double w, double h)
Definition: ImageOptions.h:54
void set(double x, double y, double w, double h)
Definition: ImageOptions.h:114
PixelWindow _sourcePixelWindow
Definition: ImageOptions.h:130
PixelWindow _destinationPixelWindow
Definition: ImageOptions.h:137
RatioWindow _destinationRatioWindow
Definition: ImageOptions.h:136
GLenum _destinationPixelFormat
Definition: ImageOptions.h:140
#define META_Object(library, name)
Definition: Object.h:42
RatioWindow _sourceRatioWindow
Definition: ImageOptions.h:129
Definition: Archive.h:24
ImageWindowMode _sourceImageWindowMode
Definition: ImageOptions.h:128
ImageWindowMode _destinationImageWindowMode
Definition: ImageOptions.h:135
#define OSGDB_EXPORT
Definition: Export.h:39
osg::ref_ptr< osg::Image > _destinationImage
Definition: ImageOptions.h:133
ImageSamplingMode _sourceImageSamplingMode
Definition: ImageOptions.h:127
void set(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
Definition: ImageOptions.h:77
ImageOptions(const ImageOptions &options, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition: ImageOptions.h:29