Changeset 10600 for OpenSceneGraph/trunk/include/osg/Image
- Timestamp:
- 10/01/09 22:19:42 (4 years ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/Image (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/Image
r9913 r10600 62 62 63 63 /** Image class for encapsulating the storage texture image data. */ 64 class OSG_EXPORT Image : public Object64 class OSG_EXPORT Image : public BufferData 65 65 { 66 66 … … 77 77 virtual const char* libraryName() const { return "osg"; } 78 78 virtual const char* className() const { return "Image"; } 79 80 virtual const GLvoid* getDataPointer() const { return data(); } 81 virtual unsigned int getTotalDataSize() const { return getTotalSizeInBytesIncludingMipmaps(); } 79 82 80 83 /** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */ … … 253 256 */ 254 257 void ensureValidSizeForTexturing(GLint maxTextureSize); 255 256 /** Dirty the image, which increments the modified count, to force osg::Texture to reload the image. */257 inline void dirty() { ++_modifiedCount; if (_bufferObject.valid()) _bufferObject->dirty(); }258 259 /** Set the modified count value. Used by osg::Texture when using texture subloading. */260 inline void setModifiedCount(unsigned int value) { _modifiedCount=value; }261 262 /** Get modified count value. Used by osg::Texture when using texture subloading. */263 inline unsigned int getModifiedCount() const { return _modifiedCount; }264 265 258 266 259 static bool isPackedType(GLenum type); … … 317 310 318 311 /** Set the optional PixelBufferObject used to map the image memory efficiently to graphics memory. */ 319 void setPixelBufferObject(PixelBufferObject* buffer) { _bufferObject = buffer; if (_bufferObject.valid()) _bufferObject->setImage(this); }320 321 /** Get the PixelBufferObject.*/ 322 PixelBufferObject* getPixelBufferObject() { return _bufferObject.get(); }323 324 /** Get the const PixelBufferObject.*/ 325 const PixelBufferObject* getPixelBufferObject() const { return _bufferObject.get(); }312 void setPixelBufferObject(PixelBufferObject* buffer) { setBufferObject(buffer); } 313 314 /** Get the PixelBufferObject.*/ 315 PixelBufferObject* getPixelBufferObject() { return dynamic_cast<PixelBufferObject*>(_bufferObject.get()); } 316 317 /** Get the const PixelBufferObject.*/ 318 const PixelBufferObject* getPixelBufferObject() const { return dynamic_cast<const PixelBufferObject*>(_bufferObject.get()); } 326 319 327 virtual void update(NodeVisitor* /*nv*/) {} 320 virtual void update(NodeVisitor* /*nv*/) {} 328 321 329 322 /** method for sending pointer events to images that are acting as front ends to interactive surfaces such as a vnc or browser window. Return true if handled. */ … … 361 354 362 355 void setData(unsigned char* data,AllocationMode allocationMode); 363 364 unsigned int _modifiedCount;365 356 366 357 MipmapDataType _mipmapData;
