1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

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).
This commit is contained in:
kgv
2016-11-17 15:39:52 +03:00
committed by apn
parent 564c82b4f2
commit f9f740d6b0
14 changed files with 241 additions and 99 deletions

View File

@@ -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;

View File

@@ -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 )