From Eric Hammil, typo and spelling fixes
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include <vector>
|
||||
|
||||
#ifndef GL_VERSION_1_2
|
||||
/* 1.2 definitions...*/
|
||||
// 1.2 definitions...
|
||||
#define GL_BGR 0x80E0
|
||||
#define GL_BGRA 0x80E1
|
||||
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
namespace osg {
|
||||
|
||||
/** Image class for encapsulating the storage texture image data.*/
|
||||
/** Image class for encapsulating the storage texture image data. */
|
||||
class SG_EXPORT Image : public Object
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ class SG_EXPORT Image : public Object
|
||||
|
||||
Image();
|
||||
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
|
||||
Image(const Image& image,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
virtual Object* cloneType() const { return new Image(); }
|
||||
@@ -59,7 +59,7 @@ class SG_EXPORT Image : public Object
|
||||
virtual const char* libraryName() const { return "osg"; }
|
||||
virtual const char* className() const { return "Image"; }
|
||||
|
||||
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
|
||||
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
|
||||
virtual int compare(const Image& rhs) const;
|
||||
|
||||
void setFileName(const std::string& fileName);
|
||||
@@ -72,25 +72,25 @@ class SG_EXPORT Image : public Object
|
||||
USE_MALLOC_FREE
|
||||
};
|
||||
|
||||
/** Set the method used for deleting data once it goes out of scope.*/
|
||||
/** Set the method used for deleting data once it goes out of scope. */
|
||||
void setAllocationMode(AllocationMode mode) { _allocationMode = mode; }
|
||||
|
||||
/** Get the method used for deleting data once it goes out of scope.*/
|
||||
/** Get the method used for deleting data once it goes out of scope. */
|
||||
AllocationMode getAllocationMode() const { return _allocationMode; }
|
||||
|
||||
|
||||
/* allocated a pixel block of specified size and type.*/
|
||||
/** Allocate a pixel block of specified size and type. */
|
||||
void allocateImage(int s,int t,int r,
|
||||
GLenum pixelFormat,GLenum type,
|
||||
int packing=1);
|
||||
|
||||
|
||||
/** set the image data and pixelFormat.
|
||||
* note, when the packing value is negative (the default is -1) this method assumes
|
||||
/** Set the image data and pixelFormat.
|
||||
* 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 setImage(int s,int t,int r,
|
||||
GLint internalTextureformat,
|
||||
GLenum pixelFormat,GLenum type,
|
||||
@@ -98,14 +98,16 @@ class SG_EXPORT Image : public Object
|
||||
AllocationMode mode,
|
||||
int packing=1);
|
||||
|
||||
/** read pixels from current frame buffer at specified position and size, using glReadPixels.
|
||||
* Create memory for storage if required, reuse existing pixel coords if possible.*/
|
||||
/** Read pixels from current frame buffer at specified position and size, using glReadPixels.
|
||||
* Create memory for storage if required, reuse existing pixel coords if possible.
|
||||
*/
|
||||
void readPixels(int x,int y,int width,int height,
|
||||
GLenum pixelFormat,GLenum type);
|
||||
|
||||
|
||||
/** read the contents of the current bound texture, handling compressed pixelFormats if present.
|
||||
* Create memory for storage if required, reuse existing pixel coords if possible.*/
|
||||
/** Read the contents of the current bound texture, handling compressed pixelFormats if present.
|
||||
* Create memory for storage if required, reuse existing pixel coords if possible.
|
||||
*/
|
||||
void readImageFromCurrentTexture(unsigned int contextID, bool copyMipMapsIfAvailable);
|
||||
|
||||
|
||||
@@ -118,22 +120,23 @@ class SG_EXPORT Image : public Object
|
||||
/** 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.*/
|
||||
* If this Image is empty then image data is created to
|
||||
* accomodate the source image in its offset position.
|
||||
* If source is NULL then no operation happens, this Image is left unchanged.
|
||||
*/
|
||||
void copySubImage(int s_offset,int t_offset,int r_offset,osg::Image* source);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** Width of image.*/
|
||||
/** Width of image. */
|
||||
inline int s() const { return _s; }
|
||||
|
||||
/** Height of image.*/
|
||||
/** Height of image. */
|
||||
inline int t() const { return _t; }
|
||||
|
||||
/** Depth of image.*/
|
||||
/** Depth of image. */
|
||||
inline int r() const { return _r; }
|
||||
|
||||
void setInternalTextureFormat(GLint internalFormat);
|
||||
@@ -146,25 +149,25 @@ class SG_EXPORT Image : public Object
|
||||
|
||||
inline unsigned int getPacking() const { return _packing; }
|
||||
|
||||
/** return the numbers of bits required for each pixel.*/
|
||||
/** Return the number of bits required for each pixel. */
|
||||
inline unsigned int getPixelSizeInBits() const { return computePixelSizeInBits(_pixelFormat,_dataType); }
|
||||
|
||||
/** return the numbers of bytes each row of pixels occupies once it has been packed.*/
|
||||
/** Return the number of bytes each row of pixels occupies once it has been packed. */
|
||||
inline unsigned int getRowSizeInBytes() const { return computeRowWidthInBytes(_s,_pixelFormat,_dataType,_packing); }
|
||||
|
||||
/** return the numbers of bytes each image (_s*_t) of pixels occupies..*/
|
||||
/** Return the number of bytes each image (_s*_t) of pixels occupies. */
|
||||
inline unsigned int getImageSizeInBytes() const { return getRowSizeInBytes()*_t; }
|
||||
|
||||
/** return the numbers of bytes the whole row/image/volume of pixels occupies.*/
|
||||
/** Return the number of bytes the whole row/image/volume of pixels occupies. */
|
||||
inline unsigned int getTotalSizeInBytes() const { return getImageSizeInBytes()*_r; }
|
||||
|
||||
/** return the numbers of bytes the whole row/image/volume of pixels occupies, including all mip maps if included.*/
|
||||
/** Return the number of bytes the whole row/image/volume of pixels occupies, including all mip maps if included. */
|
||||
unsigned int getTotalSizeInBytesIncludingMipmaps() const;
|
||||
|
||||
/** raw image data.*/
|
||||
/** Raw image data. */
|
||||
inline unsigned char *data() { return _data; }
|
||||
|
||||
/** raw const image data.*/
|
||||
/** Raw const image data. */
|
||||
inline const unsigned char *data() const { return _data; }
|
||||
|
||||
|
||||
@@ -180,26 +183,27 @@ class SG_EXPORT Image : public Object
|
||||
return _data+(column*getPixelSizeInBits())/8+row*getRowSizeInBytes()+image*getImageSizeInBytes();
|
||||
}
|
||||
|
||||
/** Flip the image horizontally.*/
|
||||
/** Flip the image horizontally. */
|
||||
void flipHorizontal();
|
||||
|
||||
/** Flip the image vertically.*/
|
||||
/** Flip the image vertically. */
|
||||
void flipVertical();
|
||||
|
||||
|
||||
/** Ensure image dimensions are a power of two.
|
||||
* Mip Mapped texture require the image dimensions to be
|
||||
* Mipmapped textures require the image dimensions to be
|
||||
* power of two and are within the maxiumum texture size for
|
||||
* the host machine.*/
|
||||
* the host machine.
|
||||
*/
|
||||
void ensureValidSizeForTexturing(GLint maxTextureSize);
|
||||
|
||||
/** Dirty the image, which increments the modified flag, to force osg::Texture to reload the image.*/
|
||||
/** Dirty the image, which increments the modified flag, to force osg::Texture to reload the image. */
|
||||
inline void dirty() { ++_modifiedTag; }
|
||||
|
||||
/** Set the modified tag value, only used by osg::Texture when using texture subloading. */
|
||||
/** Set the modified tag value. Only used by osg::Texture when using texture subloading. */
|
||||
inline void setModifiedTag(unsigned int value) { _modifiedTag=value; }
|
||||
|
||||
/** Get modified tag value, only used by osg::Texture when using texture subloading. */
|
||||
/** Get modified tag value. Only used by osg::Texture when using texture subloading. */
|
||||
inline unsigned int getModifiedTag() const { return _modifiedTag; }
|
||||
|
||||
|
||||
@@ -209,7 +213,7 @@ class SG_EXPORT Image : public Object
|
||||
static unsigned int computeRowWidthInBytes(int width,GLenum pixelFormat,GLenum type,int packing);
|
||||
static int computeNearestPowerOfTwo(int s,float bias=0.5f);
|
||||
|
||||
// precomputed mipmaps stuff;
|
||||
/** Precomputed mipmaps stuff. */
|
||||
typedef std::vector< unsigned int > MipmapDataType;
|
||||
|
||||
inline bool isMipmap() const {return !_mipmapData.empty();};
|
||||
@@ -219,8 +223,7 @@ class SG_EXPORT Image : public Object
|
||||
return _mipmapData.size()+1;
|
||||
};
|
||||
|
||||
// send offsets into data
|
||||
// It is assumed that first mipmap offset (index 0) is 0
|
||||
/** Send offsets into data. It is assumed that first mipmap offset (index 0) is 0.*/
|
||||
inline void setMipmapData(const MipmapDataType& mipmapDataVector)
|
||||
{
|
||||
_mipmapData = mipmapDataVector;
|
||||
@@ -236,7 +239,7 @@ class SG_EXPORT Image : public Object
|
||||
};
|
||||
|
||||
|
||||
/** return true of this image is translucent - i.e. it has alpha values that are less 1.0 (when normalized).*/
|
||||
/** Return true if this image is translucent - i.e. it has alpha values that are less 1.0 (when normalized). */
|
||||
bool isImageTranslucent() const;
|
||||
|
||||
protected :
|
||||
@@ -267,15 +270,15 @@ class SG_EXPORT Image : public Object
|
||||
|
||||
class Geode;
|
||||
|
||||
/** Convenience function to be used by images loaders to generate a valid geode
|
||||
* to return for readNode().
|
||||
* Use the images s and t values scale the dimensions of the image.
|
||||
*/
|
||||
/** Convenience function to be used by image loaders to generate a valid geode
|
||||
* to return for readNode().
|
||||
* Use the image's s and t values to scale the dimensions of the image.
|
||||
*/
|
||||
extern SG_EXPORT Geode* createGeodeForImage(Image* image);
|
||||
/** Convenience function to be used by images loaders to generate a valid geode
|
||||
* to return for readNode().
|
||||
* Use the specified s and t values scale the dimensions of the image.
|
||||
*/
|
||||
/** Convenience function to be used by image loaders to generate a valid geode
|
||||
* to return for readNode().
|
||||
* Use the specified s and t values to scale the dimensions of the image.
|
||||
*/
|
||||
extern SG_EXPORT Geode* createGeodeForImage(Image* image,float s,float t);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user