From f9f740d6b0ee350fa04f0c243e709eab173a3f6e Mon Sep 17 00:00:00 2001 From: kgv Date: Thu, 17 Nov 2016 15:39:52 +0300 Subject: [PATCH] 0028095: Draw Harness, ViewerTest - use RGBA format instead of BGRA within vreadpixel OpenGl_Workspace::BufferDump() now implicitly converts RGBA dump into requested BGR, BGRA and RGB image. DRAW command dversion is improved to report OpenGL variant used (desktop or ES); reporting of version of MSVC is corrected for VC14 and above; reporting of HAVE_OPENCL option is removed. Usage of command vdump is corrected in some tests to specify extension .png for an image file. Compiler warning is eliminated in OpenGl_Text.cxx (OpenGL ES mode only). --- src/Draw/Draw_BasicCommands.cxx | 12 +- src/Image/Image_PixMap.cxx | 70 +++++++ src/Image/Image_PixMap.hxx | 10 + src/OpenGl/OpenGl_Context.cxx | 6 +- src/OpenGl/OpenGl_Context.hxx | 3 +- src/OpenGl/OpenGl_Text.cxx | 1 + src/OpenGl/OpenGl_Workspace.cxx | 207 ++++++++++++------- src/V3d/V3d_View.cxx | 5 +- src/ViewerTest/ViewerTest.cxx | 10 +- src/ViewerTest/ViewerTest_ViewerCommands.cxx | 8 +- tests/bugs/vis/bug26147 | 2 +- tests/bugs/vis/bug26159 | 2 +- tests/bugs/vis/bug26413 | 2 +- tests/bugs/vis/bug26430 | 2 +- 14 files changed, 241 insertions(+), 99 deletions(-) diff --git a/src/Draw/Draw_BasicCommands.cxx b/src/Draw/Draw_BasicCommands.cxx index 7c9487db10..15b7a41be1 100644 --- a/src/Draw/Draw_BasicCommands.cxx +++ b/src/Draw/Draw_BasicCommands.cxx @@ -293,10 +293,10 @@ static Standard_Integer dversion(Draw_Interpretor& di, Standard_Integer, const c #else di << "FreeImage disabled\n"; #endif -#ifdef HAVE_OPENCL - di << "OpenCL enabled (HAVE_OPENCL)\n"; +#ifdef HAVE_GLES2 + di << "OpenGL: ES2\n"; #else - di << "OpenCL disabled\n"; + di << "OpenGL: desktop\n"; #endif #ifdef HAVE_VTK di << "VTK enabled (HAVE_VTK)\n"; @@ -323,7 +323,11 @@ static Standard_Integer dversion(Draw_Interpretor& di, Standard_Integer, const c #elif defined(__SUNPRO_C) di << "Compiler: Sun Studio (__SUNPRO_C = " << __SUNPROC_C << ")\n"; #elif defined(_MSC_VER) - di << "Compiler: MS Visual C++ " << (int)(_MSC_VER/100-6) << "." << (int)((_MSC_VER/10)-60-10*(int)(_MSC_VER/100-6)) << " (_MSC_FULL_VER = " << _MSC_FULL_VER << ")\n"; + #if _MSC_VER < 1900 + di << "Compiler: MS Visual C++ " << (int)(_MSC_VER/100-6) << "." << (int)((_MSC_VER/10)-60-10*(int)(_MSC_VER/100-6)) << " (_MSC_FULL_VER = " << _MSC_FULL_VER << ")\n"; + #else + di << "Compiler: MS Visual C++ " << (int)(_MSC_VER/100-5) << "." << (int)((_MSC_VER/10)-50-10*(int)(_MSC_VER/100-5)) << " (_MSC_FULL_VER = " << _MSC_FULL_VER << ")\n"; + #endif #elif defined(__GNUC__) di << "Compiler: GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__ << "\n"; #else diff --git a/src/Image/Image_PixMap.cxx b/src/Image/Image_PixMap.cxx index 6731430678..362c154a25 100644 --- a/src/Image/Image_PixMap.cxx +++ b/src/Image/Image_PixMap.cxx @@ -338,3 +338,73 @@ Quantity_Color Image_PixMap::PixelColor (const Standard_Integer theX, theAlpha = 0.0; // transparent return Quantity_Color (0.0, 0.0, 0.0, Quantity_TOC_RGB); } + +// ======================================================================= +// function : SwapRgbaBgra +// purpose : +// ======================================================================= +bool Image_PixMap::SwapRgbaBgra (Image_PixMap& theImage) +{ + switch (theImage.Format()) + { + case Image_PixMap::ImgBGR32: + case Image_PixMap::ImgRGB32: + case Image_PixMap::ImgBGRA: + case Image_PixMap::ImgRGBA: + { + const bool toResetAlpha = theImage.Format() == Image_PixMap::ImgBGR32 + || theImage.Format() == Image_PixMap::ImgRGB32; + for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow) + { + for (Standard_Size aCol = 0; aCol < theImage.SizeX(); ++aCol) + { + Image_ColorRGBA& aPixel = theImage.ChangeValue (aRow, aCol); + Image_ColorBGRA aPixelCopy = theImage.Value (aRow, aCol); + aPixel.r() = aPixelCopy.r(); + aPixel.g() = aPixelCopy.g(); + aPixel.b() = aPixelCopy.b(); + if (toResetAlpha) + { + aPixel.a() = 255; + } + } + } + return true; + } + case Image_PixMap::ImgBGR: + case Image_PixMap::ImgRGB: + { + for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow) + { + for (Standard_Size aCol = 0; aCol < theImage.SizeX(); ++aCol) + { + Image_ColorRGB& aPixel = theImage.ChangeValue (aRow, aCol); + Image_ColorBGR aPixelCopy = theImage.Value (aRow, aCol); + aPixel.r() = aPixelCopy.r(); + aPixel.g() = aPixelCopy.g(); + aPixel.b() = aPixelCopy.b(); + } + } + return true; + } + case Image_PixMap::ImgBGRF: + case Image_PixMap::ImgRGBF: + case Image_PixMap::ImgBGRAF: + case Image_PixMap::ImgRGBAF: + { + for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow) + { + for (Standard_Size aCol = 0; aCol < theImage.SizeX(); ++aCol) + { + Image_ColorRGBF& aPixel = theImage.ChangeValue (aRow, aCol); + Image_ColorBGRF aPixelCopy = theImage.Value (aRow, aCol); + aPixel.r() = aPixelCopy.r(); + aPixel.g() = aPixelCopy.g(); + aPixel.b() = aPixelCopy.b(); + } + } + return true; + } + default: return false; + } +} diff --git a/src/Image/Image_PixMap.hxx b/src/Image/Image_PixMap.hxx index 6cfb505771..e5c7830c07 100644 --- a/src/Image/Image_PixMap.hxx +++ b/src/Image/Image_PixMap.hxx @@ -53,6 +53,16 @@ public: return !aUnion.myChar[0]; } + //! Auxiliary method for swapping bytes between RGB and BGR formats. + //! This method modifies the image data but does not change pixel format! + //! Method will fail if pixel format is not one of the following: + //! - ImgRGB32 / ImgBGR32 + //! - ImgRGBA / ImgBGRA + //! - ImgRGB / ImgBGR + //! - ImgRGBF / ImgBGRF + //! - ImgRGBAF / ImgBGRAF + Standard_EXPORT static bool SwapRgbaBgra (Image_PixMap& theImage); + public: // high-level API inline ImgFormat Format() const diff --git a/src/OpenGl/OpenGl_Context.cxx b/src/OpenGl/OpenGl_Context.cxx index bc7ecf8bb8..dc9d63a396 100644 --- a/src/OpenGl/OpenGl_Context.cxx +++ b/src/OpenGl/OpenGl_Context.cxx @@ -812,17 +812,18 @@ Standard_Boolean OpenGl_Context::Init (const Aspect_Drawable theWindow, // function : ResetErrors // purpose : // ======================================================================= -void OpenGl_Context::ResetErrors (const bool theToPrintErrors) +bool OpenGl_Context::ResetErrors (const bool theToPrintErrors) { int aPrevErr = 0; int anErr = ::glGetError(); + const bool hasError = anErr != GL_NO_ERROR; if (!theToPrintErrors) { for (; anErr != GL_NO_ERROR && aPrevErr != anErr; aPrevErr = anErr, anErr = ::glGetError()) { // } - return; + return hasError; } for (; anErr != GL_NO_ERROR && aPrevErr != anErr; aPrevErr = anErr, anErr = ::glGetError()) @@ -849,6 +850,7 @@ void OpenGl_Context::ResetErrors (const bool theToPrintErrors) const TCollection_ExtendedString aMsg = TCollection_ExtendedString ("Unhandled GL error: ") + anErrId; PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, 0, GL_DEBUG_SEVERITY_LOW, aMsg); } + return hasError; } // ======================================================================= diff --git a/src/OpenGl/OpenGl_Context.hxx b/src/OpenGl/OpenGl_Context.hxx index 1533183f78..3374d15123 100644 --- a/src/OpenGl/OpenGl_Context.hxx +++ b/src/OpenGl/OpenGl_Context.hxx @@ -318,7 +318,8 @@ public: const OpenGl_GlFunctions* Functions() const { return myFuncs.operator->(); } //! Clean up errors stack for this GL context (glGetError() in loop). - Standard_EXPORT void ResetErrors (const bool theToPrintErrors = false); + //! @return true if some error has been cleared + Standard_EXPORT bool ResetErrors (const bool theToPrintErrors = false); //! This method uses system-dependent API to retrieve information //! about GL context bound to the current thread. diff --git a/src/OpenGl/OpenGl_Text.cxx b/src/OpenGl/OpenGl_Text.cxx index 4a5d65f511..0f6b591f77 100644 --- a/src/OpenGl/OpenGl_Text.cxx +++ b/src/OpenGl/OpenGl_Text.cxx @@ -115,6 +115,7 @@ namespace char aPsFont[64]; getGL2PSFontName (theAspect.Aspect()->Font().ToCString(), aPsFont); + (void)theIs2d; #if !defined(GL_ES_VERSION_2_0) if (theIs2d) { diff --git a/src/OpenGl/OpenGl_Workspace.cxx b/src/OpenGl/OpenGl_Workspace.cxx index 3e23c00524..ce8a751ed0 100644 --- a/src/OpenGl/OpenGl_Workspace.cxx +++ b/src/OpenGl/OpenGl_Workspace.cxx @@ -33,6 +33,7 @@ #include #include +#include IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Workspace,Standard_Transient) IMPLEMENT_STANDARD_RTTIEXT(OpenGl_RaytraceFilter,OpenGl_RenderFilter) @@ -1012,76 +1013,6 @@ void OpenGl_Workspace::FBORelease (Handle(OpenGl_FrameBuffer)& theFbo) theFbo.Nullify(); } -inline bool getDataFormat (const Image_PixMap& theData, - GLenum& thePixelFormat, - GLenum& theDataType) -{ - thePixelFormat = GL_RGB; - theDataType = GL_UNSIGNED_BYTE; - switch (theData.Format()) - { - #if !defined(GL_ES_VERSION_2_0) - case Image_PixMap::ImgGray: - thePixelFormat = GL_DEPTH_COMPONENT; - theDataType = GL_UNSIGNED_BYTE; - return true; - case Image_PixMap::ImgGrayF: - thePixelFormat = GL_DEPTH_COMPONENT; - theDataType = GL_FLOAT; - return true; - case Image_PixMap::ImgBGR: - thePixelFormat = GL_BGR; - theDataType = GL_UNSIGNED_BYTE; - return true; - case Image_PixMap::ImgBGRA: - case Image_PixMap::ImgBGR32: - thePixelFormat = GL_BGRA; - theDataType = GL_UNSIGNED_BYTE; - return true; - case Image_PixMap::ImgBGRF: - thePixelFormat = GL_BGR; - theDataType = GL_FLOAT; - return true; - case Image_PixMap::ImgBGRAF: - thePixelFormat = GL_BGRA; - theDataType = GL_FLOAT; - return true; - #else - case Image_PixMap::ImgGray: - case Image_PixMap::ImgGrayF: - case Image_PixMap::ImgBGR: - case Image_PixMap::ImgBGRA: - case Image_PixMap::ImgBGR32: - case Image_PixMap::ImgBGRF: - case Image_PixMap::ImgBGRAF: - return false; - #endif - case Image_PixMap::ImgRGB: - thePixelFormat = GL_RGB; - theDataType = GL_UNSIGNED_BYTE; - return true; - case Image_PixMap::ImgRGBA: - case Image_PixMap::ImgRGB32: - thePixelFormat = GL_RGBA; - theDataType = GL_UNSIGNED_BYTE; - return true; - case Image_PixMap::ImgRGBF: - thePixelFormat = GL_RGB; - theDataType = GL_FLOAT; - return true; - case Image_PixMap::ImgRGBAF: - thePixelFormat = GL_RGBA; - theDataType = GL_FLOAT; - return true; - case Image_PixMap::ImgAlpha: - case Image_PixMap::ImgAlphaF: - return false; // GL_ALPHA is no more supported in core context - case Image_PixMap::ImgUNKNOWN: - return false; - } - return false; -} - // ======================================================================= // function : getAligned // purpose : @@ -1092,6 +1023,21 @@ inline Standard_Size getAligned (const Standard_Size theNumber, return theNumber + theAlignment - 1 - (theNumber - 1) % theAlignment; } +template +inline void convertRowFromRgba (T* theRgbRow, + const Image_ColorRGBA* theRgbaRow, + const Standard_Size theWidth) +{ + for (Standard_Size aCol = 0; aCol < theWidth; ++aCol) + { + const Image_ColorRGBA& anRgba = theRgbaRow[aCol]; + T& anRgb = theRgbRow[aCol]; + anRgb.r() = anRgba.r(); + anRgb.g() = anRgba.g(); + anRgb.b() = anRgba.b(); + } +} + // ======================================================================= // function : BufferDump // purpose : @@ -1100,13 +1046,92 @@ Standard_Boolean OpenGl_Workspace::BufferDump (const Handle(OpenGl_FrameBuffer)& Image_PixMap& theImage, const Graphic3d_BufferType& theBufferType) { - GLenum aFormat, aType; if (theImage.IsEmpty() - || !getDataFormat (theImage, aFormat, aType) - || !Activate()) + || !Activate()) { return Standard_False; } + + GLenum aFormat = 0; + GLenum aType = 0; + bool toSwapRgbaBgra = false; + bool toConvRgba2Rgb = false; + switch (theImage.Format()) + { + #if !defined(GL_ES_VERSION_2_0) + case Image_PixMap::ImgGray: + aFormat = GL_DEPTH_COMPONENT; + aType = GL_UNSIGNED_BYTE; + break; + case Image_PixMap::ImgGrayF: + aFormat = GL_DEPTH_COMPONENT; + aType = GL_FLOAT; + break; + case Image_PixMap::ImgRGB: + aFormat = GL_RGB; + aType = GL_UNSIGNED_BYTE; + break; + case Image_PixMap::ImgBGR: + aFormat = GL_BGR; + aType = GL_UNSIGNED_BYTE; + break; + case Image_PixMap::ImgBGRA: + case Image_PixMap::ImgBGR32: + aFormat = GL_BGRA; + aType = GL_UNSIGNED_BYTE; + break; + case Image_PixMap::ImgBGRF: + aFormat = GL_BGR; + aType = GL_FLOAT; + break; + case Image_PixMap::ImgBGRAF: + aFormat = GL_BGRA; + aType = GL_FLOAT; + break; + #else + case Image_PixMap::ImgGray: + case Image_PixMap::ImgGrayF: + case Image_PixMap::ImgBGRF: + case Image_PixMap::ImgBGRAF: + return Standard_False; + case Image_PixMap::ImgBGRA: + case Image_PixMap::ImgBGR32: + aFormat = GL_RGBA; + aType = GL_UNSIGNED_BYTE; + toSwapRgbaBgra = true; + break; + case Image_PixMap::ImgBGR: + case Image_PixMap::ImgRGB: + aFormat = GL_RGBA; + aType = GL_UNSIGNED_BYTE; + toConvRgba2Rgb = true; + break; + #endif + case Image_PixMap::ImgRGBA: + case Image_PixMap::ImgRGB32: + aFormat = GL_RGBA; + aType = GL_UNSIGNED_BYTE; + break; + case Image_PixMap::ImgRGBF: + aFormat = GL_RGB; + aType = GL_FLOAT; + break; + case Image_PixMap::ImgRGBAF: + aFormat = GL_RGBA; + aType = GL_FLOAT; + break; + case Image_PixMap::ImgAlpha: + case Image_PixMap::ImgAlphaF: + return Standard_False; // GL_ALPHA is no more supported in core context + case Image_PixMap::ImgUNKNOWN: + return Standard_False; + } + + if (aFormat == 0) + { + return Standard_False; + } + #if !defined(GL_ES_VERSION_2_0) GLint aReadBufferPrev = GL_BACK; if (theBufferType == Graphic3d_BT_Depth @@ -1158,8 +1183,33 @@ Standard_Boolean OpenGl_Workspace::BufferDump (const Handle(OpenGl_FrameBuffer)& isBatchCopy = false; } #endif + if (toConvRgba2Rgb) + { + Handle(NCollection_BaseAllocator) anAlloc = new NCollection_AlignedAllocator (16); + const Standard_Size aRowSize = theImage.SizeX() * 4; + NCollection_Buffer aRowBuffer (anAlloc); + if (!aRowBuffer.Allocate (aRowSize)) + { + return Standard_False; + } - if (!isBatchCopy) + for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow) + { + // Image_PixMap rows indexation always starts from the upper corner + // while order in memory depends on the flag and processed by ChangeRow() method + glReadPixels (0, GLint(theImage.SizeY() - aRow - 1), GLsizei (theImage.SizeX()), 1, aFormat, aType, aRowBuffer.ChangeData()); + const Image_ColorRGBA* aRowDataRgba = (const Image_ColorRGBA* )aRowBuffer.Data(); + if (theImage.Format() == Image_PixMap::ImgBGR) + { + convertRowFromRgba ((Image_ColorBGR* )theImage.ChangeRow (aRow), aRowDataRgba, theImage.SizeX()); + } + else + { + convertRowFromRgba ((Image_ColorRGB* )theImage.ChangeRow (aRow), aRowDataRgba, theImage.SizeX()); + } + } + } + else if (!isBatchCopy) { // copy row by row for (Standard_Size aRow = 0; aRow < theImage.SizeY(); ++aRow) @@ -1173,6 +1223,7 @@ Standard_Boolean OpenGl_Workspace::BufferDump (const Handle(OpenGl_FrameBuffer)& { glReadPixels (0, 0, GLsizei (theImage.SizeX()), GLsizei (theImage.SizeY()), aFormat, aType, theImage.ChangeData()); } + const bool hasErrors = myGlContext->ResetErrors (true); glPixelStorei (GL_PACK_ALIGNMENT, 1); #if !defined(GL_ES_VERSION_2_0) @@ -1189,7 +1240,13 @@ Standard_Boolean OpenGl_Workspace::BufferDump (const Handle(OpenGl_FrameBuffer)& glReadBuffer (aReadBufferPrev); #endif } - return Standard_True; + + if (toSwapRgbaBgra) + { + Image_PixMap::SwapRgbaBgra (theImage); + } + + return !hasErrors; } // ======================================================================= diff --git a/src/V3d/V3d_View.cxx b/src/V3d/V3d_View.cxx index c6b4104cd8..ed2f10cc23 100644 --- a/src/V3d/V3d_View.cxx +++ b/src/V3d/V3d_View.cxx @@ -2826,12 +2826,11 @@ Standard_Boolean V3d_View::ToPixMap (Image_PixMap& theImage, || theImage.SizeX() != Standard_Size(aTargetSize.x()) || theImage.SizeY() != Standard_Size(aTargetSize.y())) { - const bool isBigEndian = Image_PixMap::IsBigEndianHost(); Image_PixMap::ImgFormat aFormat = Image_PixMap::ImgUNKNOWN; switch (theParams.BufferType) { - case Graphic3d_BT_RGB: aFormat = isBigEndian ? Image_PixMap::ImgRGB : Image_PixMap::ImgBGR; break; - case Graphic3d_BT_RGBA: aFormat = isBigEndian ? Image_PixMap::ImgRGBA : Image_PixMap::ImgBGRA; break; + case Graphic3d_BT_RGB: aFormat = Image_PixMap::ImgRGB; break; + case Graphic3d_BT_RGBA: aFormat = Image_PixMap::ImgRGBA; break; case Graphic3d_BT_Depth: aFormat = Image_PixMap::ImgGrayF; break; } diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index c49692c2bc..f31e19cfb1 100644 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -924,13 +924,11 @@ static Standard_Integer VDump (Draw_Interpretor& theDI, } Image_AlienPixMap aPixMap; - - bool isBigEndian = Image_PixMap::IsBigEndianHost(); Image_PixMap::ImgFormat aFormat = Image_PixMap::ImgUNKNOWN; switch (aParams.BufferType) { - case Graphic3d_BT_RGB: aFormat = isBigEndian ? Image_PixMap::ImgRGB : Image_PixMap::ImgBGR; break; - case Graphic3d_BT_RGBA: aFormat = isBigEndian ? Image_PixMap::ImgRGBA : Image_PixMap::ImgBGRA; break; + case Graphic3d_BT_RGB: aFormat = Image_PixMap::ImgRGB; break; + case Graphic3d_BT_RGBA: aFormat = Image_PixMap::ImgRGBA; break; case Graphic3d_BT_Depth: aFormat = Image_PixMap::ImgGrayF; break; } @@ -985,9 +983,9 @@ static Standard_Integer VDump (Draw_Interpretor& theDI, } Image_PixMap aPixMapL, aPixMapR; - aPixMapL.InitWrapper (aFormat, aPixMap.ChangeData(), + aPixMapL.InitWrapper (aPixMap.Format(), aPixMap.ChangeData(), aParams.Width, aParams.Height, aPixMap.SizeRowBytes()); - aPixMapR.InitWrapper (aFormat, aPixMap.ChangeData() + aPixMap.SizeRowBytes() * aParams.Height, + aPixMapR.InitWrapper (aPixMap.Format(), aPixMap.ChangeData() + aPixMap.SizeRowBytes() * aParams.Height, aParams.Width, aParams.Height, aPixMap.SizeRowBytes()); aParams.StereoOptions = V3d_SDO_LEFT_EYE; diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index bde733626d..a50ffc7ad2 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -5736,7 +5736,7 @@ static int VReadPixel (Draw_Interpretor& theDI, return 1; } - Image_PixMap::ImgFormat aFormat = Image_PixMap::IsBigEndianHost() ? Image_PixMap::ImgRGBA : Image_PixMap::ImgBGRA; + Image_PixMap::ImgFormat aFormat = Image_PixMap::ImgRGBA; Graphic3d_BufferType aBufferType = Graphic3d_BT_RGBA; Standard_Integer aWidth, aHeight; @@ -5756,12 +5756,12 @@ static int VReadPixel (Draw_Interpretor& theDI, const char* aParam = theArgVec[anIter]; if ( strcasecmp( aParam, "rgb" ) == 0 ) { - aFormat = Image_PixMap::IsBigEndianHost() ? Image_PixMap::ImgRGB : Image_PixMap::ImgBGR; + aFormat = Image_PixMap::ImgRGB; aBufferType = Graphic3d_BT_RGB; } else if ( strcasecmp( aParam, "hls" ) == 0 ) { - aFormat = Image_PixMap::IsBigEndianHost() ? Image_PixMap::ImgRGB : Image_PixMap::ImgBGR; + aFormat = Image_PixMap::ImgRGB; aBufferType = Graphic3d_BT_RGB; toShowHls = Standard_True; } @@ -5772,7 +5772,7 @@ static int VReadPixel (Draw_Interpretor& theDI, } else if ( strcasecmp( aParam, "rgba" ) == 0 ) { - aFormat = Image_PixMap::IsBigEndianHost() ? Image_PixMap::ImgRGBA : Image_PixMap::ImgBGRA; + aFormat = Image_PixMap::ImgRGBA; aBufferType = Graphic3d_BT_RGBA; } else if ( strcasecmp( aParam, "rgbaf" ) == 0 ) diff --git a/tests/bugs/vis/bug26147 b/tests/bugs/vis/bug26147 index 4a92b18224..7f6cefd754 100644 --- a/tests/bugs/vis/bug26147 +++ b/tests/bugs/vis/bug26147 @@ -57,4 +57,4 @@ if {$aNbSelected4 != 13} { puts "ERROR: Wrong number of entities in vertice-edge-face shift selection with overlap allowed!" } -vdump $imagedir/${casename} +vdump $imagedir/${casename}.png diff --git a/tests/bugs/vis/bug26159 b/tests/bugs/vis/bug26159 index 4f149dcdd5..3f15900adb 100644 --- a/tests/bugs/vis/bug26159 +++ b/tests/bugs/vis/bug26159 @@ -20,4 +20,4 @@ checkcolor 58 324 0 1 1 # to print tolerance in case of failure: puts [vselprops -print] -vdump $imagedir/${casename} +vdump $imagedir/${casename}.png diff --git a/tests/bugs/vis/bug26413 b/tests/bugs/vis/bug26413 index 50773e17c4..d321f66fa7 100644 --- a/tests/bugs/vis/bug26413 +++ b/tests/bugs/vis/bug26413 @@ -77,4 +77,4 @@ vmoveto ${x_tol} ${y_tol} checkcolor ${x_on_edge} ${y_on_edge} 1 1 0 checkcolor $x_on_vert $y_on_vert 0 1 1 -vdump ${imagedir}/${casename} +vdump ${imagedir}/${casename}.png diff --git a/tests/bugs/vis/bug26430 b/tests/bugs/vis/bug26430 index 9c1c8fbb0f..07f875e116 100644 --- a/tests/bugs/vis/bug26430 +++ b/tests/bugs/vis/bug26430 @@ -43,4 +43,4 @@ if {$aNbSelected != 14} { puts "ERROR: Vertex was not selected!" } -vdump ${imagedir}/${casename} +vdump ${imagedir}/${casename}.png