DrawPixels
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 OSG_DRAWPIXELS
#define OSG_DRAWPIXELS 1
#include <osg/Drawable>
#include <osg/Vec3>
#include <osg/Image>
namespace osg {
class OSG_EXPORT DrawPixels : public Drawable
{
public:
DrawPixels();
DrawPixels(const DrawPixels& drawimage,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return new DrawPixels(); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawPixels(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawPixels*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "DrawPixels"; }
void setPosition(const osg::Vec3& position);
osg::Vec3& getPosition() { return _position; }
const osg::Vec3& getPosition() const { return _position; }
void setImage(osg::Image* image) { _image = image; }
osg::Image* getImage() { return _image.get(); }
const osg::Image* getImage() const { return _image.get(); }
void setUseSubImage(bool useSubImage) { _useSubImage=useSubImage; }
bool getUseSubImage() const { return _useSubImage; }
void setSubImageDimensions(unsigned int offsetX,unsigned int offsetY,unsigned int width,unsigned int height);
void getSubImageDimensions(unsigned int& offsetX,unsigned int& offsetY,unsigned int& width,unsigned int& height) const;
virtual void drawImplementation(RenderInfo& renderInfo) const;
virtual BoundingBox computeBoundingBox() const;
protected:
DrawPixels& operator = (const DrawPixels&) { return *this;}
virtual ~DrawPixels();
Vec3 _position;
ref_ptr<Image> _image;
bool _useSubImage;
unsigned int _offsetX, _offsetY, _width, _height;
};
}
#endif
Drawable
Image
Vec3
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::DrawPixels::DrawPixels
DrawPixels()
osg::DrawPixels::getImage
osg::Image * getImage()
Definition DrawPixels:51
osg::DrawPixels::_offsetX
unsigned int _offsetX
Definition DrawPixels:74
osg::DrawPixels::computeBoundingBox
virtual BoundingBox computeBoundingBox() const
osg::DrawPixels::clone
virtual Object * clone(const CopyOp &copyop) const
Definition DrawPixels:36
osg::DrawPixels::getUseSubImage
bool getUseSubImage() const
Definition DrawPixels:55
osg::DrawPixels::DrawPixels
DrawPixels(const DrawPixels &drawimage, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
osg::DrawPixels::setImage
void setImage(osg::Image *image)
Definition DrawPixels:49
osg::DrawPixels::_width
unsigned int _width
Definition DrawPixels:74
osg::DrawPixels::cloneType
virtual Object * cloneType() const
Definition DrawPixels:34
osg::DrawPixels::_image
ref_ptr< Image > _image
Definition DrawPixels:71
osg::DrawPixels::libraryName
virtual const char * libraryName() const
Definition DrawPixels:40
osg::DrawPixels::getImage
const osg::Image * getImage() const
Definition DrawPixels:52
osg::DrawPixels::_position
Vec3 _position
Definition DrawPixels:70
osg::DrawPixels::setUseSubImage
void setUseSubImage(bool useSubImage)
Definition DrawPixels:54
osg::DrawPixels::_offsetY
unsigned int _offsetY
Definition DrawPixels:74
osg::DrawPixels::getPosition
osg::Vec3 & getPosition()
Definition DrawPixels:46
osg::DrawPixels::className
virtual const char * className() const
Definition DrawPixels:41
osg::DrawPixels::setSubImageDimensions
void setSubImageDimensions(unsigned int offsetX, unsigned int offsetY, unsigned int width, unsigned int height)
osg::DrawPixels::drawImplementation
virtual void drawImplementation(RenderInfo &renderInfo) const
osg::DrawPixels::isSameKindAs
virtual bool isSameKindAs(const Object *obj) const
Definition DrawPixels:38
osg::DrawPixels::setPosition
void setPosition(const osg::Vec3 &position)
osg::DrawPixels::_height
unsigned int _height
Definition DrawPixels:74
osg::DrawPixels::getSubImageDimensions
void getSubImageDimensions(unsigned int &offsetX, unsigned int &offsetY, unsigned int &width, unsigned int &height) const
osg::DrawPixels::_useSubImage
bool _useSubImage
Definition DrawPixels:73
osg::DrawPixels::getPosition
const osg::Vec3 & getPosition() const
Definition DrawPixels:47
osg::DrawPixels::~DrawPixels
virtual ~DrawPixels()
osg::Drawable::Drawable
Drawable()
osg::Image
Definition Image:179
osg::Object
Definition Object:61
osg::RenderInfo
Definition RenderInfo:28
osg::ref_ptr
Definition ref_ptr:32
osg
Definition AlphaFunc:19
osg::Vec3
Vec3f Vec3
Definition Vec3:21
osg::BoundingBox
BoundingBoxd BoundingBox
Definition BoundingBox:257
NULL
#define NULL
Definition osg/Export:55
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39