| [5328] | 1 | /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield |
|---|
| [1529] | 2 | * |
|---|
| 3 | * This library is open source and may be redistributed and/or modified under |
|---|
| 4 | * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or |
|---|
| 5 | * (at your option) any later version. The full license is in LICENSE file |
|---|
| 6 | * included with this distribution, and on the openscenegraph.org website. |
|---|
| 7 | * |
|---|
| 8 | * This library is distributed in the hope that it will be useful, |
|---|
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 11 | * OpenSceneGraph Public License for more details. |
|---|
| 12 | */ |
|---|
| [51] | 13 | |
|---|
| [2] | 14 | #ifndef OSG_IMAGE |
|---|
| 15 | #define OSG_IMAGE 1 |
|---|
| 16 | |
|---|
| [3819] | 17 | #include <osg/BufferObject> |
|---|
| [7581] | 18 | #include <osg/Vec2> |
|---|
| 19 | #include <osg/Vec3> |
|---|
| 20 | #include <osg/Vec4> |
|---|
| [8642] | 21 | #include <osg/FrameStamp> |
|---|
| [2] | 22 | |
|---|
| [8] | 23 | #include <string> |
|---|
| [616] | 24 | #include <vector> |
|---|
| [8] | 25 | |
|---|
| [1084] | 26 | #ifndef GL_VERSION_1_2 |
|---|
| [3405] | 27 | // 1.2 definitions... |
|---|
| [1084] | 28 | #define GL_BGR 0x80E0 |
|---|
| 29 | #define GL_BGRA 0x80E1 |
|---|
| 30 | #define GL_UNSIGNED_BYTE_3_3_2 0x8032 |
|---|
| 31 | #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 |
|---|
| 32 | #define GL_UNSIGNED_SHORT_5_6_5 0x8363 |
|---|
| 33 | #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 |
|---|
| 34 | #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 |
|---|
| 35 | #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 |
|---|
| 36 | #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 |
|---|
| 37 | #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 |
|---|
| 38 | #define GL_UNSIGNED_INT_8_8_8_8 0x8035 |
|---|
| 39 | #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 |
|---|
| 40 | #define GL_UNSIGNED_INT_10_10_10_2 0x8036 |
|---|
| 41 | #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 |
|---|
| 42 | #endif |
|---|
| 43 | |
|---|
| [3795] | 44 | #ifndef GL_COMPRESSED_ALPHA |
|---|
| 45 | #define GL_COMPRESSED_ALPHA 0x84E9 |
|---|
| 46 | #define GL_COMPRESSED_LUMINANCE 0x84EA |
|---|
| 47 | #define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB |
|---|
| 48 | #define GL_COMPRESSED_INTENSITY 0x84EC |
|---|
| 49 | #define GL_COMPRESSED_RGB 0x84ED |
|---|
| 50 | #define GL_COMPRESSED_RGBA 0x84EE |
|---|
| 51 | #endif |
|---|
| 52 | |
|---|
| [5650] | 53 | |
|---|
| [9317] | 54 | #ifndef GL_ABGR_EXT |
|---|
| 55 | #define GL_ABGR_EXT 0x8000 |
|---|
| 56 | #endif |
|---|
| 57 | |
|---|
| [2] | 58 | namespace osg { |
|---|
| 59 | |
|---|
| [8647] | 60 | // forward declare |
|---|
| 61 | class NodeVisitor; |
|---|
| 62 | |
|---|
| [3405] | 63 | /** Image class for encapsulating the storage texture image data. */ |
|---|
| [4021] | 64 | class OSG_EXPORT Image : public Object |
|---|
| [2] | 65 | { |
|---|
| 66 | |
|---|
| 67 | public : |
|---|
| 68 | |
|---|
| 69 | Image(); |
|---|
| [327] | 70 | |
|---|
| [3405] | 71 | /** Copy constructor using CopyOp to manage deep vs shallow copy. */ |
|---|
| [331] | 72 | Image(const Image& image,const CopyOp& copyop=CopyOp::SHALLOW_COPY); |
|---|
| [2] | 73 | |
|---|
| [1418] | 74 | virtual Object* cloneType() const { return new Image(); } |
|---|
| 75 | virtual Object* clone(const CopyOp& copyop) const { return new Image(*this,copyop); } |
|---|
| [8] | 76 | virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Image*>(obj)!=0; } |
|---|
| [740] | 77 | virtual const char* libraryName() const { return "osg"; } |
|---|
| [2] | 78 | virtual const char* className() const { return "Image"; } |
|---|
| 79 | |
|---|
| [3405] | 80 | /** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */ |
|---|
| [1676] | 81 | virtual int compare(const Image& rhs) const; |
|---|
| [2] | 82 | |
|---|
| [529] | 83 | void setFileName(const std::string& fileName); |
|---|
| [8] | 84 | inline const std::string& getFileName() const { return _fileName; } |
|---|
| [2] | 85 | |
|---|
| [8834] | 86 | enum WriteHint { |
|---|
| 87 | NO_PREFERENCE, |
|---|
| 88 | STORE_INLINE, |
|---|
| 89 | EXTERNAL_FILE |
|---|
| 90 | }; |
|---|
| 91 | |
|---|
| 92 | void setWriteHint(WriteHint writeHint) { _writeHint = writeHint; } |
|---|
| 93 | WriteHint getWriteHint() const { return _writeHint; } |
|---|
| 94 | |
|---|
| [1624] | 95 | enum AllocationMode { |
|---|
| 96 | NO_DELETE, |
|---|
| 97 | USE_NEW_DELETE, |
|---|
| 98 | USE_MALLOC_FREE |
|---|
| 99 | }; |
|---|
| 100 | |
|---|
| [3405] | 101 | /** Set the method used for deleting data once it goes out of scope. */ |
|---|
| [1624] | 102 | void setAllocationMode(AllocationMode mode) { _allocationMode = mode; } |
|---|
| 103 | |
|---|
| [3405] | 104 | /** Get the method used for deleting data once it goes out of scope. */ |
|---|
| [2319] | 105 | AllocationMode getAllocationMode() const { return _allocationMode; } |
|---|
| [1624] | 106 | |
|---|
| 107 | |
|---|
| [3405] | 108 | /** Allocate a pixel block of specified size and type. */ |
|---|
| [1088] | 109 | void allocateImage(int s,int t,int r, |
|---|
| [2308] | 110 | GLenum pixelFormat,GLenum type, |
|---|
| [1088] | 111 | int packing=1); |
|---|
| [521] | 112 | |
|---|
| 113 | |
|---|
| [4843] | 114 | /** Set the image dimensions, format and data. */ |
|---|
| [529] | 115 | void setImage(int s,int t,int r, |
|---|
| 116 | GLint internalTextureformat, |
|---|
| [2308] | 117 | GLenum pixelFormat,GLenum type, |
|---|
| [4297] | 118 | unsigned char* data, |
|---|
| [1624] | 119 | AllocationMode mode, |
|---|
| [529] | 120 | int packing=1); |
|---|
| [521] | 121 | |
|---|
| [3405] | 122 | /** Read pixels from current frame buffer at specified position and size, using glReadPixels. |
|---|
| 123 | * Create memory for storage if required, reuse existing pixel coords if possible. |
|---|
| [3779] | 124 | */ |
|---|
| [521] | 125 | void readPixels(int x,int y,int width,int height, |
|---|
| [2308] | 126 | GLenum pixelFormat,GLenum type); |
|---|
| [521] | 127 | |
|---|
| [2] | 128 | |
|---|
| [3405] | 129 | /** Read the contents of the current bound texture, handling compressed pixelFormats if present. |
|---|
| 130 | * Create memory for storage if required, reuse existing pixel coords if possible. |
|---|
| [3779] | 131 | */ |
|---|
| [5265] | 132 | void readImageFromCurrentTexture(unsigned int contextID, bool copyMipMapsIfAvailable, GLenum type = GL_UNSIGNED_BYTE); |
|---|
| [1794] | 133 | |
|---|
| 134 | |
|---|
| [529] | 135 | /** Scale image to specified size. */ |
|---|
| [2403] | 136 | void scaleImage(int s,int t,int r) { scaleImage(s,t,r, getDataType()); } |
|---|
| [529] | 137 | |
|---|
| [2403] | 138 | /** Scale image to specified size and with specified data type. */ |
|---|
| 139 | void scaleImage(int s,int t,int r, GLenum newDataType); |
|---|
| 140 | |
|---|
| [1088] | 141 | /** Copy a source Image into a subpart of this Image at specified position. |
|---|
| 142 | * Typically used to copy to an already allocated image, such as creating |
|---|
| 143 | * a 3D image from a stack 2D images. |
|---|
| [3405] | 144 | * If this Image is empty then image data is created to |
|---|
| 145 | * accomodate the source image in its offset position. |
|---|
| 146 | * If source is NULL then no operation happens, this Image is left unchanged. |
|---|
| [3779] | 147 | */ |
|---|
| [9643] | 148 | void copySubImage(int s_offset, int t_offset, int r_offset, const osg::Image* source); |
|---|
| [529] | 149 | |
|---|
| [6947] | 150 | |
|---|
| 151 | enum Origin |
|---|
| 152 | { |
|---|
| 153 | BOTTOM_LEFT, |
|---|
| 154 | TOP_LEFT |
|---|
| 155 | }; |
|---|
| 156 | |
|---|
| 157 | /** Set the origin of the image. |
|---|
| 158 | * The default value is BOTTOM_LEFT and is consistent with OpenGL. |
|---|
| 159 | * TOP_LEFT is used for imagery that follows standard Imagery convention, such as movies, |
|---|
| 160 | * and hasn't been flipped yet. For such images one much flip the t axis of the tex coords. |
|---|
| 161 | * to handle this origin position. */ |
|---|
| 162 | void setOrigin(Origin origin) { _origin = origin; } |
|---|
| 163 | |
|---|
| 164 | /** Get the origin of the image.*/ |
|---|
| 165 | Origin getOrigin() const { return _origin; } |
|---|
| 166 | |
|---|
| 167 | |
|---|
| [3405] | 168 | /** Width of image. */ |
|---|
| [1133] | 169 | inline int s() const { return _s; } |
|---|
| [529] | 170 | |
|---|
| [3405] | 171 | /** Height of image. */ |
|---|
| [1133] | 172 | inline int t() const { return _t; } |
|---|
| [529] | 173 | |
|---|
| [3405] | 174 | /** Depth of image. */ |
|---|
| [1133] | 175 | inline int r() const { return _r; } |
|---|
| [2] | 176 | |
|---|
| [577] | 177 | void setInternalTextureFormat(GLint internalFormat); |
|---|
| [1133] | 178 | inline GLint getInternalTextureFormat() const { return _internalTextureFormat; } |
|---|
| [521] | 179 | |
|---|
| [2308] | 180 | void setPixelFormat(GLenum pixelFormat); |
|---|
| [1133] | 181 | inline GLenum getPixelFormat() const { return _pixelFormat; } |
|---|
| [521] | 182 | |
|---|
| [5478] | 183 | void setDataType(GLenum dataType); |
|---|
| [1133] | 184 | inline GLenum getDataType() const { return _dataType; } |
|---|
| [521] | 185 | |
|---|
| [5478] | 186 | void setPacking(unsigned int packing) { _packing = packing; } |
|---|
| [1133] | 187 | inline unsigned int getPacking() const { return _packing; } |
|---|
| [2] | 188 | |
|---|
| [3405] | 189 | /** Return the number of bits required for each pixel. */ |
|---|
| [1133] | 190 | inline unsigned int getPixelSizeInBits() const { return computePixelSizeInBits(_pixelFormat,_dataType); } |
|---|
| [529] | 191 | |
|---|
| [3405] | 192 | /** Return the number of bytes each row of pixels occupies once it has been packed. */ |
|---|
| [1133] | 193 | inline unsigned int getRowSizeInBytes() const { return computeRowWidthInBytes(_s,_pixelFormat,_dataType,_packing); } |
|---|
| [529] | 194 | |
|---|
| [3405] | 195 | /** Return the number of bytes each image (_s*_t) of pixels occupies. */ |
|---|
| [1133] | 196 | inline unsigned int getImageSizeInBytes() const { return getRowSizeInBytes()*_t; } |
|---|
| [521] | 197 | |
|---|
| [3405] | 198 | /** Return the number of bytes the whole row/image/volume of pixels occupies. */ |
|---|
| [1133] | 199 | inline unsigned int getTotalSizeInBytes() const { return getImageSizeInBytes()*_r; } |
|---|
| [529] | 200 | |
|---|
| [3405] | 201 | /** Return the number of bytes the whole row/image/volume of pixels occupies, including all mip maps if included. */ |
|---|
| [1983] | 202 | unsigned int getTotalSizeInBytesIncludingMipmaps() const; |
|---|
| 203 | |
|---|
| [4080] | 204 | /** Return true if the Image represent a valid and usable imagery.*/ |
|---|
| 205 | bool valid() const { return _s!=0 && _t!=0 && _r!=0 && _data!=0 && _dataType!=0; } |
|---|
| 206 | |
|---|
| [3405] | 207 | /** Raw image data. */ |
|---|
| [4297] | 208 | inline unsigned char* data() { return _data; } |
|---|
| [2] | 209 | |
|---|
| [3405] | 210 | /** Raw const image data. */ |
|---|
| [4297] | 211 | inline const unsigned char* data() const { return _data; } |
|---|
| [8] | 212 | |
|---|
| [2] | 213 | |
|---|
| [1048] | 214 | inline unsigned char* data(int column, int row=0,int image=0) |
|---|
| [529] | 215 | { |
|---|
| 216 | if (!_data) return NULL; |
|---|
| [577] | 217 | return _data+(column*getPixelSizeInBits())/8+row*getRowSizeInBytes()+image*getImageSizeInBytes(); |
|---|
| [529] | 218 | } |
|---|
| [690] | 219 | |
|---|
| [3947] | 220 | inline const unsigned char* data(int column, int row=0,int image=0) const |
|---|
| [1048] | 221 | { |
|---|
| 222 | if (!_data) return NULL; |
|---|
| 223 | return _data+(column*getPixelSizeInBits())/8+row*getRowSizeInBytes()+image*getImageSizeInBytes(); |
|---|
| 224 | } |
|---|
| 225 | |
|---|
| [7581] | 226 | /** Get the color value for specified texcoord.*/ |
|---|
| 227 | Vec4 getColor(unsigned int s,unsigned t=0,unsigned r=0) const; |
|---|
| [3819] | 228 | |
|---|
| [7581] | 229 | /** Get the color value for specified texcoord.*/ |
|---|
| 230 | Vec4 getColor(const Vec2& texcoord) const { return getColor(Vec3(texcoord.x(),texcoord.y(),0.0f)); } |
|---|
| 231 | |
|---|
| 232 | /** Get the color value for specified texcoord.*/ |
|---|
| 233 | Vec4 getColor(const Vec3& texcoord) const; |
|---|
| 234 | |
|---|
| 235 | |
|---|
| [3405] | 236 | /** Flip the image horizontally. */ |
|---|
| [3289] | 237 | void flipHorizontal(); |
|---|
| [690] | 238 | |
|---|
| [3405] | 239 | /** Flip the image vertically. */ |
|---|
| [3289] | 240 | void flipVertical(); |
|---|
| [529] | 241 | |
|---|
| 242 | |
|---|
| [2] | 243 | /** Ensure image dimensions are a power of two. |
|---|
| [3405] | 244 | * Mipmapped textures require the image dimensions to be |
|---|
| [558] | 245 | * power of two and are within the maxiumum texture size for |
|---|
| [3405] | 246 | * the host machine. |
|---|
| [3779] | 247 | */ |
|---|
| [1155] | 248 | void ensureValidSizeForTexturing(GLint maxTextureSize); |
|---|
| [8] | 249 | |
|---|
| [3819] | 250 | /** Dirty the image, which increments the modified count, to force osg::Texture to reload the image. */ |
|---|
| [6574] | 251 | inline void dirty() { ++_modifiedCount; if (_bufferObject.valid()) _bufferObject->dirty(); } |
|---|
| [178] | 252 | |
|---|
| [3819] | 253 | /** Set the modified count value. Used by osg::Texture when using texture subloading. */ |
|---|
| 254 | inline void setModifiedCount(unsigned int value) { _modifiedCount=value; } |
|---|
| [178] | 255 | |
|---|
| [3819] | 256 | /** Get modified count value. Used by osg::Texture when using texture subloading. */ |
|---|
| 257 | inline unsigned int getModifiedCount() const { return _modifiedCount; } |
|---|
| [8] | 258 | |
|---|
| [529] | 259 | |
|---|
| [1133] | 260 | static bool isPackedType(GLenum type); |
|---|
| [5650] | 261 | static GLenum computePixelFormat(GLenum pixelFormat); |
|---|
| [9298] | 262 | static GLenum computeFormatDataType(GLenum pixelFormat); |
|---|
| [2308] | 263 | static unsigned int computeNumComponents(GLenum pixelFormat); |
|---|
| 264 | static unsigned int computePixelSizeInBits(GLenum pixelFormat,GLenum type); |
|---|
| 265 | static unsigned int computeRowWidthInBytes(int width,GLenum pixelFormat,GLenum type,int packing); |
|---|
| [1776] | 266 | static int computeNearestPowerOfTwo(int s,float bias=0.5f); |
|---|
| [7521] | 267 | static int computeNumberOfMipmapLevels(int s,int t = 1, int r = 1); |
|---|
| [1133] | 268 | |
|---|
| [3405] | 269 | /** Precomputed mipmaps stuff. */ |
|---|
| [624] | 270 | typedef std::vector< unsigned int > MipmapDataType; |
|---|
| [529] | 271 | |
|---|
| [616] | 272 | inline bool isMipmap() const {return !_mipmapData.empty();}; |
|---|
| [529] | 273 | |
|---|
| [1047] | 274 | unsigned int getNumMipmapLevels() const |
|---|
| [616] | 275 | { |
|---|
| [9599] | 276 | return static_cast<unsigned int>(_mipmapData.size())+1; |
|---|
| [616] | 277 | }; |
|---|
| 278 | |
|---|
| [3405] | 279 | /** Send offsets into data. It is assumed that first mipmap offset (index 0) is 0.*/ |
|---|
| [3755] | 280 | inline void setMipmapLevels(const MipmapDataType& mipmapDataVector) { _mipmapData = mipmapDataVector; } |
|---|
| [616] | 281 | |
|---|
| [3755] | 282 | inline const MipmapDataType& getMipmapLevels() const { return _mipmapData; } |
|---|
| 283 | |
|---|
| 284 | inline unsigned int getMipmapOffset(unsigned int mipmapLevel) const |
|---|
| [616] | 285 | { |
|---|
| [3755] | 286 | if(mipmapLevel == 0) |
|---|
| 287 | return 0; |
|---|
| 288 | else if (mipmapLevel < getNumMipmapLevels()) |
|---|
| 289 | return _mipmapData[mipmapLevel-1]; |
|---|
| 290 | return 0; |
|---|
| [616] | 291 | }; |
|---|
| [1047] | 292 | |
|---|
| [3755] | 293 | inline unsigned char* getMipmapData(unsigned int mipmapLevel) |
|---|
| [3779] | 294 | { |
|---|
| 295 | return _data+getMipmapOffset(mipmapLevel); |
|---|
| 296 | } |
|---|
| [3755] | 297 | |
|---|
| 298 | inline const unsigned char* getMipmapData(unsigned int mipmapLevel) const |
|---|
| [3779] | 299 | { |
|---|
| 300 | return _data+getMipmapOffset(mipmapLevel); |
|---|
| 301 | } |
|---|
| [9298] | 302 | |
|---|
| 303 | /*inline const unsigned char* getMipmapData(unsigned int row, unsigned int column, unsigned int mipmapLevel) const |
|---|
| 304 | { |
|---|
| 305 | if (!_data) return NULL; |
|---|
| 306 | return getMipmapData(mipmapLevel) + (column*getPixelSizeInBits())/8+row*getRowSizeInBytes(); |
|---|
| 307 | }*/ |
|---|
| 308 | |
|---|
| [3405] | 309 | /** Return true if this image is translucent - i.e. it has alpha values that are less 1.0 (when normalized). */ |
|---|
| [9888] | 310 | virtual bool isImageTranslucent() const; |
|---|
| [616] | 311 | |
|---|
| [3819] | 312 | /** Set the optional PixelBufferObject used to map the image memory efficiently to graphics memory. */ |
|---|
| 313 | void setPixelBufferObject(PixelBufferObject* buffer) { _bufferObject = buffer; if (_bufferObject.valid()) _bufferObject->setImage(this); } |
|---|
| 314 | |
|---|
| 315 | /** Get the PixelBufferObject.*/ |
|---|
| 316 | PixelBufferObject* getPixelBufferObject() { return _bufferObject.get(); } |
|---|
| 317 | |
|---|
| 318 | /** Get the const PixelBufferObject.*/ |
|---|
| 319 | const PixelBufferObject* getPixelBufferObject() const { return _bufferObject.get(); } |
|---|
| [8642] | 320 | |
|---|
| [9388] | 321 | virtual void update(NodeVisitor* /*nv*/) {} |
|---|
| [9088] | 322 | |
|---|
| [9319] | 323 | /** 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. */ |
|---|
| [9388] | 324 | virtual bool sendPointerEvent(int /*x*/, int /*y*/, int /*buttonMask*/) { return false; } |
|---|
| [9088] | 325 | |
|---|
| [9319] | 326 | /** method for sending key events to images that are acting as front ends to interactive surfaces such as a vnc or browser window. Return true if handled.*/ |
|---|
| [9388] | 327 | virtual bool sendKeyEvent(int /*key*/, bool /*keyDown*/) { return false; } |
|---|
| [9088] | 328 | |
|---|
| [9219] | 329 | /** method for passing frame information to the custom Image classes, to be called only when objects associated with imagery are not culled.*/ |
|---|
| [9388] | 330 | virtual void setFrameLastRendered(const osg::FrameStamp* /*frameStamp*/) {} |
|---|
| [9088] | 331 | |
|---|
| [2] | 332 | protected : |
|---|
| 333 | |
|---|
| 334 | virtual ~Image(); |
|---|
| 335 | |
|---|
| [341] | 336 | Image& operator = (const Image&) { return *this; } |
|---|
| [2] | 337 | |
|---|
| [8] | 338 | std::string _fileName; |
|---|
| [8834] | 339 | WriteHint _writeHint; |
|---|
| [1624] | 340 | |
|---|
| [8834] | 341 | |
|---|
| [6947] | 342 | Origin _origin; |
|---|
| 343 | |
|---|
| [2] | 344 | int _s, _t, _r; |
|---|
| [529] | 345 | GLint _internalTextureFormat; |
|---|
| 346 | GLenum _pixelFormat; |
|---|
| 347 | GLenum _dataType; |
|---|
| [2] | 348 | unsigned int _packing; |
|---|
| [1624] | 349 | |
|---|
| 350 | AllocationMode _allocationMode; |
|---|
| [4297] | 351 | unsigned char* _data; |
|---|
| [1624] | 352 | |
|---|
| 353 | void deallocateData(); |
|---|
| 354 | |
|---|
| [4297] | 355 | void setData(unsigned char* data,AllocationMode allocationMode); |
|---|
| [2] | 356 | |
|---|
| [3819] | 357 | unsigned int _modifiedCount; |
|---|
| [616] | 358 | |
|---|
| 359 | MipmapDataType _mipmapData; |
|---|
| [3819] | 360 | |
|---|
| 361 | ref_ptr<PixelBufferObject> _bufferObject; |
|---|
| [2] | 362 | }; |
|---|
| 363 | |
|---|
| 364 | class Geode; |
|---|
| 365 | |
|---|
| [3405] | 366 | /** Convenience function to be used by image loaders to generate a valid geode |
|---|
| 367 | * to return for readNode(). |
|---|
| 368 | * Use the image's s and t values to scale the dimensions of the image. |
|---|
| 369 | */ |
|---|
| [4021] | 370 | extern OSG_EXPORT Geode* createGeodeForImage(Image* image); |
|---|
| [3405] | 371 | /** Convenience function to be used by image loaders to generate a valid geode |
|---|
| 372 | * to return for readNode(). |
|---|
| 373 | * Use the specified s and t values to scale the dimensions of the image. |
|---|
| 374 | */ |
|---|
| [4021] | 375 | extern OSG_EXPORT Geode* createGeodeForImage(Image* image,float s,float t); |
|---|
| [2] | 376 | |
|---|
| [349] | 377 | } |
|---|
| [2] | 378 | |
|---|
| 379 | #endif // __SG_IMAGE_H |
|---|