From 454b474f37735ad3342efe65e1f8d61e3b466343 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 21 Nov 2003 16:30:59 +0000 Subject: [PATCH] From Stephan Huber, clean up of QTexture.cpp's scaling code and additions of handling of different extensions in ReaderWriterQT.cpp --- src/osgPlugins/quicktime/QTtexture.cpp | 10 ---------- src/osgPlugins/quicktime/ReaderWriterQT.cpp | 5 ++++- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/osgPlugins/quicktime/QTtexture.cpp b/src/osgPlugins/quicktime/QTtexture.cpp index 09b132ea0..ebec7d8dd 100644 --- a/src/osgPlugins/quicktime/QTtexture.cpp +++ b/src/osgPlugins/quicktime/QTtexture.cpp @@ -294,7 +294,6 @@ static unsigned char * LoadBufferFromImageFile ( FSSpec fsspecImage, GetGWorld (&origPort, &origDevice); // save onscreen graphics port // decompress (draw) to gworld and thus fill buffer -#ifdef NO_SCALING SetIdentityMatrix (&matrix); // set transform matrix to identity (basically pass through) TranslateMatrix ( &matrix, -X2Fix(0.5f * *pOrigImageWidth), -X2Fix(0.5f * *pOrigImageHeight)); @@ -302,16 +301,7 @@ static unsigned char * LoadBufferFromImageFile ( FSSpec fsspecImage, TranslateMatrix ( &matrix, X2Fix(0.5f * *pOrigImageWidth), X2Fix(0.5f * *pOrigImageHeight)); err = GraphicsImportSetMatrix(giComp, &matrix); // set our matrix as the importer matrix -#else - SetIdentityMatrix (&matrix); // set transform matrix to identity (basically pass thorugh) - - TranslateMatrix ( &matrix, -X2Fix(0.5f * *pOrigImageWidth), -X2Fix(0.5f * *pOrigImageHeight)); - ScaleMatrix (&matrix, X2Fix(1.0), X2Fix(-1.0), X2Fix (0.0), X2Fix (0.0)); - TranslateMatrix ( &matrix, X2Fix(0.5f * *pOrigImageWidth), X2Fix(0.5f * *pOrigImageHeight)); - - err = GraphicsImportSetMatrix(giComp, &matrix); // set our matrix as the importer matrix -#endif if (err == noErr) err = GraphicsImportSetGWorld (giComp, pGWorld, NULL); // set the destination of the importer component if (err == noErr) diff --git a/src/osgPlugins/quicktime/ReaderWriterQT.cpp b/src/osgPlugins/quicktime/ReaderWriterQT.cpp index 20349ca49..cd6a0f16c 100644 --- a/src/osgPlugins/quicktime/ReaderWriterQT.cpp +++ b/src/osgPlugins/quicktime/ReaderWriterQT.cpp @@ -35,7 +35,10 @@ class ReaderWriterQT : public osgDB::ReaderWriter osgDB::equalCaseInsensitive(extension,"jpeg") || osgDB::equalCaseInsensitive(extension,"tiff") || osgDB::equalCaseInsensitive(extension,"pict") || - osgDB::equalCaseInsensitive(extension,"gif") || + osgDB::equalCaseInsensitive(extension,"gif") || + osgDB::equalCaseInsensitive(extension,"png") || + osgDB::equalCaseInsensitive(extension,"pict") || + osgDB::equalCaseInsensitive(extension,"pct") || osgDB::equalCaseInsensitive(extension,"tga"); }