Public Types |
typedef std::vector< unsigned
int > | MipmapDataType |
Public Methods |
| 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 the 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.
|
void | setFileName (const std::string &fileName) |
const std::string & | getFileName () const |
void | allocateImage (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.
|
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.
|
const int | s () const |
| Width of image.
|
const int | t () const |
| Height of image.
|
const int | r () const |
| Depth of image.
|
void | setInternalTextureFormat (GLint internalFormat) |
const GLint | getInternalTextureFormat () const |
void | setPixelFormat (const GLenum format) |
const GLenum | getPixelFormat () const |
const GLenum | getDataType () const |
const unsigned int | getPacking () const |
const unsigned int | getPixelSizeInBits () const |
| return the numbers of bits required for each pixel.
|
const unsigned int | getRowSizeInBytes () const |
| return the numbers of bytes each row of pixels occupies once it has been packed.
|
const unsigned int | getImageSizeInBytes () const |
| return the numbers of bytes each image (_s*_t) of pixels occupies..
|
const unsigned int | getTotalSizeInBytes () const |
| return the numbers of bytes the whole row/image/volume of pixels occupies.
|
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 (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.
|
void | dirty () |
| Dirty the image, which increments the modified flag, to force osg::Texture to reload the image.
|
void | setModifiedTag (const unsigned int value) |
| Set the modified tag value, only used by osg::Texture when using texture subloading.
|
const unsigned int | getModifiedTag () const |
| Get modified tag value, only used by osg::Texture when using texture subloading.
|
bool | isMipmap () const |
unsigned int | getNumMipmapLevels () const |
void | setMipmapData (const MipmapDataType &mipmapDataVector) |
unsigned char * | getMipmapData (unsigned int mipmapNumber) const |
void | computeMipMaps () |
| converts a single image into mip mapped version image.
|
Static Public Methods |
const bool | isPackedType (GLenum type) |
const unsigned int | computeNumComponents (GLenum format) |
const unsigned int | computePixelSizeInBits (GLenum format, GLenum type) |
const unsigned int | computeRowWidthInBytes (int width, GLenum format, GLenum type, int packing) |
const unsigned int | computeNearestPowerOfTwo (unsigned int s, float bias=0.5f) |
Protected Methods |
virtual | ~Image () |
Image & | operator= (const Image &) |
Protected Attributes |
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 |