X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FViewerTest%2FViewerTest_ViewerCommands.cxx;h=336ecbd3317b0fdf869c5c31ff0973b8d63401b6;hp=a53c8dcfa17385b394d603c503c3fa3d743baa0d;hb=9196ea9d5ad4190294cff17c67ccdfdba3ee6f1b;hpb=d537c5e67db84ec42326208ca373acd4261bf31d;ds=sidebyside diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index a53c8dcfa1..336ecbd331 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -7042,8 +7042,7 @@ static int VReadPixel (Draw_Interpretor& theDI, return 1; } - Standard_Boolean toShowName = Standard_False; - Standard_Boolean toShowHls = Standard_False; + bool toShowName = false, toShowHls = false, toShowHex = false; for (Standard_Integer anIter = 3; anIter < theArgNb; ++anIter) { TCollection_AsciiString aParam (theArgVec[anIter]); @@ -7090,9 +7089,15 @@ static int VReadPixel (Draw_Interpretor& theDI, { toShowName = Standard_True; } + else if (aParam == "-hex" + || aParam == "hex") + { + toShowHex = Standard_True; + } else { std::cout << "Syntax error at '" << aParam << "'\n"; + return 1; } } @@ -7130,6 +7135,17 @@ static int VReadPixel (Draw_Interpretor& theDI, theDI << Quantity_Color::StringName (aColor.GetRGB().Name()); } } + else if (toShowHex) + { + if (aBufferType == Graphic3d_BT_RGBA) + { + theDI << Quantity_ColorRGBA::ColorToHex (aColor); + } + else + { + theDI << Quantity_Color::ColorToHex (aColor.GetRGB()); + } + } else { switch (aBufferType) @@ -13900,7 +13916,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands) " with f option returns free memory in bytes", __FILE__, VMemGpu, group); theCommands.Add ("vreadpixel", - "vreadpixel xPixel yPixel [{rgb|rgba|depth|hls|rgbf|rgbaf}=rgba] [-name]" + "vreadpixel xPixel yPixel [{rgb|rgba|depth|hls|rgbf|rgbaf}=rgba] [-name|-hex]" " : Read pixel value for active view", __FILE__, VReadPixel, group); theCommands.Add("diffimage",