X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOCCViewer%2FOCCViewer_Utilities.cxx;h=506b9dc15f0e5e678cfd941d66046d07cf2c34ce;hb=9f3acb9230f025863cce18d4c865c1227ea97afc;hp=8ee02c3b1eb535028dd0b59b88fb829a23dacdbe;hpb=bf4f33e12f47caaa39edde16c7308e24ae7b515e;p=modules%2Fgui.git diff --git a/src/OCCViewer/OCCViewer_Utilities.cxx b/src/OCCViewer/OCCViewer_Utilities.cxx old mode 100755 new mode 100644 index 8ee02c3b1..506b9dc15 --- a/src/OCCViewer/OCCViewer_Utilities.cxx +++ b/src/OCCViewer/OCCViewer_Utilities.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2014-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,8 @@ #include "QtxActionToolMgr.h" #include "QtxMultiAction.h" +#include + // OCC includes #include #include @@ -41,11 +43,17 @@ Handle(Image_PixMap) OCCViewer_Utilities::imageToPixmap( const QImage& anImage ) Handle(Image_PixMap) aPixmap = new Image_PixMap(); if ( !anImage.isNull() ) { aPixmap->InitTrash( Image_PixMap::ImgBGRA, anImage.width(), anImage.height() ); +#if OCC_VERSION_LARGE < 0x07050000 aPixmap->SetTopDown( Standard_True ); +#endif const uchar* aImageBytes = anImage.bits(); - + +#if OCC_VERSION_LARGE < 0x07050000 for ( int aLine = anImage.height() - 1; aLine >= 0; --aLine ) { +#else + for ( int aLine = 0; aLine < anImage.height(); ++aLine ) { +#endif // convert pixels from ARGB to renderer-compatible RGBA for ( int aByte = 0; aByte < anImage.width(); ++aByte ) { Image_ColorBGRA& aPixmapBytes = aPixmap->ChangeValue(aLine, aByte); @@ -119,6 +127,8 @@ OCCViewer_ViewWindow::Mode2dType OCCViewer_Utilities::setViewer2DMode case OCCViewer_ViewWindow::YZPlane: aView3d->SetProj (V3d_Xpos); break; + default: + break; } }