ImageOptions
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library 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
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGDB_IMAGEOPTIONS
#define OSGDB_IMAGEOPTIONS 1
#include <osgDB/Options>
namespace osgDB {
class OSGDB_EXPORT ImageOptions : public osgDB::Options
{
public:
ImageOptions();
ImageOptions(const std::string& str);
ImageOptions(const ImageOptions& options,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
osgDB::Options(options,copyop),
_sourceImageSamplingMode(options._sourceImageSamplingMode),
_sourceImageWindowMode(options._sourceImageWindowMode),
_sourceRatioWindow(options._sourceRatioWindow),
_sourcePixelWindow(options._sourcePixelWindow),
_destinationImage(options._destinationImage),
_destinationImageWindowMode(options._destinationImageWindowMode),
_destinationRatioWindow(options._destinationRatioWindow),
_destinationPixelWindow(options._destinationPixelWindow),
_destinationDataType(options._destinationDataType),
_destinationPixelFormat(options._destinationPixelFormat) {}
META_Object(osgDB,ImageOptions);
struct RatioWindow
{
RatioWindow():
windowX(0.0),
windowY(0.0),
windowWidth(1.0),
windowHeight(1.0) {}
void set(double x, double y, double w, double h)
{
windowX = x;
windowY = y;
windowWidth = w;
windowHeight = h;
}
double windowX;
double windowY;
double windowWidth;
double windowHeight;
};
struct PixelWindow
{
PixelWindow():
windowX(0),
windowY(0),
windowWidth(0),
windowHeight(0) {}
void set(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
{
windowX = x;
windowY = y;
windowWidth = w;
windowHeight = h;
}
unsigned int windowX;
unsigned int windowY;
unsigned int windowWidth;
unsigned int windowHeight;
};
enum ImageWindowMode
{
ALL_IMAGE,
RATIO_WINDOW,
PIXEL_WINDOW
};
enum ImageSamplingMode
{
NEAREST,
LINEAR,
CUBIC
};
struct TexCoordRange : public osg::Referenced
{
TexCoordRange():
_x(0.0),
_y(0.0),
_w(1.0),
_h(1.0) {}
void set(double x,double y, double w, double h)
{
_x = x;
_y = y;
_w = w;
_h = h;
}
double _x,_y,_w,_h;
protected:
virtual ~TexCoordRange() {}
};
// source
ImageSamplingMode _sourceImageSamplingMode;
ImageWindowMode _sourceImageWindowMode;
RatioWindow _sourceRatioWindow;
PixelWindow _sourcePixelWindow;
// destination
osg::ref_ptr<osg::Image> _destinationImage;
ImageWindowMode _destinationImageWindowMode;
RatioWindow _destinationRatioWindow;
PixelWindow _destinationPixelWindow;
GLenum _destinationDataType;
GLenum _destinationPixelFormat;
void init();
};
}
#endif // OSGDB_IMAGEOPTIONS
Options
osgDB::ImageOptions::_destinationPixelWindow
PixelWindow _destinationPixelWindow
Definition ImageOptions:139
osgDB::ImageOptions::_sourceImageSamplingMode
ImageSamplingMode _sourceImageSamplingMode
Definition ImageOptions:129
osgDB::ImageOptions::ImageOptions
ImageOptions()
osgDB::ImageOptions::_sourceImageWindowMode
ImageWindowMode _sourceImageWindowMode
Definition ImageOptions:130
osgDB::ImageOptions::_sourcePixelWindow
PixelWindow _sourcePixelWindow
Definition ImageOptions:132
osgDB::ImageOptions::_sourceRatioWindow
RatioWindow _sourceRatioWindow
Definition ImageOptions:131
osgDB::ImageOptions::ImageOptions
ImageOptions(const std::string &str)
osgDB::ImageOptions::_destinationImage
osg::ref_ptr< osg::Image > _destinationImage
Definition ImageOptions:135
osgDB::ImageOptions::ImageOptions
ImageOptions(const ImageOptions &options, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Definition ImageOptions:29
osgDB::ImageOptions::ImageSamplingMode
ImageSamplingMode
Definition ImageOptions:99
osgDB::ImageOptions::CUBIC
@ CUBIC
Definition ImageOptions:102
osgDB::ImageOptions::LINEAR
@ LINEAR
Definition ImageOptions:101
osgDB::ImageOptions::NEAREST
@ NEAREST
Definition ImageOptions:100
osgDB::ImageOptions::META_Object
META_Object(osgDB, ImageOptions)
osgDB::ImageOptions::_destinationDataType
GLenum _destinationDataType
Definition ImageOptions:141
osgDB::ImageOptions::ImageWindowMode
ImageWindowMode
Definition ImageOptions:92
osgDB::ImageOptions::ALL_IMAGE
@ ALL_IMAGE
Definition ImageOptions:93
osgDB::ImageOptions::PIXEL_WINDOW
@ PIXEL_WINDOW
Definition ImageOptions:95
osgDB::ImageOptions::RATIO_WINDOW
@ RATIO_WINDOW
Definition ImageOptions:94
osgDB::ImageOptions::_destinationPixelFormat
GLenum _destinationPixelFormat
Definition ImageOptions:142
osgDB::ImageOptions::init
void init()
osgDB::ImageOptions::_destinationImageWindowMode
ImageWindowMode _destinationImageWindowMode
Definition ImageOptions:137
osgDB::ImageOptions::_destinationRatioWindow
RatioWindow _destinationRatioWindow
Definition ImageOptions:138
osgDB::Options
Definition Options:30
osgDB::Options::Options
Options()
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Referenced
Definition Referenced:44
osg::ref_ptr
Definition ref_ptr:32
osgDB
Definition Archive:24
OSGDB_EXPORT
#define OSGDB_EXPORT
Definition osgDB/Export:39
osgDB::ImageOptions::PixelWindow
Definition ImageOptions:70
osgDB::ImageOptions::PixelWindow::set
void set(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
Definition ImageOptions:77
osgDB::ImageOptions::PixelWindow::windowHeight
unsigned int windowHeight
Definition ImageOptions:88
osgDB::ImageOptions::PixelWindow::PixelWindow
PixelWindow()
Definition ImageOptions:71
osgDB::ImageOptions::PixelWindow::windowWidth
unsigned int windowWidth
Definition ImageOptions:87
osgDB::ImageOptions::PixelWindow::windowY
unsigned int windowY
Definition ImageOptions:86
osgDB::ImageOptions::PixelWindow::windowX
unsigned int windowX
Definition ImageOptions:85
osgDB::ImageOptions::RatioWindow
Definition ImageOptions:47
osgDB::ImageOptions::RatioWindow::set
void set(double x, double y, double w, double h)
Definition ImageOptions:54
osgDB::ImageOptions::RatioWindow::windowX
double windowX
Definition ImageOptions:62
osgDB::ImageOptions::RatioWindow::RatioWindow
RatioWindow()
Definition ImageOptions:48
osgDB::ImageOptions::RatioWindow::windowHeight
double windowHeight
Definition ImageOptions:65
osgDB::ImageOptions::RatioWindow::windowWidth
double windowWidth
Definition ImageOptions:64
osgDB::ImageOptions::RatioWindow::windowY
double windowY
Definition ImageOptions:63
osgDB::ImageOptions::TexCoordRange::~TexCoordRange
virtual ~TexCoordRange()
Definition ImageOptions:124
osgDB::ImageOptions::TexCoordRange::set
void set(double x, double y, double w, double h)
Definition ImageOptions:114
osgDB::ImageOptions::TexCoordRange::_y
double _y
Definition ImageOptions:122
osgDB::ImageOptions::TexCoordRange::_w
double _w
Definition ImageOptions:122
osgDB::ImageOptions::TexCoordRange::_h
double _h
Definition ImageOptions:122
osgDB::ImageOptions::TexCoordRange::TexCoordRange
TexCoordRange()
Definition ImageOptions:108
osgDB::ImageOptions::TexCoordRange::_x
double _x
Definition ImageOptions:122