|
Public Types |
typedef std::vector< unsigned
int > | MipmapDataType |
| | Precomputed mipmaps stuff.
|
| enum | AllocationMode { NO_DELETE,
USE_NEW_DELETE,
USE_MALLOC_FREE
} |
Public Member Functions |
| | Image () |
| | Image (const Image &image, const CopyOp ©op=CopyOp::SHALLOW_COPY) |
| | Copy constructor using CopyOp to manage deep vs shallow copy.
|
| virtual Object * | cloneType () const |
| | Clone the type of an object, with Object* return type.
|
| virtual Object * | clone (const CopyOp ©op) const |
| | Clone an object, with Object* return type.
|
| virtual bool | isSameKindAs (const Object *obj) const |
| virtual const char * | libraryName () const |
| | return the name of the object's library.
|
| virtual const char * | className () const |
| | return the name of the object's class type.
|
| virtual int | compare (const Image &rhs) const |
| | Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
|
| void | setFileName (const std::string &fileName) |
| const std::string & | getFileName () const |
| void | setAllocationMode (AllocationMode mode) |
| | Set the method used for deleting data once it goes out of scope.
|
| AllocationMode | getAllocationMode () const |
| | Get the method used for deleting data once it goes out of scope.
|
| void | allocateImage (int s, int t, int r, GLenum pixelFormat, GLenum type, int packing=1) |
| | Allocate a pixel block of specified size and type.
|
| void | setImage (int s, int t, int r, GLint internalTextureformat, GLenum pixelFormat, GLenum type, unsigned char *data, AllocationMode mode, int packing=1) |
| | Set the image data and pixelFormat.
|
| void | readPixels (int x, int y, int width, int height, GLenum pixelFormat, GLenum type) |
| | Read pixels from current frame buffer at specified position and size, using glReadPixels.
|
| void | readImageFromCurrentTexture (unsigned int contextID, bool copyMipMapsIfAvailable) |
| | Read the contents of the current bound texture, handling compressed pixelFormats if present.
|
| void | scaleImage (int s, int t, int r) |
| | Scale image to specified size.
|
| void | scaleImage (int s, int t, int r, GLenum newDataType) |
| | Scale image to specified size and with specified data type.
|
| 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.
|
| int | s () const |
| | Width of image.
|
| int | t () const |
| | Height of image.
|
| int | r () const |
| | Depth of image.
|
| void | setInternalTextureFormat (GLint internalFormat) |
| GLint | getInternalTextureFormat () const |
| void | setPixelFormat (GLenum pixelFormat) |
| GLenum | getPixelFormat () const |
| GLenum | getDataType () const |
| unsigned int | getPacking () const |
| unsigned int | getPixelSizeInBits () const |
| | Return the number of bits required for each pixel.
|
| unsigned int | getRowSizeInBytes () const |
| | Return the number of bytes each row of pixels occupies once it has been packed.
|
| unsigned int | getImageSizeInBytes () const |
| | Return the number of bytes each image (_s*_t) of pixels occupies.
|
| unsigned int | getTotalSizeInBytes () const |
| | Return the number of bytes the whole row/image/volume of pixels occupies.
|
| unsigned int | getTotalSizeInBytesIncludingMipmaps () const |
| | Return the number of bytes the whole row/image/volume of pixels occupies, including all mip maps if included.
|
| bool | valid () const |
| | Return true if the Image represent a valid and usable imagery.
|
| unsigned char * | data () |
| | Raw image data.
|
| const unsigned char * | data () const |
| | Raw const image data.
|
| unsigned char * | data (int column, int row=0, int image=0) |
| const unsigned char * | data (int column, int row=0, int image=0) const |
| void | flipHorizontal () |
| | Flip the image horizontally.
|
| void | flipVertical () |
| | Flip the image vertically.
|
| void | ensureValidSizeForTexturing (GLint maxTextureSize) |
| | Ensure image dimensions are a power of two.
|
| void | dirty () |
| | Dirty the image, which increments the modified count, to force osg::Texture to reload the image.
|
| void | setModifiedCount (unsigned int value) |
| | Set the modified count value.
|
| unsigned int | getModifiedCount () const |
| | Get modified count value.
|
| bool | isMipmap () const |
| unsigned int | getNumMipmapLevels () const |
| void | setMipmapLevels (const MipmapDataType &mipmapDataVector) |
| | Send offsets into data.
|
| const MipmapDataType & | getMipmapLevels () const |
| unsigned int | getMipmapOffset (unsigned int mipmapLevel) const |
| unsigned char * | getMipmapData (unsigned int mipmapLevel) |
| const unsigned char * | getMipmapData (unsigned int mipmapLevel) const |
| bool | isImageTranslucent () const |
| | Return true if this image is translucent - i.e.
|
| void | setPixelBufferObject (PixelBufferObject *buffer) |
| | Set the optional PixelBufferObject used to map the image memory efficiently to graphics memory.
|
| PixelBufferObject * | getPixelBufferObject () |
| | Get the PixelBufferObject.
|
| const PixelBufferObject * | getPixelBufferObject () const |
| | Get the const PixelBufferObject.
|
Static Public Member Functions |
| bool | isPackedType (GLenum type) |
| unsigned int | computeNumComponents (GLenum pixelFormat) |
| unsigned int | computePixelSizeInBits (GLenum pixelFormat, GLenum type) |
| unsigned int | computeRowWidthInBytes (int width, GLenum pixelFormat, GLenum type, int packing) |
| int | computeNearestPowerOfTwo (int s, float bias=0.5f) |
Protected Member Functions |
| virtual | ~Image () |
| Image & | operator= (const Image &) |
| void | deallocateData () |
| void | setData (unsigned char *data, AllocationMode allocationMode) |
Protected Attributes |
| std::string | _fileName |
| int | _s |
| int | _t |
| int | _r |
| GLint | _internalTextureFormat |
| GLenum | _pixelFormat |
| GLenum | _dataType |
| unsigned int | _packing |
| AllocationMode | _allocationMode |
| unsigned char * | _data |
| unsigned int | _modifiedCount |
| MipmapDataType | _mipmapData |
| ref_ptr< PixelBufferObject > | _bufferObject |