diff --git a/include/osg/Image b/include/osg/Image index cb099feea..95f9351b7 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -282,12 +282,14 @@ class OSG_EXPORT Image : public BufferData Vec4 getColor(const Vec3& texcoord) const; - /** Flip the image horizontally. */ + /** Flip the image horizontally, around s dimension. */ void flipHorizontal(); - /** Flip the image vertically. */ + /** Flip the image vertically, around t dimension. */ void flipVertical(); + /** Flip the image around the r dimension. Only relevent for 3D textures. */ + void flipDepth(); /** Ensure image dimensions are a power of two. * Mipmapped textures require the image dimensions to be diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index 88f87c7b5..03376e63e 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -1181,6 +1181,39 @@ void Image::flipVertical() dirty(); } +void Image::flipDepth() +{ + if (_data==NULL) + { + OSG_WARN << "Error Image::flipVertical() do not succeed : cannot flip NULL image."<1) + { + OSG_WARN << "Error Image::flipVertical() do not succeed : flipping of mipmap 3d textures not yet supported."<