Image class for encapsulating the storage texture image data
Inheritance:
Public Methods
-
Image()
-
Image(const Image& image, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
- Copy constructor using CopyOp to manage deep vs shallow copy
-
virtual Object* cloneType() const
-
virtual Object* clone(const CopyOp& copyop) const
-
virtual bool isSameKindAs(const Object* obj) const
-
virtual const char* libraryName() const
-
virtual const char* className() const
-
void setFileName(const std::string& fileName)
-
inline const std::string& getFileName() const
-
void createImage(int s, int t, int r, GLenum format, GLenum type, int packing=1)
-
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.
-
void readPixels(int x, int y, int width, int height, GLenum format, GLenum type)
- readPixels from screen at specified position and size, using glReadPixels.
-
void scaleImage(const int s, const int t, const int r)
- Scale image to specified size.
-
inline const int s() const
- Width of image
-
inline const int t() const
- Height of image
-
inline const int r() const
- Depth of image
-
void setInternalTextureFormat(GLint internalFormat)
-
inline const GLint getInternalTextureFormat() const
-
void setPixelFormat(const GLenum format)
-
inline const GLenum getPixelFormat() const
-
inline const GLenum getDataType() const
-
inline const unsigned int getPacking() const
-
inline const unsigned int getPixelSizeInBits() const
- return the numbers of bits required for each pixel
-
inline const unsigned int getRowSizeInBytes() const
- return the numbers of bytes each row of pixels occupies once it has been packed
-
inline const unsigned int getImageSizeInBytes() const
- return the numbers of bytes each image (_s*_t) of pixels occupies
-
inline const unsigned int getTotalSizeInBytes() const
- return the numbers of bytes the whole row/image/volume of pixels occupies
-
inline unsigned char* data()
- raw image data
-
inline const unsigned char* data() const
- raw const image data
-
unsigned char* data(int column, int row=0, int image=0)
-
void flipHorizontal(int image=0)
- Flip the image horizontally
-
void flipVertical(int image=0)
- Flip the image vertically
-
void ensureValidSizeForTexturing()
- Ensure image dimensions are a power of two.
-
inline void dirty()
- Dirty the image, which increments the modified flag, to force osg::Texture to reload the image
-
inline void setModifiedTag(const unsigned int value)
- Set the modified tag value, only used by osg::Texture when using texture subloading.
-
inline const unsigned int getModifiedTag() const
- Get modified tag value, only used by osg::Texture when using texture subloading.
-
static const bool isPackedType(GLenum type)
-
static const unsigned int computeNumComponents(GLenum format)
-
static const unsigned int computePixelSizeInBits(GLenum format, GLenum type)
-
static const unsigned int computeRowWidthInBytes(int width, GLenum format, GLenum type, int packing)
-
typedef std::vector< unsigned int >inline MipmapDataType bool isMipmap() const
-
unsigned int getNumMipmaps() const
-
inline void setMipmapData(const MipmapDataType& mipmapDataVector)
-
inline unsigned char* getMipmapData(unsigned int mipmapNumber) const
Protected Fields
-
std::string _fileName
-
int _s
-
int _t
-
int _r
-
GLint _internalTextureFormat
-
GLenum _pixelFormat
-
GLenum _dataType
-
unsigned int _packing
-
unsigned char* _data
-
unsigned int _modifiedTag
-
MipmapDataType _mipmapData
Protected Methods
-
virtual ~Image()
-
Image& operator = (const Image&)
Inherited from Object:
Public Methods
-
inline void setDataVariance(const DataVariance dv)
-
inline const DataVariance getDataVariance() const
Public Members
-
enum DataVariance
Protected Fields
-
DataVariance _dataVariance
Public Methods
-
inline void ref() const
-
inline void unref() const
-
inline void unref_nodelete() const
-
inline const int referenceCount() const
Protected Fields
-
mutable int _refCount
Documentation
Image class for encapsulating the storage texture image data
- Image()
- Image(const Image& image, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
- Copy constructor using CopyOp to manage deep vs shallow copy
- virtual Object* cloneType() const
- virtual Object* clone(const CopyOp& copyop) const
- virtual bool isSameKindAs(const Object* obj) const
- virtual const char* libraryName() const
- virtual const char* className() const
- void setFileName(const std::string& fileName)
- inline const std::string& getFileName() const
- void createImage(int s, int t, int r, GLenum format, GLenum type, int packing=1)
- 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.
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.
- void 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
- void scaleImage(const int s, const int t, const int r)
- Scale image to specified size.
- inline const int s() const
- Width of image
- inline const int t() const
- Height of image
- inline const int r() const
- Depth of image
- void setInternalTextureFormat(GLint internalFormat)
- inline const GLint getInternalTextureFormat() const
- void setPixelFormat(const GLenum format)
- inline const GLenum getPixelFormat() const
- inline const GLenum getDataType() const
- inline const unsigned int getPacking() const
- inline const unsigned int getPixelSizeInBits() const
- return the numbers of bits required for each pixel
- inline const unsigned int getRowSizeInBytes() const
- return the numbers of bytes each row of pixels occupies once it has been packed
- inline const unsigned int getImageSizeInBytes() const
- return the numbers of bytes each image (_s*_t) of pixels occupies
- inline const unsigned int getTotalSizeInBytes() const
- return the numbers of bytes the whole row/image/volume of pixels occupies
- inline unsigned char* data()
- raw image data
- inline const unsigned char* data() const
- raw const image data
- unsigned char* data(int column, int row=0, int image=0)
- void flipHorizontal(int image=0)
- Flip the image horizontally
- void flipVertical(int image=0)
- Flip the image vertically
- void 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.
- inline void dirty()
- Dirty the image, which increments the modified flag, to force osg::Texture to reload the image
- inline void setModifiedTag(const unsigned int value)
- Set the modified tag value, only used by osg::Texture when using texture subloading.
- inline const unsigned int getModifiedTag() const
- Get modified tag value, only used by osg::Texture when using texture subloading.
- static const bool isPackedType(GLenum type)
- static const unsigned int computeNumComponents(GLenum format)
- static const unsigned int computePixelSizeInBits(GLenum format, GLenum type)
- static const unsigned int computeRowWidthInBytes(int width, GLenum format, GLenum type, int packing)
- typedef std::vector< unsigned int >inline MipmapDataType bool isMipmap() const
- unsigned int getNumMipmaps() const
- inline void setMipmapData(const MipmapDataType& mipmapDataVector)
- inline unsigned char* getMipmapData(unsigned int mipmapNumber) const
- virtual ~Image()
- Image& operator = (const Image&)
- std::string _fileName
- int _s
- int _t
- int _r
- GLint _internalTextureFormat
- GLenum _pixelFormat
- GLenum _dataType
- unsigned int _packing
- unsigned char* _data
- unsigned int _modifiedTag
- MipmapDataType _mipmapData
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.