From: jfa Date: Tue, 23 Mar 2021 16:01:25 +0000 (+0300) Subject: Porting to OCCT 7.5.0. Fix texture orientation. X-Git-Tag: V9_7_0a1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fa1f22d7d6632ec094aaeb7f16110b06cc325d2e;p=modules%2Fgui.git Porting to OCCT 7.5.0. Fix texture orientation. --- diff --git a/src/OCCViewer/OCCViewer_Utilities.cxx b/src/OCCViewer/OCCViewer_Utilities.cxx index fcb105e1b..d57f33785 100644 --- a/src/OCCViewer/OCCViewer_Utilities.cxx +++ b/src/OCCViewer/OCCViewer_Utilities.cxx @@ -27,6 +27,8 @@ #include "QtxActionToolMgr.h" #include "QtxMultiAction.h" +#include + // OCC includes #include #include @@ -44,8 +46,12 @@ Handle(Image_PixMap) OCCViewer_Utilities::imageToPixmap( const QImage& anImage ) aPixmap->SetTopDown( Standard_True ); 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);