From d3cebab9a387842a7fe2431bc07f3d55d2607bbc Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 21 Oct 2011 10:59:42 +0000 Subject: [PATCH] Added flipDepth() method --- include/osg/Image | 6 ++++-- src/osg/Image.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) 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."<