1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-01 17:36:21 +03:00

0032579: Draw Harness, ViewerTest - extend vbackground -cubemap syntax to configure sRGB flag

Command vbackground has been refactored to simplify logic and relax syntax.
Added -srgb argument to vbackground and vtexture commands.
This commit is contained in:
kgv 2021-09-22 00:18:35 +03:00 committed by smoskvin
parent c983176406
commit c585f731eb
4 changed files with 493 additions and 1316 deletions

View File

@ -4147,6 +4147,7 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb,
}
int toModulate = -1;
int toSetSRgb = -1;
bool toSetFilter = false;
bool toSetAniso = false;
bool toSetTrsfAngle = false;
@ -4305,15 +4306,15 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb,
Message::SendFail() << "Syntax error: unexpected argument '" << aName << "'";
return 1;
}
else if (aNameCase == "-modulate")
else if (aNameCase == "-modulate"
|| aNameCase == "-nomodulate")
{
bool toModulateBool = true;
if (anArgIter + 1 < theArgsNb
&& Draw::ParseOnOff (theArgVec[anArgIter + 1], toModulateBool))
{
++anArgIter;
}
toModulate = toModulateBool ? 1 : 0;
toModulate = Draw::ParseOnOffNoIterator (theArgsNb, theArgVec, anArgIter) ? 1 : 0;
}
else if (aNameCase == "-srgb"
|| aNameCase == "-nosrgb")
{
toSetSRgb = Draw::ParseOnOffNoIterator (theArgsNb, theArgVec, anArgIter) ? 1 : 0;
}
else if ((aNameCase == "-setfilter"
|| aNameCase == "-filter")
@ -4637,6 +4638,10 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb,
{
aTexturedIO->Attributes()->ShadingAspect()->Aspect()->TextureMap()->GetParams()->SetModulate (toModulate == 1);
}
if (toSetSRgb != -1)
{
aTexturedIO->Attributes()->ShadingAspect()->Aspect()->TextureMap()->SetColorMap (toSetSRgb == 1);
}
if (toSetTrsfAngle)
{
aTexturedIO->Attributes()->ShadingAspect()->Aspect()->TextureMap()->GetParams()->SetRotation (aTrsfRotAngle); // takes degrees
@ -6818,7 +6823,7 @@ void ViewerTest::Commands(Draw_Interpretor& theCommands)
"\n\t\t: [-tex0 Image0] [-tex1 Image1] [...]"
"\n\t\t: [-origin {u v|off}] [-scale {u v|off}] [-repeat {u v|off}]"
"\n\t\t: [-trsfTrans du dv] [-trsfScale su sv] [-trsfAngle Angle]"
"\n\t\t: [-modulate {on|off}]"
"\n\t\t: [-modulate {on|off}] [-srgb {on|off}]=on"
"\n\t\t: [-setFilter {nearest|bilinear|trilinear}]"
"\n\t\t: [-setAnisoFilter {off|low|middle|quality}]"
"\n\t\t: [-default]"
@ -6829,6 +6834,7 @@ void ViewerTest::Commands(Draw_Interpretor& theCommands)
"\n\t\t: -origin Setup texture origin for generating coordinates; (0, 0) by default"
"\n\t\t: -repeat Setup texture repeat for generating coordinates; (1, 1) by default"
"\n\t\t: -modulate Enable or disable texture color modulation"
"\n\t\t: -srgb Prefer sRGB texture format when applicable; TRUE by default"
"\n\t\t: -trsfAngle Setup dynamic texture coordinates transformation - rotation angle"
"\n\t\t: -trsfTrans Setup dynamic texture coordinates transformation - translation vector"
"\n\t\t: -trsfScale Setup dynamic texture coordinates transformation - scale vector"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
puts "================"
puts "0032579: Draw Harness, ViewerTest - extend vbackground -cubemap syntax to configure sRGB flag"
puts "================"
puts ""
pload VISUALIZATION
vcaps -noExtensions
vinit View1
vbackground -image [locate_data_file carrelage1.gif] -srgb 0
vdump $imagedir/${casename}_nosrgb.png
vbackground -image [locate_data_file carrelage1.gif] -srgb 1
vdump $imagedir/${casename}_srgb.png

View File

@ -1,5 +1,5 @@
#000 drivers
#001 background
001 background
#002 clipping
004 general
#005 geom