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* libraryName() const
[more]virtual const char* className() const
[more]void setFileName(const std::string& fileName)
[more]inline const std::string& getFileName() const
[more]void allocateImage(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(int s, int t, int r)
Scale image to specified size.
[more]void copySubImage(int s_offset, int t_offset, int r_offset, osg::Image* source)
Copy a source Image into a subpart of this Image at specified position.
[more]inline int s() const
Width of image
[more]inline int t() const
Height of image
[more]inline int r() const
Depth of image
[more]void setInternalTextureFormat(GLint internalFormat)
[more]inline GLint getInternalTextureFormat() const
[more]void setPixelFormat(GLenum format)
[more]inline GLenum getPixelFormat() const
[more]inline GLenum getDataType() const
[more]inline unsigned int getPacking() const
[more]inline unsigned int getPixelSizeInBits() const
return the numbers of bits required for each pixel
[more]inline unsigned int getRowSizeInBytes() const
return the numbers of bytes each row of pixels occupies once it has been packed
[more]inline unsigned int getImageSizeInBytes() const
return the numbers of bytes each image (_s*_t) of pixels occupies
[more]inline 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]inline unsigned char* data(int column, int row=0, int image=0) const
[more]void flipHorizontal(int image=0)
Flip the image horizontally
[more]void flipVertical(int image=0)
Flip the image vertically
[more]void ensureValidSizeForTexturing(GLint maxTextureSize)
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(unsigned int value)
Set the modified tag value, only used by osg::Texture when using texture subloading.
[more]inline unsigned int getModifiedTag() const
Get modified tag value, only used by osg::Texture when using texture subloading.
[more]static bool isPackedType(GLenum type)
[more]static unsigned int computeNumComponents(GLenum format)
[more]static unsigned int computePixelSizeInBits(GLenum format, GLenum type)
[more]static unsigned int computeRowWidthInBytes(int width, GLenum format, GLenum type, int packing)
[more]static unsigned int computeNearestPowerOfTwo(unsigned int s, float bias=0.5f)
[more]inline bool isMipmap() const
[more]unsigned int getNumMipmapLevels() const
[more]inline void setMipmapData(const MipmapDataType& mipmapDataVector)
[more]inline unsigned char* getMipmapData(unsigned int mipmapNumber) const
[more]void computeMipMaps()
converts a single image into mip mapped version image

Public Members

[more]typedef std::vector< unsigned int > MipmapDataType

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
oinline void setUserData(Referenced* obj)
oinline Referenced* getUserData()
oinline const Referenced* getUserData() const

Public Members

oenum DataVariance

Protected Fields

oDataVariance _dataVariance
oref_ptr<Referenced> _userData


Inherited from Referenced:

Public Methods

oinline void ref() const
oinline void unref() const
oinline void unref_nodelete() const
oinline int referenceCount() const
oinline static int createdCount()
oinline static int deletedCount()

Protected Fields

omutable int _refCount
ostatic int _createdCount
ostatic int _deletedCount


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* libraryName() const

ovirtual const char* className() const

ovoid setFileName(const std::string& fileName)

oinline const std::string& getFileName() const

ovoid allocateImage(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(int s, int t, int r)
Scale image to specified size.

ovoid copySubImage(int s_offset, int t_offset, int r_offset, osg::Image* source)
Copy a source Image into a subpart of this Image at specified position. Typically used to copy to an already allocated image, such as creating a 3D image from a stack 2D images. If the this Image is empty then image data is created to accomodate the imaging image in its offset position. If source is NULL then no operation happens, this Image is left unchanged.

oinline int s() const
Width of image

oinline int t() const
Height of image

oinline int r() const
Depth of image

ovoid setInternalTextureFormat(GLint internalFormat)

oinline GLint getInternalTextureFormat() const

ovoid setPixelFormat(GLenum format)

oinline GLenum getPixelFormat() const

oinline GLenum getDataType() const

oinline unsigned int getPacking() const

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

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

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

oinline 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

oinline unsigned char* data(int column, int row=0, int image=0) const

ovoid flipHorizontal(int image=0)
Flip the image horizontally

ovoid flipVertical(int image=0)
Flip the image vertically

ovoid ensureValidSizeForTexturing(GLint maxTextureSize)
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(unsigned int value)
Set the modified tag value, only used by osg::Texture when using texture subloading.

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

ostatic bool isPackedType(GLenum type)

ostatic unsigned int computeNumComponents(GLenum format)

ostatic unsigned int computePixelSizeInBits(GLenum format, GLenum type)

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

ostatic unsigned int computeNearestPowerOfTwo(unsigned int s, float bias=0.5f)

otypedef std::vector< unsigned int > MipmapDataType

oinline bool isMipmap() const

ounsigned int getNumMipmapLevels() const

oinline void setMipmapData(const MipmapDataType& mipmapDataVector)

oinline unsigned char* getMipmapData(unsigned int mipmapNumber) const

ovoid computeMipMaps()
converts a single image into mip mapped version image

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++.