Inheritance diagram for osg::Image:
Public Types | |
typedef std::vector< unsigned int > | MipmapDataType |
enum | AllocationMode { NO_DELETE, USE_NEW_DELETE, USE_MALLOC_FREE } |
Public Member Functions | |
Image () | |
Image (const Image &image, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
virtual Object * | cloneType () const |
virtual Object * | clone (const CopyOp ©op) const |
virtual bool | isSameKindAs (const Object *obj) const |
virtual const char * | libraryName () const |
virtual const char * | className () const |
virtual int | compare (const Image &rhs) const |
void | setFileName (const std::string &fileName) |
const std::string & | getFileName () const |
void | setAllocationMode (AllocationMode mode) |
AllocationMode | getAllocationMode () const |
void | allocateImage (int s, int t, int r, GLenum pixelFormat, GLenum type, int packing=1) |
void | setImage (int s, int t, int r, GLint internalTextureformat, GLenum pixelFormat, GLenum type, unsigned char *data, AllocationMode mode, int packing=1) |
void | readPixels (int x, int y, int width, int height, GLenum pixelFormat, GLenum type) |
void | readImageFromCurrentTexture (unsigned int contextID, bool copyMipMapsIfAvailable) |
void | scaleImage (int s, int t, int r) |
void | scaleImage (int s, int t, int r, GLenum newDataType) |
void | copySubImage (int s_offset, int t_offset, int r_offset, osg::Image *source) |
int | s () const |
int | t () const |
int | r () const |
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 |
unsigned int | getRowSizeInBytes () const |
unsigned int | getImageSizeInBytes () const |
unsigned int | getTotalSizeInBytes () const |
unsigned int | getTotalSizeInBytesIncludingMipmaps () const |
unsigned char * | data () |
const unsigned char * | data () const |
unsigned char * | data (int column, int row=0, int image=0) |
unsigned char * | data (int column, int row=0, int image=0) const |
void | flipHorizontal () |
void | flipVertical () |
void | ensureValidSizeForTexturing (GLint maxTextureSize) |
void | dirty () |
void | setModifiedTag (unsigned int value) |
unsigned int | getModifiedTag () const |
bool | isMipmap () const |
unsigned int | getNumMipmapLevels () const |
void | setMipmapData (const MipmapDataType &mipmapDataVector) |
unsigned char * | getMipmapData (unsigned int mipmapNumber) const |
bool | isImageTranslucent () const |
Static Public Member Functions | |
static bool | isPackedType (GLenum type) |
static unsigned int | computeNumComponents (GLenum pixelFormat) |
static unsigned int | computePixelSizeInBits (GLenum pixelFormat, GLenum type) |
static unsigned int | computeRowWidthInBytes (int width, GLenum pixelFormat, GLenum type, int packing) |
static 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 | _modifiedTag |
MipmapDataType | _mipmapData |
|
Precomputed mipmaps stuff. |
|
|
|
|
|
Copy constructor using CopyOp to manage deep vs shallow copy. |
|
|
|
Allocate a pixel block of specified size and type. |
|
return the name of the object's class type. Must be defined by derived classes. Implements osg::Object. Reimplemented in osg::ImageStream. |
|
Clone an object, with Object* return type. Must be defined by derived classes. Implements osg::Object. Reimplemented in osg::ImageStream. |
|
Clone the type of an object, with Object* return type. Must be defined by derived classes. Implements osg::Object. Reimplemented in osg::ImageStream. |
|
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. Reimplemented in osg::ImageStream. |
|
|
|
|
|
|
|
|
|
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 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. |
|
|
|
|
|
Raw const image data. |
|
Raw image data. |
|
|
|
Dirty the image, which increments the modified flag, to force osg::Texture to reload the image. |
|
Ensure image dimensions are a power of two. Mipmapped textures require the image dimensions to be power of two and are within the maxiumum texture size for the host machine. |
|
Flip the image horizontally. |
|
Flip the image vertically. |
|
Get the method used for deleting data once it goes out of scope. |
|
|
|
|
|
Return the number of bytes each image (_s*_t) of pixels occupies. |
|
|
|
|
|
Get modified tag value. Only used by osg::Texture when using texture subloading. |
|
|
|
|
|
|
|
Return the number of bits required for each pixel. |
|
Return the number of bytes each row of pixels occupies once it has been packed. |
|
Return the number of bytes the whole row/image/volume of pixels occupies. |
|
Return the number of bytes the whole row/image/volume of pixels occupies, including all mip maps if included. |
|
Return true if this image is translucent - i.e. it has alpha values that are less 1.0 (when normalized). |
|
|
|
|
|
Reimplemented from osg::Object. Reimplemented in osg::ImageStream. |
|
return the name of the object's library. Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. Implements osg::Object. Reimplemented in osg::ImageStream. |
|
|
|
Depth of image. |
|
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 pixels from current frame buffer at specified position and size, using glReadPixels. Create memory for storage if required, reuse existing pixel coords if possible. |
|
Width of image. |
|
Scale image to specified size and with specified data type. |
|
Scale image to specified size. |
|
Set the method used for deleting data once it goes out of scope. |
|
|
|
|
|
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. |
|
|
|
Send offsets into data. It is assumed that first mipmap offset (index 0) is 0. |
|
Set the modified tag value. Only used by osg::Texture when using texture subloading. |
|
|
|
Height of image. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|