class SG_EXPORT osg::Image

Image class for encapsulating the storage texture image data

Inheritance:


Public Methods

[more] Image()
[more] Image(const Image& image, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy
[more]virtual Object* cloneType() const
[more]virtual Object* clone(const CopyOp& copyop) const
[more]virtual bool isSameKindAs(const Object* obj) const
[more]virtual const char* className() const
[more]void setFileName(const std::string& fileName)
[more]inline const std::string& getFileName() const
[more]void createImage(int s, int t, int r, GLenum format, GLenum type, int packing=1)
[more]void setImage(int s, int t, int r, GLint internalTextureformat, GLenum format, GLenum type, unsigned char* data, int packing=1)
set the image data and format.
[more]void readPixels(int x, int y, int width, int height, GLenum format, GLenum type)
readPixels from screen at specified position and size, using glReadPixels.
[more]void scaleImage(const int s, const int t, const int r)
Scale image to specified size.
[more]inline const int s() const
Width of image
[more]inline const int t() const
Height of image
[more]inline const int r() const
Depth of image
[more]void setInternalTextureFormat(GLint internalFormat)
[more]inline const GLint getInternalTextureFormat() const
[more]void setPixelFormat(const GLenum format)
[more]inline const GLenum getPixelFormat() const
[more]inline const GLenum getDataType() const
[more]inline const unsigned int getPacking() const
[more]inline const unsigned int getPixelSizeInBits() const
return the numbers of bits required for each pixel
[more]inline const unsigned int getRowSizeInBytes() const
return the numbers of bytes each row of pixels occupies once it has been packed
[more]inline const unsigned int getImageSizeInBytes() const
return the numbers of bytes each image (_s*_t) of pixels occupies
[more]inline const unsigned int getTotalSizeInBytes() const
return the numbers of bytes the whole row/image/volume of pixels occupies
[more]inline unsigned char* data()
raw image data
[more]inline const unsigned char* data() const
raw const image data
[more]unsigned char* data(int column, int row=0, int image=0)
[more]void ensureValidSizeForTexturing()
Ensure image dimensions are a power of two.
[more]inline void dirty()
Dirty the image, which increments the modified flag, to force osg::Texture to reload the image
[more]inline void setModifiedTag(const unsigned int value)
Set the modified tag value, only used by osg::Texture when using texture subloading.
[more]inline const unsigned int getModifiedTag() const
Get modified tag value, only used by osg::Texture when using texture subloading.
[more]static const bool isPackedType(GLenum type)
[more]static const unsigned int computeNumComponents(GLenum format)
[more]static const unsigned int computePixelSizeInBits(GLenum format, GLenum type)
[more]static const unsigned int computeRowWidthInBytes(int width, GLenum format, GLenum type, int packing)
[more]typedef std::vector< unsigned int >inline MipmapDataType bool isMipmap() const
[more]unsigned int getNumMipmaps() const
[more]inline void setMipmapData(const MipmapDataType& mipmapDataVector)
[more]inline unsigned char* getMipmapData(unsigned int mipmapNumber) const

Protected Fields

[more]std::string _fileName
[more]int _s
[more]int _t
[more]int _r
[more]GLint _internalTextureFormat
[more]GLenum _pixelFormat
[more]GLenum _dataType
[more]unsigned int _packing
[more]unsigned char* _data
[more]unsigned int _modifiedTag
[more]MipmapDataType _mipmapData

Protected Methods

[more]virtual ~Image()
[more]Image& operator = (const Image&)


Inherited from Object:

Public Methods

oinline void setDataVariance(const DataVariance dv)
oinline const DataVariance getDataVariance() const

Public Members

oenum DataVariance

Protected Fields

oDataVariance _dataVariance


Inherited from Referenced:

Public Methods

oinline void ref() const
oinline void unref() const
oinline void unref_nodelete() const
oinline const int referenceCount() const

Protected Fields

omutable int _refCount


Documentation

Image class for encapsulating the storage texture image data
o Image()

o Image(const Image& image, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy

ovirtual Object* cloneType() const

ovirtual Object* clone(const CopyOp& copyop) const

ovirtual bool isSameKindAs(const Object* obj) const

ovirtual const char* className() const

ovoid setFileName(const std::string& fileName)

oinline const std::string& getFileName() const

ovoid createImage(int s, int t, int r, GLenum format, GLenum type, int packing=1)

ovoid setImage(int s, int t, int r, GLint internalTextureformat, GLenum format, GLenum type, unsigned char* data, int packing=1)
set the image data and format. note, when the packing value is negative (the default is -1) this method assumes a _packing width of 1 if the width is not a multiple of 4, otherwise automatically sets to _packing to 4. If a positive value of packing is supplied than _packing is simply set to that value.

ovoid readPixels(int x, int y, int width, int height, GLenum format, GLenum type)
readPixels from screen at specified position and size, using glReadPixels. Create memory for storage if required, reuse existing pixel coords if possible. if pixelFormat or dataType

ovoid scaleImage(const int s, const int t, const int r)
Scale image to specified size.

oinline const int s() const
Width of image

oinline const int t() const
Height of image

oinline const int r() const
Depth of image

ovoid setInternalTextureFormat(GLint internalFormat)

oinline const GLint getInternalTextureFormat() const

ovoid setPixelFormat(const GLenum format)

oinline const GLenum getPixelFormat() const

oinline const GLenum getDataType() const

oinline const unsigned int getPacking() const

oinline const unsigned int getPixelSizeInBits() const
return the numbers of bits required for each pixel

oinline const unsigned int getRowSizeInBytes() const
return the numbers of bytes each row of pixels occupies once it has been packed

oinline const unsigned int getImageSizeInBytes() const
return the numbers of bytes each image (_s*_t) of pixels occupies

oinline const unsigned int getTotalSizeInBytes() const
return the numbers of bytes the whole row/image/volume of pixels occupies

oinline unsigned char* data()
raw image data

oinline const unsigned char* data() const
raw const image data

ounsigned char* data(int column, int row=0, int image=0)

ovoid ensureValidSizeForTexturing()
Ensure image dimensions are a power of two. Mip Mapped texture require the image dimensions to be power of two and are within the maxiumum texture size for the host machine.

oinline void dirty()
Dirty the image, which increments the modified flag, to force osg::Texture to reload the image

oinline void setModifiedTag(const unsigned int value)
Set the modified tag value, only used by osg::Texture when using texture subloading.

oinline const unsigned int getModifiedTag() const
Get modified tag value, only used by osg::Texture when using texture subloading.

ostatic const bool isPackedType(GLenum type)

ostatic const unsigned int computeNumComponents(GLenum format)

ostatic const unsigned int computePixelSizeInBits(GLenum format, GLenum type)

ostatic const unsigned int computeRowWidthInBytes(int width, GLenum format, GLenum type, int packing)

otypedef std::vector< unsigned int >inline MipmapDataType bool isMipmap() const

ounsigned int getNumMipmaps() const

oinline void setMipmapData(const MipmapDataType& mipmapDataVector)

oinline unsigned char* getMipmapData(unsigned int mipmapNumber) const

ovirtual ~Image()

oImage& operator = (const Image&)

ostd::string _fileName

oint _s

oint _t

oint _r

oGLint _internalTextureFormat

oGLenum _pixelFormat

oGLenum _dataType

ounsigned int _packing

ounsigned char* _data

ounsigned int _modifiedTag

oMipmapDataType _mipmapData


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.