From fa1f22d7d6632ec094aaeb7f16110b06cc325d2e Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 23 Mar 2021 19:01:25 +0300 Subject: [PATCH] Porting to OCCT 7.5.0. Fix texture orientation. --- src/OCCViewer/OCCViewer_Utilities.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.39.2