31 #include <boost/filesystem.hpp>
34 #include "core/common/WColor.h"
48 typedef std::shared_ptr< WGEImage >
SPtr;
53 typedef std::shared_ptr< const WGEImage >
ConstSPtr;
65 explicit WGEImage(
const osg::Image& image );
139 unsigned char*
data();
146 const unsigned char*
data()
const;
157 WColor
getColor(
unsigned int x,
unsigned int y = 0,
unsigned int z = 0 );
osg::ref_ptr< osg::Image > getAsOSGImage() const
Return the underlying osg::Image.
Origin
Where is the origin?
@ BOTTOM_LEFT
bottom left origin
@ TOP_LEFT
top left origin
WColor getColor(unsigned int x, unsigned int y=0, unsigned int z=0)
Grab color at specified pixel/voxel.
std::shared_ptr< const WGEImage > ConstSPtr
Convenience typedef for a std::shared_ptr< const WGEImage >.
unsigned char * data()
Get the raw image data.
WGEImage()
Default constructor.
osg::ref_ptr< osg::Image > m_image
The osg image we use.
int getWidth() const
Get size in X direction.
int getDepth() const
Get size in Z direction.
WGEImage & operator=(WGEImage other)
Copy assignment operator.
static WGEImage::SPtr createFromFile(boost::filesystem::path file)
Load an image from a file.
Origin getOrigin() const
Query origin.
int getHeight() const
Get size in Y direction.
virtual ~WGEImage()
Destructor.
std::shared_ptr< WGEImage > SPtr
Convenience typedef for a std::shared_ptr< WGEImage >.