From 73cffacf098fcc667985cecace8232e6fa316f70 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 11 Mar 2009 17:57:33 +0000 Subject: [PATCH] Added docs on getPixelAspectRatio and corrected usage of getPixelAspection in osgmovie.cpp --- examples/osgmovie/osgmovie.cpp | 4 ++-- include/osg/Image | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/osgmovie/osgmovie.cpp b/examples/osgmovie/osgmovie.cpp index 369cc34a5..10ccaf62b 100644 --- a/examples/osgmovie/osgmovie.cpp +++ b/examples/osgmovie/osgmovie.cpp @@ -526,8 +526,8 @@ int main(int argc, char** argv) { osg::notify(osg::NOTICE)<<"image->s()"<s()<<" image-t()="<t()<<" aspectRatio="<getPixelAspectRatio()<s(); - float height = image->t() * image->getPixelAspectRatio(); + float width = image->s() * image->getPixelAspectRatio(); + float height = image->t(); osg::ref_ptr drawable = myCreateTexturedQuadGeometry(pos, width, height,image, useTextureRectangle, xyPlane, flip); diff --git a/include/osg/Image b/include/osg/Image index f82a9a01d..07b81a297 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -186,7 +186,10 @@ class OSG_EXPORT Image : public Object void setPacking(unsigned int packing) { _packing = packing; } inline unsigned int getPacking() const { return _packing; } + /** Set the pixel aspect ratio, defined as the pixel width divided by the pixel height.*/ inline void setPixelAspectRatio(float pixelAspectRatio) { _pixelAspectRatio = pixelAspectRatio; } + + /** Get the pixel aspect ratio.*/ inline float getPixelAspectRatio() const { return _pixelAspectRatio; } /** Return the number of bits required for each pixel. */