From 07f182cd545ffaa94848ec567f6d45383d4305b1 Mon Sep 17 00:00:00 2001 From: sotisbg Date: Fri, 24 Jul 2026 22:06:51 +0300 Subject: [PATCH 1/9] Add camera RAW file support via LibRaw - New rawimage module decodes RAW (CR2/NEF/ARW/DNG/RW2/...) to QImage via LibRaw - Integrate into IgramArea::openImage and the file-open dialogs - DFTFringe.pro: link LibRaw (static on Windows via LIBRAW_NODLL, -lraw elsewhere) - CI: build LibRaw 0.22.2 in build-windows.yml; add libraw-dev to linux workflows Co-Authored-By: Claude Opus 4.8 --- .github/workflows/build-linux-clazy.yml | 2 +- .github/workflows/build-linux.yml | 2 +- .github/workflows/build-windows.yml | 63 +++++++++++- BUILD_RAW_NOTES.md | 53 ++++++++++ DFTFringe.pro | 9 +- igramarea.cpp | 25 ++++- mainwindow.cpp | 4 + rawimage.cpp | 131 ++++++++++++++++++++++++ rawimage.h | 41 ++++++++ 9 files changed, 324 insertions(+), 6 deletions(-) create mode 100644 BUILD_RAW_NOTES.md create mode 100644 rawimage.cpp create mode 100644 rawimage.h diff --git a/.github/workflows/build-linux-clazy.yml b/.github/workflows/build-linux-clazy.yml index e4bed7ed..dbff8d1b 100644 --- a/.github/workflows/build-linux-clazy.yml +++ b/.github/workflows/build-linux-clazy.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - run: | sudo apt update - sudo apt install -y clazy apt-utils build-essential wget qt6-base-dev-tools qt6-declarative-dev qt6-multimedia-dev libqt6charts6-dev libqt6datavisualization6-dev libqt6svg6-dev libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libgl1-mesa-dev libglu1-mesa-dev + sudo apt install -y clazy apt-utils build-essential wget qt6-base-dev-tools qt6-declarative-dev qt6-multimedia-dev libqt6charts6-dev libqt6datavisualization6-dev libqt6svg6-dev libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libraw-dev libgl1-mesa-dev libglu1-mesa-dev wget -O qwt-${{env.QWT_version}}.zip https://sourceforge.net/projects/qwt/files/qwt/${{env.QWT_version}}/qwt-${{env.QWT_version}}.zip/download?use_mirror=pilotfiber 7z x qwt-${{env.QWT_version}}.zip cd qwt-${{env.QWT_version}} diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index b483b24f..f3556792 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/checkout@v4 - run: sudo apt update - - run: sudo apt install -y apt-utils build-essential wget qt6-base-dev-tools qt6-declarative-dev qt6-multimedia-dev libqt6charts6-dev libqt6datavisualization6-dev libqt6svg6-dev libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libgl1-mesa-dev libglu1-mesa-dev bear + - run: sudo apt install -y apt-utils build-essential wget qt6-base-dev-tools qt6-declarative-dev qt6-multimedia-dev libqt6charts6-dev libqt6datavisualization6-dev libqt6svg6-dev libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libraw-dev libgl1-mesa-dev libglu1-mesa-dev bear - run: wget -O qwt-${{env.QWT_version}}.zip https://sourceforge.net/projects/qwt/files/qwt/${{env.QWT_version}}/qwt-${{env.QWT_version}}.zip/download?use_mirror=pilotfiber - run: 7z x qwt-${{env.QWT_version}}.zip - run: cd qwt-${{env.QWT_version}} ; /usr/lib/qt6/bin/qmake diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index ae3cd0ef..466e6e4a 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -13,6 +13,7 @@ env: openCV_version: 4.12.0 QT_version: 6.8.3 lapack_version: 3.12.1 + libraw_version: 0.22.2 mingw_version: 1310 python_version: 3.13 @@ -232,9 +233,60 @@ jobs: if: steps.cache-lapack.outputs.cache-hit != 'true' run: cmake --build ./build_armadillo -j4 + build-libraw: + runs-on: windows-latest + needs: cache-mingw-from-QT + steps: + # this will restore/cache everything depending on cache hit/miss + - name: cache LibRaw + uses: actions/cache/@v4 + id: cache-libraw + with: + path: | + build_libraw\install\include\libraw\* + build_libraw\install\lib\libraw.a + key: ${{ runner.os }}-libraw-${{env.libraw_version}}-mingw${{env.mingw_version}} + + # all what follows is only run on cache miss + + # restore cached minGW + - uses: actions/cache/restore@v4 + if: steps.cache-libraw.outputs.cache-hit != 'true' + id: cache-minGW + with: + path: Tools + key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 + fail-on-cache-miss: true + - name: add minGW to path + if: steps.cache-libraw.outputs.cache-hit != 'true' + shell: bash + run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH + - name: install wget + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: choco install -y wget + - name: download LibRaw + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: wget -O LibRaw.tar.gz https://github.com/LibRaw/LibRaw/archive/refs/tags/${{env.libraw_version}}.tar.gz + # Extract in two steps: first gunzip to stdout, then untar from stdin. + # Must run in CMD because powershell corrupts pipes. + - name: extract archive + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: 7z x -so LibRaw.tar.gz | 7z x -si -ttar + shell: cmd + - name: build LibRaw static library + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: cd LibRaw-${{env.libraw_version}} ; mingw32-make -f Makefile.mingw library + - name: install LibRaw (headers + static lib) into build_libraw\install + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: | + mkdir -Force ".\build_libraw\install\include\libraw" | Out-Null + mkdir -Force ".\build_libraw\install\lib" | Out-Null + Copy-Item ".\LibRaw-${{env.libraw_version}}\libraw\*.h" -Destination ".\build_libraw\install\include\libraw" + Copy-Item ".\LibRaw-${{env.libraw_version}}\lib\libraw.a" -Destination ".\build_libraw\install\lib" + build-DFTFringe: runs-on: windows-latest - needs: [cache-mingw-from-QT, build-lapack-armadillo, build-QWT, build-openCV-with-QT] + needs: [cache-mingw-from-QT, build-lapack-armadillo, build-QWT, build-openCV-with-QT, build-libraw] steps: # because problem matcher will not work when chechout in a subfolder, @@ -282,6 +334,15 @@ jobs: qwt-${{env.QWT_version}}\lib\*.dll key: ${{ runner.os }}-QWT-${{env.QWT_version}}-mingw${{env.mingw_version}} fail-on-cache-miss: true + # restore cached LibRaw + - uses: actions/cache/restore@v4 + id: cache-libraw + with: + path: | + build_libraw\install\include\libraw\* + build_libraw\install\lib\libraw.a + key: ${{ runner.os }}-libraw-${{env.libraw_version}}-mingw${{env.mingw_version}} + fail-on-cache-miss: true # restore cached openCV and QT - uses: actions/cache/restore@v4 id: cache-openCV-QT diff --git a/BUILD_RAW_NOTES.md b/BUILD_RAW_NOTES.md new file mode 100644 index 00000000..2c8d422d --- /dev/null +++ b/BUILD_RAW_NOTES.md @@ -0,0 +1,53 @@ +# Компилиране на DFTFringe с RAW поддръжка (камерни файлове) + +Промените за четене на камерни RAW файлове (CR2/CR3/NEF/ARW/DNG/RW2 и др.) вече са +вградени в сорса. Този файл описва какво е нужно, за да се компилира на Windows. + +## Какво е променено +- `rawimage.h` / `rawimage.cpp` — нов модул, чете RAW чрез LibRaw → QImage. +- `igramarea.cpp` — `openImage()` разпознава RAW и го чете (вкл. distortion клона). +- `mainwindow.cpp` — RAW разширенията са добавени във файловите диалози. +- `DFTFringe.pro` — добавени са LibRaw include/lib и новите файлове. + +## Нужен toolchain (същият, с който е построен инсталираният релийз в C:\DFTFringe) +Инсталираният exe е Qt6 + MinGW-w64 (GCC, SEH) + OpenCV 4.12.0. + +1. **Qt6 с MinGW комплект** (Qt Online Installer) + модули: Qt Charts, Qt Data Visualization. + Дава `qmake`, `mingw32-make`, `g++`, Qt Creator. + +2. **Предварително построените зависимости**, които `DFTFringe.pro` (win32 секцията) + очаква като СЪСЕДНИ папки на сорса, т.е. в `D:\Pictures\Mirrors\`: + - `qwt-6.3.0` + - `build_armadillo` + - `build_openCV` (OpenCV 4.12.0, MinGW — libopencv_*4120) + - `build_lapack` + Тези липсват в момента. Взимат се от билд-настройката на DFTFringe проекта + (upstream repo-то документира/сваля точните версии). Без тях qmake няма да намери + пътищата в win32 секцията. + +3. **LibRaw** (НОВАТА зависимост), построена със същия MinGW, инсталирана в: + `D:\Pictures\Mirrors\build_libraw\install\` + - хедъри в `install\include\libraw\libraw.h` + - `install\bin\libraw.dll` + `libraw.dll.a` (import lib) + Ако я сложиш другаде — коригирай двата реда `libraw` в `DFTFringe.pro` (win32). + Най-лесно набавяне: MSYS2 `pacman -S mingw-w64-x86_64-libraw` (същия ABI) и копиране + на include/lib/dll, или билд от източник. + +## Компилиране +От Qt Creator: отвори `DFTFringe.pro`, избери MinGW kit-а, Build → Release. + +Или от команден ред (в среда с qmake/mingw в PATH): +``` +qmake DFTFringe.pro +mingw32-make release +``` + +## Пускане / разпространение +Копирай `libraw.dll` (и евентуалните ѝ зависимости) до новополучения `DFTFringe.exe`, +до вече наличните Qt6/OpenCV DLL-ове. Най-просто: сложи новия exe и `libraw.dll` в +`C:\DFTFringe\` (където са всички останали DLL-ове) и го пусни оттам. + +## Алтернатива без локална инсталация +DFTFringe upstream има GitHub Actions CI, който сам сглобява целия toolchain и +произвежда готов exe/инсталатор. Fork → приложи тези промени → добави LibRaw към CI +стъпката → push → свали построения артефакт. diff --git a/DFTFringe.pro b/DFTFringe.pro index e94e9cab..6f35e128 100644 --- a/DFTFringe.pro +++ b/DFTFringe.pro @@ -46,6 +46,8 @@ win32 { INCLUDEPATH += ..\qwt-6.3.0\src INCLUDEPATH += ..\build_armadillo\tmp\include INCLUDEPATH += ..\build_openCV\install\include + INCLUDEPATH += ..\build_libraw\install\include # LibRaw for camera RAW support + DEFINES += LIBRAW_NODLL # link LibRaw statically (no __declspec(dllimport)) LIBS += -L$$PWD\..\build_lapack\bin -llibblas LIBS += -L$$PWD\..\build_lapack\bin -lliblapack @@ -55,6 +57,7 @@ win32 { LIBS += -L$$PWD\..\build_openCV\install\x64\mingw\bin -llibopencv_highgui4120 LIBS += -L$$PWD\..\build_openCV\install\x64\mingw\bin -llibopencv_imgcodecs4120 LIBS += -L$$PWD\..\build_openCV\install\x64\mingw\bin -llibopencv_imgproc4120 + LIBS += -L$$PWD\..\build_libraw\install\lib -lraw # LibRaw (static) for camera RAW support LIBS += -ldbghelp # for SetUnhandledExceptionFilter LIBS += -lz # zip compression library needed for cnpy.cpp @@ -70,6 +73,7 @@ unix: !mac { INCLUDEPATH += /usr/include/opencv4 INCLUDEPATH += /usr/local/qwt-6.3.0/include + INCLUDEPATH += /usr/include/libraw QMAKE_RPATHDIR += /usr/local/qwt-6.3.0/lib @@ -82,6 +86,7 @@ unix: !mac { LIBS += -lopencv_imgcodecs LIBS += -lopencv_imgproc LIBS += -L/usr/local/qwt-6.3.0/lib -lqwt + LIBS += -lraw # LibRaw for camera RAW support LIBS += -lz # zip compression library needed for cnpy.cpp } @@ -114,7 +119,7 @@ macx { PKG_CONFIG_PATH = $$[QT_INSTALL_LIBS]/pkgconfig INCLUDEPATH += -I$$[QT_INSTALL_PLUGINS] LIBS += -L$$[QT_INSTALL_PLUGINS] - PKGCONFIG += armadillo opencv Qt5Qwt6 + PKGCONFIG += armadillo opencv Qt5Qwt6 libraw message(........QT_VERSION: $$[QT_VERSION]) message(.QT_INSTALL_PREFIX: $$[QT_INSTALL_PREFIX]) @@ -222,6 +227,7 @@ SOURCES += SingleApplication/singleapplication.cpp \ psiphasedisplay.cpp \ psitiltoptions.cpp \ punwrap.cpp \ + rawimage.cpp \ regionedittools.cpp \ rejectedwavefrontsdlg.cpp \ reportdlg.cpp \ @@ -344,6 +350,7 @@ HEADERS += bezier/bezier.h \ psiphasedisplay.h \ psitiltoptions.h \ punwrap.h \ + rawimage.h \ regionedittools.h \ rejectedwavefrontsdlg.h \ reportdlg.h \ diff --git a/igramarea.cpp b/igramarea.cpp index 9f05a970..b4fbc2b6 100644 --- a/igramarea.cpp +++ b/igramarea.cpp @@ -47,6 +47,7 @@ #include #include #include +#include "rawimage.h" QVBoxLayout *debugLayout = 0; @@ -989,7 +990,17 @@ bool IgramArea::openImage(const QString &fileName, bool showBoundary) QApplication::setOverrideCursor(Qt::WaitCursor); QImage loadedImage; - if (!loadedImage.load(fileName)) { + const bool isRaw = RawImage::isRawFile(fileName); + if (isRaw){ + QString rawErr; + loadedImage = RawImage::load(fileName, &rawErr); + if (loadedImage.isNull()){ + QMessageBox::warning(NULL,"","RAW image "+fileName + " could not be read.\n" + rawErr); + QApplication::restoreOverrideCursor(); + return false; + } + } + else if (!loadedImage.load(fileName)) { QMessageBox::warning(NULL,"","Image "+fileName + " could not be read."); QApplication::restoreOverrideCursor(); return false; @@ -999,7 +1010,17 @@ bool IgramArea::openImage(const QString &fileName, bool showBoundary) loadedImage = loadedImage.convertToFormat(QImage::Format_RGB888); if (Settings2::getInstance()->m_igram->m_removeDistortion){ - cv::Mat raw = cv::imread(fileName.toStdString().c_str()); + // cv::imread cannot decode camera RAW files, so for RAW inputs build the + // BGR matrix from the already decoded QImage instead. + cv::Mat raw; + if (isRaw){ + cv::Mat rgb(loadedImage.height(), loadedImage.width(), CV_8UC3, + (void*)loadedImage.bits(), loadedImage.bytesPerLine()); + cv::cvtColor(rgb, raw, cv::COLOR_RGB2BGR); + } + else { + raw = cv::imread(fileName.toStdString().c_str()); + } QStringList parms = Settings2::getInstance()->m_igram->m_lenseParms; cv::Mat camera = cv::Mat::zeros(3,3,CV_64FC1); cv::Mat distortion =cv::Mat::zeros(1,5, CV_64FC1); diff --git a/mainwindow.cpp b/mainwindow.cpp index 863bc7bc..8e769013 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -48,6 +48,7 @@ #include "utils.h" #include "colorchannel.h" #include "opencv2/opencv.hpp" +#include "rawimage.h" #include #include @@ -298,6 +299,8 @@ void MainWindow::importIgram() { QDir dir(dirPath); QStringList filters; filters << "*.png" << "*.jpg" << "*.jpeg" << "*.bmp" << "*.gif"; // Add more image formats if needed + for (const QString &e : RawImage::extensions()) // include camera RAW files + filters << ("*." + e); dir.setNameFilters(filters); dir.setFilter(QDir::Files | QDir::Readable); @@ -486,6 +489,7 @@ void MainWindow::on_actionLoad_Interferogram_triggered() // `qDebug() << dialog.nameFilters();` // manually added upper case and first char upper case const QStringList filters({"Image files (*.bmp *.dib *.BMP *.DIB *.Bmp *.Dib *.gif *.GIF *.Gif *.jpg *.jpeg *.jpe *.JPG *.JPEG *.JPE *.Jpg *.Jpeg *.Jpe*.png *.PNG *.Png*.svg *.SVG *.Svg*.svgz *.SVGZ *.Svgz*.ico *.ICO *.Ico*.pbm *.PBM *.Pbm*.pgm *.PGM *.Pgm*.ppm *.PPM *.Ppm*.xbm *.XBM *.Xbm*.xpm *.XPM *.Xpm)", + "Camera RAW files (" + RawImage::nameFilter() + ")", "Any files (*)" }); dialog.setNameFilters(filters); diff --git a/rawimage.cpp b/rawimage.cpp new file mode 100644 index 00000000..6429c21a --- /dev/null +++ b/rawimage.cpp @@ -0,0 +1,131 @@ +/****************************************************************************** +** +** RAW camera file support for DFTFringe. See rawimage.h. +** +** This file is part of DFTFringe and is distributed under the same GNU GPLv3 +** license as the rest of the project. +** +****************************************************************************/ +#include "rawimage.h" + +#include +#include + +namespace RawImage { + +QStringList extensions() +{ + // Common camera RAW extensions handled by LibRaw. + static const QStringList exts = { + "cr2", "cr3", "crw", // Canon + "nef", "nrw", // Nikon + "arw", "srf", "sr2", // Sony + "dng", // Adobe / generic + "raf", // Fujifilm + "rw2", // Panasonic + "orf", // Olympus + "pef", "ptx", // Pentax + "raw", "rwl", // Leica + "3fr", "fff", // Hasselblad + "mef", // Mamiya + "mos", "iiq", // Leaf / Phase One + "dcr", "kdc", // Kodak + "srw", // Samsung + "erf", // Epson + "x3f" // Sigma + }; + return exts; +} + +QString nameFilter() +{ + QStringList parts; + for (const QString &e : extensions()) { + parts << ("*." + e.toLower()); + parts << ("*." + e.toUpper()); + } + return parts.join(' '); +} + +bool isRawFile(const QString &fileName) +{ + const QString suffix = QFileInfo(fileName).suffix().toLower(); + return extensions().contains(suffix); +} + +QImage load(const QString &fileName, QString *errorMsg) +{ + auto fail = [&](const QString &msg) -> QImage { + if (errorMsg) + *errorMsg = msg; + return QImage(); + }; + + LibRaw raw; + + // Processing parameters chosen to preserve fringe contrast: + // - 8 bit output so it maps straight onto the existing 8 bit pipeline + // - sRGB output colour space + // - camera white balance for a neutral looking image + // - no automatic brightness stretch, which could clip bright fringes + raw.imgdata.params.output_bps = 8; + raw.imgdata.params.output_color = 1; // sRGB + raw.imgdata.params.use_camera_wb = 1; + raw.imgdata.params.no_auto_bright = 1; + + int ret = raw.open_file(fileName.toLocal8Bit().constData()); + if (ret != LIBRAW_SUCCESS) + return fail(QStringLiteral("LibRaw open_file failed: ") + libraw_strerror(ret)); + + ret = raw.unpack(); + if (ret != LIBRAW_SUCCESS) { + raw.recycle(); + return fail(QStringLiteral("LibRaw unpack failed: ") + libraw_strerror(ret)); + } + + ret = raw.dcraw_process(); + if (ret != LIBRAW_SUCCESS) { + raw.recycle(); + return fail(QStringLiteral("LibRaw dcraw_process failed: ") + libraw_strerror(ret)); + } + + int errc = 0; + libraw_processed_image_t *proc = raw.dcraw_make_mem_image(&errc); + if (proc == nullptr || errc != LIBRAW_SUCCESS) { + if (proc) + LibRaw::dcraw_clear_mem(proc); + raw.recycle(); + return fail(QStringLiteral("LibRaw dcraw_make_mem_image failed: ") + + libraw_strerror(errc)); + } + + QImage result; + + if (proc->type == LIBRAW_IMAGE_BITMAP && proc->colors == 3 && proc->bits == 8) { + // Interleaved RGB, 8 bits per channel. QImage does not own the data, + // so copy() before proc is freed below. + QImage tmp(proc->data, proc->width, proc->height, + proc->width * 3, QImage::Format_RGB888); + result = tmp.copy(); + } + else if (proc->type == LIBRAW_IMAGE_JPEG) { + // Some cameras (e.g. Sigma X3F) hand back an embedded JPEG. + result = QImage::fromData(proc->data, proc->data_size, "JPEG"); + } + else { + LibRaw::dcraw_clear_mem(proc); + raw.recycle(); + return fail(QStringLiteral("Unsupported RAW image layout: colors=%1 bits=%2") + .arg(proc->colors).arg(proc->bits)); + } + + LibRaw::dcraw_clear_mem(proc); + raw.recycle(); + + if (result.isNull()) + return fail(QStringLiteral("Decoded RAW image was empty.")); + + return result; +} + +} // namespace RawImage diff --git a/rawimage.h b/rawimage.h new file mode 100644 index 00000000..d5b84612 --- /dev/null +++ b/rawimage.h @@ -0,0 +1,41 @@ +/****************************************************************************** +** +** RAW camera file support for DFTFringe. +** +** Reads camera RAW files (Canon CR2/CR3, Nikon NEF, Sony ARW, Adobe DNG, +** Panasonic RW2, etc.) using LibRaw and returns a demosaiced QImage that the +** rest of DFTFringe can treat exactly like a jpg/png/bmp interferogram. +** +** This file is part of DFTFringe and is distributed under the same GNU GPLv3 +** license as the rest of the project. +** +****************************************************************************/ +#ifndef RAWIMAGE_H +#define RAWIMAGE_H + +#include +#include +#include + +namespace RawImage { + +// Returns the list of supported RAW extensions, lower case, without the +// leading dot, e.g. {"cr2", "nef", "arw", "dng", ...}. +QStringList extensions(); + +// Returns a QFileDialog name-filter fragment containing every supported RAW +// extension in both lower and upper case, e.g. +// "*.cr2 *.CR2 *.nef *.NEF ..." +QString nameFilter(); + +// True if fileName has one of the RAW extensions above (case insensitive). +bool isRawFile(const QString &fileName); + +// Decodes a camera RAW file into an 8 bit RGB QImage (Format_RGB888). +// Returns a null QImage on failure; if errorMsg is non-null it receives a +// human readable description of the failure. +QImage load(const QString &fileName, QString *errorMsg = nullptr); + +} // namespace RawImage + +#endif // RAWIMAGE_H From 3db39aeecb02e26497111e532a817341f33db995 Mon Sep 17 00:00:00 2001 From: sotisbg Date: Sat, 25 Jul 2026 06:48:39 +0300 Subject: [PATCH 2/9] Fix Windows RAW builds: link ws2_32 and add LibRaw to QT5 The QT6 Windows build failed at link time with undefined references to htons/ntohs/htonl/ntohl. LibRaw uses these on Windows; they live in the Winsock library ws2_32, which was not linked. Add -lws2_32 (after -lraw) in DFTFringe.pro. The QT5 Windows build uses a separate DFTFringe_QT5.pro and workflow that had no RAW support at all, so it failed with undefined references to RawImage::* (rawimage.cpp was never compiled). Port the RAW wiring to QT5: - add rawimage.cpp/.h to DFTFringe_QT5.pro SOURCES/HEADERS - add LibRaw include path, LIBRAW_NODLL define, -lraw and -lws2_32 - add a build-libraw job (built with the QT5 mingw 8.1 toolchain) to build-windows-QT5.yml, wire it into build-DFTFringe needs, and restore the LibRaw cache before qmake Co-Authored-By: Claude Opus 4.8 --- .github/workflows/build-windows-QT5.yml | 63 ++++++++++++++++++++++++- DFTFringe.pro | 1 + DFTFringe_QT5.pro | 6 +++ 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-windows-QT5.yml b/.github/workflows/build-windows-QT5.yml index a64327b8..6f70841f 100644 --- a/.github/workflows/build-windows-QT5.yml +++ b/.github/workflows/build-windows-QT5.yml @@ -13,6 +13,7 @@ env: openCV_version: 4.6.0 QT_version: 5.15.2 lapack_version: 3.12.1 + libraw_version: 0.22.2 mingw_version: 810 python_version: 3.13 @@ -231,9 +232,60 @@ jobs: if: steps.cache-lapack.outputs.cache-hit != 'true' run: cmake --build ./build_armadillo -j4 + build-libraw: + runs-on: windows-latest + needs: cache-mingw-from-QT + steps: + # this will restore/cache everything depending on cache hit/miss + - name: cache LibRaw + uses: actions/cache/@v4 + id: cache-libraw + with: + path: | + build_libraw\install\include\libraw\* + build_libraw\install\lib\libraw.a + key: ${{ runner.os }}-libraw-${{env.libraw_version}}-mingw${{env.mingw_version}} + + # all what follows is only run on cache miss + + # restore cached minGW + - uses: actions/cache/restore@v4 + if: steps.cache-libraw.outputs.cache-hit != 'true' + id: cache-minGW + with: + path: Tools + key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 + fail-on-cache-miss: true + - name: add minGW to path + if: steps.cache-libraw.outputs.cache-hit != 'true' + shell: bash + run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH + - name: install wget + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: choco install -y wget + - name: download LibRaw + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: wget -O LibRaw.tar.gz https://github.com/LibRaw/LibRaw/archive/refs/tags/${{env.libraw_version}}.tar.gz + # Extract in two steps: first gunzip to stdout, then untar from stdin. + # Must run in CMD because powershell corrupts pipes. + - name: extract archive + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: 7z x -so LibRaw.tar.gz | 7z x -si -ttar + shell: cmd + - name: build LibRaw static library + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: cd LibRaw-${{env.libraw_version}} ; mingw32-make -f Makefile.mingw library + - name: install LibRaw (headers + static lib) into build_libraw\install + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: | + mkdir -Force ".\build_libraw\install\include\libraw" | Out-Null + mkdir -Force ".\build_libraw\install\lib" | Out-Null + Copy-Item ".\LibRaw-${{env.libraw_version}}\libraw\*.h" -Destination ".\build_libraw\install\include\libraw" + Copy-Item ".\LibRaw-${{env.libraw_version}}\lib\libraw.a" -Destination ".\build_libraw\install\lib" + build-DFTFringe: runs-on: windows-latest - needs: [cache-mingw-from-QT, build-lapack-armadillo, build-QWT, build-openCV-with-QT] + needs: [cache-mingw-from-QT, build-lapack-armadillo, build-QWT, build-openCV-with-QT, build-libraw] steps: # because problem matcher will not work when chechout in a subfolder, @@ -281,6 +333,15 @@ jobs: qwt-${{env.QWT_version}}\lib\*.dll key: ${{ runner.os }}-QWT-${{env.QWT_version}} fail-on-cache-miss: true + # restore cached LibRaw + - uses: actions/cache/restore@v4 + id: cache-libraw + with: + path: | + build_libraw\install\include\libraw\* + build_libraw\install\lib\libraw.a + key: ${{ runner.os }}-libraw-${{env.libraw_version}}-mingw${{env.mingw_version}} + fail-on-cache-miss: true # restore cached openCV and QT - uses: actions/cache/restore@v4 id: cache-openCV-QT diff --git a/DFTFringe.pro b/DFTFringe.pro index 6f35e128..0d8b41bf 100644 --- a/DFTFringe.pro +++ b/DFTFringe.pro @@ -58,6 +58,7 @@ win32 { LIBS += -L$$PWD\..\build_openCV\install\x64\mingw\bin -llibopencv_imgcodecs4120 LIBS += -L$$PWD\..\build_openCV\install\x64\mingw\bin -llibopencv_imgproc4120 LIBS += -L$$PWD\..\build_libraw\install\lib -lraw # LibRaw (static) for camera RAW support + LIBS += -lws2_32 # Winsock: LibRaw needs htons/ntohs/htonl/ntohl on Windows LIBS += -ldbghelp # for SetUnhandledExceptionFilter LIBS += -lz # zip compression library needed for cnpy.cpp diff --git a/DFTFringe_QT5.pro b/DFTFringe_QT5.pro index 65573323..6f1f6319 100644 --- a/DFTFringe_QT5.pro +++ b/DFTFringe_QT5.pro @@ -46,6 +46,8 @@ win32 { INCLUDEPATH += ..\qwt-6.1.6\src INCLUDEPATH += ..\build_armadillo\tmp\include INCLUDEPATH += ..\build_openCV\install\include + INCLUDEPATH += ..\build_libraw\install\include # LibRaw for camera RAW support + DEFINES += LIBRAW_NODLL # link LibRaw statically (no __declspec(dllimport)) LIBS += -L..\build_lapack\bin -llibblas LIBS += -L..\build_lapack\bin -lliblapack @@ -55,6 +57,8 @@ win32 { LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_highgui460 LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_imgcodecs460 LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_imgproc460 + LIBS += -L..\build_libraw\install\lib -lraw # LibRaw (static) for camera RAW support + LIBS += -lws2_32 # Winsock: LibRaw needs htons/ntohs/htonl/ntohl on Windows LIBS += -ldbghelp # for SetUnhandledExceptionFilter LIBS += -lz # zip compression library needed for cnpy.cpp @@ -221,6 +225,7 @@ SOURCES += SingleApplication/singleapplication.cpp \ psiphasedisplay.cpp \ psitiltoptions.cpp \ punwrap.cpp \ + rawimage.cpp \ regionedittools.cpp \ rejectedwavefrontsdlg.cpp \ reportdlg.cpp \ @@ -343,6 +348,7 @@ HEADERS += bezier/bezier.h \ psiphasedisplay.h \ psitiltoptions.h \ punwrap.h \ + rawimage.h \ regionedittools.h \ rejectedwavefrontsdlg.h \ reportdlg.h \ From a3a86c955d5c3b55b93f0c230fd81a75bc6a97b5 Mon Sep 17 00:00:00 2001 From: sotisbg Date: Sat, 25 Jul 2026 11:33:48 +0300 Subject: [PATCH 3/9] Fix version string in QT5 builds and enable tag-triggered releases The on-screen version showed the literal MY_AUTOMATED_VERSION_STRING because the CI replace step patched DFTFringe.pro while the QT5 workflow actually builds DFTFringe_QT5.pro. Patch DFTFringe_QT5.pro too so APP_VERSION embeds the real version. Also trigger the workflow on v* tags so tagged releases embed the tag name (e.g. v8.4.0-raw) as the displayed version, and add libraw-dev to the Linux QT5 build for RAW support. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/build-linux-QT5.yml | 2 +- .github/workflows/build-windows-QT5.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-linux-QT5.yml b/.github/workflows/build-linux-QT5.yml index bb82f26d..5b972ee9 100644 --- a/.github/workflows/build-linux-QT5.yml +++ b/.github/workflows/build-linux-QT5.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@v4 - run: sudo apt update - - run: sudo apt install -y apt-utils build-essential wget qt5-qmake qt5-qmake-bin qt5-assistant qtbase5-dev qtmultimedia5-dev libqt5charts5 libqt5charts5-dev libqt5multimedia* libqt5datavisualization5-dev libqt5datavisualization5 libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev + - run: sudo apt install -y apt-utils build-essential wget qt5-qmake qt5-qmake-bin qt5-assistant qtbase5-dev qtmultimedia5-dev libqt5charts5 libqt5charts5-dev libqt5multimedia* libqt5datavisualization5-dev libqt5datavisualization5 libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libraw-dev - run: qmake DFTFringe_QT5.pro #- uses: ammaraskar/gcc-problem-matcher@master #- run: echo "::add-matcher::.github/matcher/uic_matcher.json" diff --git a/.github/workflows/build-windows-QT5.yml b/.github/workflows/build-windows-QT5.yml index 6f70841f..98d1d090 100644 --- a/.github/workflows/build-windows-QT5.yml +++ b/.github/workflows/build-windows-QT5.yml @@ -3,6 +3,8 @@ on: push: branches: - master + tags: + - 'v*' pull_request: workflow_dispatch: workflow_call: @@ -387,6 +389,7 @@ jobs: (Get-Content DFTFringe/DFTFringeInstaller/config/config.xml).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringeInstaller/config/config.xml (Get-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml (Get-Content DFTFringe/DFTFringe.pro).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringe.pro + (Get-Content DFTFringe/DFTFringe_QT5.pro).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringe_QT5.pro - name: Put current date into a variable run: | $NOW=& Get-Date -format yyyy-MM-dd From 4d920a26ecdb141a1de8d53251fe4b467ae4d158 Mon Sep 17 00:00:00 2001 From: sotisbg Date: Sat, 25 Jul 2026 11:37:52 +0300 Subject: [PATCH 4/9] Also patch DFTFringe_QT5.pro version in QT6 release workflow make-release builds via build-windows.yml (QT6), whose qmake (no argument) picks up DFTFringe_QT5.pro. That file's version placeholder was never replaced, so the released installer displayed MY_AUTOMATED_VERSION_STRING on screen. Patch both .pro files. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/build-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 466e6e4a..db33220b 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -390,6 +390,7 @@ jobs: (Get-Content DFTFringe/DFTFringeInstaller/config/config.xml).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringeInstaller/config/config.xml (Get-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml (Get-Content DFTFringe/DFTFringe.pro).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringe.pro + (Get-Content DFTFringe/DFTFringe_QT5.pro).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringe_QT5.pro - name: Put current date into a variable run: | $NOW=& Get-Date -format yyyy-MM-dd From c3c553da00ce9099a0d1b2ccf166dc3b7279ca40 Mon Sep 17 00:00:00 2001 From: sotisbg Date: Sat, 25 Jul 2026 12:13:23 +0300 Subject: [PATCH 5/9] Build DFTFringe.pro explicitly in QT6 workflow With two .pro files present, bare `qmake` picked one ambiguously. Name DFTFringe.pro explicitly so the QT6 release build is deterministic. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index db33220b..65bd94c9 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -400,7 +400,7 @@ jobs: echo "${{env.NOW}}" (Get-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml).replace('MY_AUTOMATED_DATE_STRING', '${{env.NOW}}') | Set-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml - - run: cd DFTFringe ; ..\${{env.QT_version}}\mingw_64\bin\qmake.exe + - run: cd DFTFringe ; ..\${{env.QT_version}}\mingw_64\bin\qmake.exe DFTFringe.pro - run: echo "::add-matcher::.github/matcher/uic_matcher.json" - run: cd DFTFringe ; mingw32-make -j4 - run: echo "::remove-matcher owner=uic-problem-matcher::" From 1a5e52d31a7c2368675a18ae50b7d0b501dd4345 Mon Sep 17 00:00:00 2001 From: sotisbg Date: Sat, 25 Jul 2026 12:14:24 +0300 Subject: [PATCH 6/9] Drop QT5 build line: keep only the QT6 installer The release installer is built solely via the QT6 workflow. Remove the duplicate DFTFringe_QT5.pro and its QT5 windows/linux workflows, and the now-obsolete QT5 version-patch line in build-windows.yml. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/build-linux-QT5.yml | 26 -- .github/workflows/build-windows-QT5.yml | 441 ------------------- .github/workflows/build-windows.yml | 1 - DFTFringe_QT5.pro | 562 ------------------------ 4 files changed, 1030 deletions(-) delete mode 100644 .github/workflows/build-linux-QT5.yml delete mode 100644 .github/workflows/build-windows-QT5.yml delete mode 100644 DFTFringe_QT5.pro diff --git a/.github/workflows/build-linux-QT5.yml b/.github/workflows/build-linux-QT5.yml deleted file mode 100644 index 5b972ee9..00000000 --- a/.github/workflows/build-linux-QT5.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: build-linux-QT5 -on: - push: - branches: - - master - pull_request: - workflow_dispatch: - workflow_call: - -jobs: - build-linux-QT5: - strategy: - fail-fast: false - matrix: - os: [ubuntu-24.04] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - run: sudo apt update - - run: sudo apt install -y apt-utils build-essential wget qt5-qmake qt5-qmake-bin qt5-assistant qtbase5-dev qtmultimedia5-dev libqt5charts5 libqt5charts5-dev libqt5multimedia* libqt5datavisualization5-dev libqt5datavisualization5 libopencv-core-dev libopencv-dev libqwt-qt5-6 libqwt-qt5-dev libarmadillo-dev libraw-dev - - run: qmake DFTFringe_QT5.pro - #- uses: ammaraskar/gcc-problem-matcher@master - #- run: echo "::add-matcher::.github/matcher/uic_matcher.json" - - run: make -j4 - #- run: echo "::remove-matcher owner=uic-problem-matcher::" - diff --git a/.github/workflows/build-windows-QT5.yml b/.github/workflows/build-windows-QT5.yml deleted file mode 100644 index 98d1d090..00000000 --- a/.github/workflows/build-windows-QT5.yml +++ /dev/null @@ -1,441 +0,0 @@ -name: build-windows-QT5 -on: - push: - branches: - - master - tags: - - 'v*' - pull_request: - workflow_dispatch: - workflow_call: - -env: - armadillo_version: 15.2.2 - QWT_version: 6.1.6 - openCV_version: 4.6.0 - QT_version: 5.15.2 - lapack_version: 3.12.1 - libraw_version: 0.22.2 - mingw_version: 810 - python_version: 3.13 - -jobs: - cache-mingw-from-QT: - runs-on: windows-latest - steps: - # this will restore/cache everything in /Tools depending on cache hit/miss - - name: Cache minGW - id: cache-minGW - uses: actions/cache@v4 - with: - path: Tools - key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 - - # all what follows is only run on cache miss - - name: install newer python - if: steps.cache-minGW.outputs.cache-hit != 'true' - uses: actions/setup-python@v5 - with: - python-version: ${{env.python_version}} - - name: install aqtinstall tool - if: steps.cache-minGW.outputs.cache-hit != 'true' - run: pip install aqtinstall - - name: install correct minGW version - if: steps.cache-minGW.outputs.cache-hit != 'true' - run: aqt install-tool windows desktop tools_mingw qt.tools.win64_mingw${{env.mingw_version}} - # path is Tools\mingw${{env.mingw_version}}_64\bin\ - - name: install QT installer framework - if: steps.cache-minGW.outputs.cache-hit != 'true' - run: aqt install-tool windows desktop tools_ifw - # path is Tools\QtInstallerFramework\4.7\bin\ - - build-openCV-with-QT: - runs-on: windows-latest - needs: cache-mingw-from-QT - steps: - # this will restore/cache everything depending on cache hit/miss - - name: Cache QT and openCV - uses: actions/cache/@v4 - id: cache-openCV-QT - with: - path: | - build_openCV\install\x64\mingw\bin\*.dll - build_openCV\install\include\* - ${{env.QT_version}}\mingw81_64\bin\* - ${{env.QT_version}}\mingw81_64\include\* - ${{env.QT_version}}\mingw81_64\lib\* - ${{env.QT_version}}\mingw81_64\mkspecs\* - ${{env.QT_version}}\mingw81_64\plugins\platforms\* - ${{env.QT_version}}\mingw81_64\plugins\imageformats\* - key: ${{ runner.os }}-openCV-${{env.openCV_version}}-QT-${{env.QT_version}} - - # all what follows is only run on cache miss - - # restore cached minGW - - uses: actions/cache/restore@v4 - if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - id: cache-minGW - with: - path: Tools - key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 - fail-on-cache-miss: true - - name: install newer python - if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - uses: actions/setup-python@v5 - with: - python-version: ${{env.python_version}} - - name: add minGW to path - if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - shell: bash - run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH - - name: install aqtinstall tool - if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - run: pip install aqtinstall - - name: install QT - if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - run: aqt install-qt windows desktop ${{env.QT_version}} win64_mingw81 -m qtcharts qtdatavis3d - - uses: actions/checkout@v4 - if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - with: - repository: 'opencv/opencv' - ref: '${{env.openCV_version}}' - path: './openCV' - - name: cmake generate - if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - run: cmake -G "MinGW Makefiles" -S openCV -B build_openCV -D WITH_QT=ON -D WITH_OPENGL=ON -D Qt5_DIR=:./${{env.QT_version}}/mingw81_64/lib/cmake/Qt5 - - name: cmake generate again - if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - run: cmake -G "MinGW Makefiles" -S openCV -B build_openCV - - name: cmake build - if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - run: cmake --build ./build_openCV -j4 - - name: cmake install - if: steps.cache-openCV-QT.outputs.cache-hit != 'true' - run: cmake --install ./build_openCV - - build-QWT: - runs-on: windows-latest - needs: cache-mingw-from-QT - steps: - # this will restore/cache everything depending on cache hit/miss - - name: cache QWT - uses: actions/cache/@v4 - id: cache-QWT - with: - path: | - qwt-${{env.QWT_version}}\src - qwt-${{env.QWT_version}}\lib\*.dll - key: ${{ runner.os }}-QWT-${{env.QWT_version}} - - # all what follows is only run on cache miss - - # restore cached minGW - - uses: actions/cache/restore@v4 - if: steps.cache-QWT.outputs.cache-hit != 'true' - id: cache-minGW - with: - path: Tools - key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 - fail-on-cache-miss: true - - name: add minGW to path - if: steps.cache-QWT.outputs.cache-hit != 'true' - shell: bash - run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH - - name: install wget - if: steps.cache-QWT.outputs.cache-hit != 'true' - run: choco install -y wget - - name: download QWT - if: steps.cache-QWT.outputs.cache-hit != 'true' - # I specified the mirror because one of the random mirrors did not work during my tests - run: wget -O qwt-${{env.QWT_version}}.zip https://sourceforge.net/projects/qwt/files/qwt/${{env.QWT_version}}/qwt-${{env.QWT_version}}.zip/download?use_mirror=pilotfiber - - name: extract archive - if: steps.cache-QWT.outputs.cache-hit != 'true' - run: 7z x qwt-${{env.QWT_version}}.zip - - name: install newer python - if: steps.cache-QWT.outputs.cache-hit != 'true' - uses: actions/setup-python@v5 - with: - python-version: ${{env.python_version}} - - name: install aqtinstall tool - if: steps.cache-QWT.outputs.cache-hit != 'true' - run: pip install aqtinstall - - name: install qmake - if: steps.cache-QWT.outputs.cache-hit != 'true' - run: aqt install-qt windows desktop ${{env.QT_version}} win64_mingw81 --archives qtbase qtsvg - - name: qmake - if: steps.cache-QWT.outputs.cache-hit != 'true' - run: cd qwt-${{env.QWT_version}} ; ..\${{env.QT_version}}\mingw81_64\bin\qmake.exe - - name: build - if: steps.cache-QWT.outputs.cache-hit != 'true' - run: cd qwt-${{env.QWT_version}} ; mingw32-make -j4 - - build-lapack-armadillo: - runs-on: windows-latest - needs: cache-mingw-from-QT - steps: - # this will restore/cache everything depending on cache hit/miss - - name: Cache lapack build - id: cache-lapack - uses: actions/cache@v4 - with: - path: | - build_lapack\bin\liblapack.dll - build_lapack\bin\libblas.dll - build_armadillo\tmp\include - key: ${{ runner.os }}-lapack-${{env.lapack_version}}-armadillo-${{env.armadillo_version}} - - # all what follows is only run on cache miss - - # restore cached minGW - - uses: actions/cache/restore@v4 - if: steps.cache-lapack.outputs.cache-hit != 'true' - id: cache-minGW - with: - path: Tools - key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 - fail-on-cache-miss: true - - name: add minGW to path - if: steps.cache-lapack.outputs.cache-hit != 'true' - shell: bash - run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH - - uses: actions/checkout@v4 - if: steps.cache-lapack.outputs.cache-hit != 'true' - with: - repository: 'Reference-LAPACK/lapack' - ref: 'v${{env.lapack_version}}' - path: './lapack' - # See https://github.com/Reference-LAPACK/lapack/issues/305 : CMAKE_SHARED_LINKER_FLAGS is fixing a build issue - - name: cmake generate - if: steps.cache-lapack.outputs.cache-hit != 'true' - run: cmake -G "MinGW Makefiles" -S lapack -B build_lapack -D BUILD_SHARED_LIBS=ON -D CMAKE_SHARED_LINKER_FLAGS="-Wl,--allow-multiple-definition" - - name: cmake build - if: steps.cache-lapack.outputs.cache-hit != 'true' - run: cmake --build ./build_lapack -j4 - # now that Lapack is built, do the Armadillo build - - name: install wget - if: steps.cache-lapack.outputs.cache-hit != 'true' - run: choco install -y wget - - name: download armadillo - if: steps.cache-lapack.outputs.cache-hit != 'true' - # I specified the mirror because one of the random mirrors did not work during my tests - run: wget -O armadillo-${{env.armadillo_version}}.tar.xz http://sourceforge.net/projects/arma/files/armadillo-${{env.armadillo_version}}.tar.xz/download?use_mirror=versaweb - # Extract in two step. First step write to stdo and second step read from stdi. - # This avoids intermediate file creation - # It must run in CMD because powershell corrupts pipes - - name: extract archive - if: steps.cache-lapack.outputs.cache-hit != 'true' - run: 7z x -so armadillo-${{env.armadillo_version}}.tar.xz | 7z x -si -ttar - shell: cmd - # Armadillo relies on Lapack, it's important it knowns where it is during genration to be configured correctly - - name: cmake generate - if: steps.cache-lapack.outputs.cache-hit != 'true' - run: cmake -D CMAKE_PREFIX_PATH=${{github.workspace}}/build_lapack -G "MinGW Makefiles" -S armadillo-${{env.armadillo_version}} -B build_armadillo - - name: cmake build - if: steps.cache-lapack.outputs.cache-hit != 'true' - run: cmake --build ./build_armadillo -j4 - - build-libraw: - runs-on: windows-latest - needs: cache-mingw-from-QT - steps: - # this will restore/cache everything depending on cache hit/miss - - name: cache LibRaw - uses: actions/cache/@v4 - id: cache-libraw - with: - path: | - build_libraw\install\include\libraw\* - build_libraw\install\lib\libraw.a - key: ${{ runner.os }}-libraw-${{env.libraw_version}}-mingw${{env.mingw_version}} - - # all what follows is only run on cache miss - - # restore cached minGW - - uses: actions/cache/restore@v4 - if: steps.cache-libraw.outputs.cache-hit != 'true' - id: cache-minGW - with: - path: Tools - key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 - fail-on-cache-miss: true - - name: add minGW to path - if: steps.cache-libraw.outputs.cache-hit != 'true' - shell: bash - run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH - - name: install wget - if: steps.cache-libraw.outputs.cache-hit != 'true' - run: choco install -y wget - - name: download LibRaw - if: steps.cache-libraw.outputs.cache-hit != 'true' - run: wget -O LibRaw.tar.gz https://github.com/LibRaw/LibRaw/archive/refs/tags/${{env.libraw_version}}.tar.gz - # Extract in two steps: first gunzip to stdout, then untar from stdin. - # Must run in CMD because powershell corrupts pipes. - - name: extract archive - if: steps.cache-libraw.outputs.cache-hit != 'true' - run: 7z x -so LibRaw.tar.gz | 7z x -si -ttar - shell: cmd - - name: build LibRaw static library - if: steps.cache-libraw.outputs.cache-hit != 'true' - run: cd LibRaw-${{env.libraw_version}} ; mingw32-make -f Makefile.mingw library - - name: install LibRaw (headers + static lib) into build_libraw\install - if: steps.cache-libraw.outputs.cache-hit != 'true' - run: | - mkdir -Force ".\build_libraw\install\include\libraw" | Out-Null - mkdir -Force ".\build_libraw\install\lib" | Out-Null - Copy-Item ".\LibRaw-${{env.libraw_version}}\libraw\*.h" -Destination ".\build_libraw\install\include\libraw" - Copy-Item ".\LibRaw-${{env.libraw_version}}\lib\libraw.a" -Destination ".\build_libraw\install\lib" - - build-DFTFringe: - runs-on: windows-latest - needs: [cache-mingw-from-QT, build-lapack-armadillo, build-QWT, build-openCV-with-QT, build-libraw] - steps: - - # because problem matcher will not work when chechout in a subfolder, - # checkout at root and then copy everything in folder. - # Match will be done in build folder, and file at root will be used to link the match - # Note checkouting twice is not working. - # This copy is done before adding any more file into folders - - uses: actions/checkout@v4 - # with: - # path: 'DFTFringe' - - # copy all files for problem matcher to work - - name: copy files into build folder (problem matcher workaround) - run: | - mkdir ".\DFTFringe" - Copy-Item ".\*" -Destination ".\DFTFringe" -Exclude @("DFTFringe") -Recurse - - - # restore cached minGW - - uses: actions/cache/restore@v4 - id: cache-minGW - with: - path: Tools - key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 - fail-on-cache-miss: true - - name: add minGW to path - shell: bash - run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH - # restore cached lapack and armadillo - - uses: actions/cache/restore@v4 - id: cache-lapack - with: - path: | - build_lapack\bin\liblapack.dll - build_lapack\bin\libblas.dll - build_armadillo\tmp\include - key: ${{ runner.os }}-lapack-${{env.lapack_version}}-armadillo-${{env.armadillo_version}} - fail-on-cache-miss: true - # restore cached QWT - - uses: actions/cache/restore@v4 - id: cache-QWT - with: - path: | - qwt-${{env.QWT_version}}\src - qwt-${{env.QWT_version}}\lib\*.dll - key: ${{ runner.os }}-QWT-${{env.QWT_version}} - fail-on-cache-miss: true - # restore cached LibRaw - - uses: actions/cache/restore@v4 - id: cache-libraw - with: - path: | - build_libraw\install\include\libraw\* - build_libraw\install\lib\libraw.a - key: ${{ runner.os }}-libraw-${{env.libraw_version}}-mingw${{env.mingw_version}} - fail-on-cache-miss: true - # restore cached openCV and QT - - uses: actions/cache/restore@v4 - id: cache-openCV-QT - with: - path: | - build_openCV\install\x64\mingw\bin\*.dll - build_openCV\install\include\* - ${{env.QT_version}}\mingw81_64\bin\* - ${{env.QT_version}}\mingw81_64\include\* - ${{env.QT_version}}\mingw81_64\lib\* - ${{env.QT_version}}\mingw81_64\mkspecs\* - ${{env.QT_version}}\mingw81_64\plugins\platforms\* - ${{env.QT_version}}\mingw81_64\plugins\imageformats\* - key: ${{ runner.os }}-openCV-${{env.openCV_version}}-QT-${{env.QT_version}} - fail-on-cache-miss: true - - # this enables the problem matcher - #- uses: ammaraskar/gcc-problem-matcher@master - - # Update the 2 strings automatically - # MY_AUTOMATED_VERSION_STRING - # MY_AUTOMATED_DATE_STRING - - name: Put release name into a variable (pull request) - if: ${{ github.event_name == 'pull_request' }} - # suffix will be c18a74e0f4f4db36eddc66a68eb08e91cd6c6a1c_5108ce7c3ac60bec1e0867bb10c4497db67e3606 - # Because build is a merge commit, clearly identifies the PR commit and base commit - run: | - echo "WORKFLOW_VERSION=${{github.event.pull_request.head.sha}}_${{github.event.pull_request.base.sha}}" >> $env:GITHUB_ENV - - name: Put release name into a variable (tag) - if: ${{ startsWith(github.event.ref, 'refs/tags/v') }} - # suffix will be tag like v1.2.3 or v1.0.0-beta+exp.sha.5114f8512 as long as it respects semver - run: | - echo "WORKFLOW_VERSION=${{github.ref_name}}" >> $env:GITHUB_ENV - - name: Put release name into a variable (single commit) - if: ${{ !startsWith(github.event.ref, 'refs/tags/v') && github.event_name != 'pull_request'}} - # suffix will be commit sha 5108ce7c3ac60bec1e0867bb10c4497db67e3606 - run: | - echo "WORKFLOW_VERSION=${{github.sha}}" >> $env:GITHUB_ENV - - - name: Find and Replace MY_AUTOMATED_VERSION_STRING - run: | - echo "${{env.WORKFLOW_VERSION}}" - (Get-Content DFTFringe/DFTFringeInstaller/config/config.xml).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringeInstaller/config/config.xml - (Get-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml - (Get-Content DFTFringe/DFTFringe.pro).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringe.pro - (Get-Content DFTFringe/DFTFringe_QT5.pro).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringe_QT5.pro - - name: Put current date into a variable - run: | - $NOW=& Get-Date -format yyyy-MM-dd - echo "NOW=$NOW" >> $env:GITHUB_ENV - - name: Find and Replace MY_AUTOMATED_DATE_STRING - run: | - echo "${{env.NOW}}" - (Get-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml).replace('MY_AUTOMATED_DATE_STRING', '${{env.NOW}}') | Set-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml - - - run: cd DFTFringe ; ..\${{env.QT_version}}\mingw81_64\bin\qmake.exe DFTFringe_QT5.pro - #- run: echo "::add-matcher::.github/matcher/uic_matcher.json" - - run: cd DFTFringe ; mingw32-make -j4 - #- run: echo "::remove-matcher owner=uic-problem-matcher::" - - - name: copy needed dlls not found by windeployqt - run: | - Copy-Item ".\DFTFringe\Release\DFTFringe.exe.debug" -Destination ".\" - mkdir ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\DFTFringe\Release\DFTFringe.exe" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\build_lapack\bin\liblapack.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\build_lapack\bin\libblas.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_calib3d460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_core460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_features2d460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_flann460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_highgui460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_imgcodecs460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_imgproc460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\qwt-${{env.QWT_version}}\lib\qwt.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\${{env.QT_version}}\mingw81_64\bin\Qt5OpenGL.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\tools\mingw${{env.mingw_version}}_64\bin\libquadmath-0.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - Copy-Item ".\DFTFringe\ColorMaps" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data\ColorMaps" -Recurse - mkdir ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data\res" - Copy-Item ".\DFTFringe\res\surface_LeY_icon.ico" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data\res" - Copy-Item ".\DFTFringe\res\help" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data\res\help" -Recurse - Copy-Item ".\DFTFringe\RevisionHistory.html" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" - - name: automatically add QT dependencies with windeployqt - run: .\${{env.QT_version}}\mingw81_64\bin\windeployqt.exe DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data\DFTFringe.exe - - - name: make installer using QT installer framework - run: Tools\QtInstallerFramework\4.7\bin\binarycreator.exe -c DFTFringe\DFTFringeInstaller\config\config.xml -p DFTFringe\DFTFringeInstaller\packages DFTFringeInstaller_QT5_${{env.WORKFLOW_VERSION}} - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: DFTFringe-windows-build-artifact-QT5 - path: | - DFTFringeInstaller_QT5_${{env.WORKFLOW_VERSION}}.exe - DFTFringe.exe.debug diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 65bd94c9..466ef5fd 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -390,7 +390,6 @@ jobs: (Get-Content DFTFringe/DFTFringeInstaller/config/config.xml).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringeInstaller/config/config.xml (Get-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml (Get-Content DFTFringe/DFTFringe.pro).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringe.pro - (Get-Content DFTFringe/DFTFringe_QT5.pro).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringe_QT5.pro - name: Put current date into a variable run: | $NOW=& Get-Date -format yyyy-MM-dd diff --git a/DFTFringe_QT5.pro b/DFTFringe_QT5.pro deleted file mode 100644 index 6f1f6319..00000000 --- a/DFTFringe_QT5.pro +++ /dev/null @@ -1,562 +0,0 @@ -# ____ _____ _____ _____ _ -# | \| __|_ _| __|___|_|___ ___ ___ -# | | | __| | | | __| _| | | . | -_| -# |____/|__| |_| |__| |_| |_|_|_|_ |___| -# |___| - - -TARGET = DFTFringe - -VERSION = MY_AUTOMATED_VERSION_STRING - -DEFINES += APP_VERSION=\\\"$$VERSION\\\" -DEFINES += QAPPLICATION_CLASS=QApplication - -TEMPLATE = app - -QT += charts concurrent core datavisualization gui multimedia multimediawidgets network opengl widgets xml - -qtHaveModule(printsupport): QT += printsupport - -QMAKE_CXXFLAGS += -std=c++14 - -# disable qDebug() in release -CONFIG( release, debug|release ) { - message("Release build") - DEFINES += QT_NO_DEBUG_OUTPUT -} - -# Below are the three platform specific project configurations for WINDOWS, LINUX and MAC - -# WINDOWS ########## -win32 { - message("Using WINDOWS project configuration.") - - CONFIG( debug, debug|release ) { - LIBS += -L..\qwt-6.1.6\lib -lqwtd # debug - } else { - LIBS += -L..\qwt-6.1.6\lib -lqwt # release - CONFIG+=force_debug_info # keep debug infos (even in release build) to be able to link stacktrace address to actual function - CONFIG+=separate_debug_info # separate debug infos into a .exe.debug to not grow the .exe - } - - # NOTE: RC_FILE is Windows only, breaks Mac (and Linux?) builds if it in their scope. - RC_FILE = DFTFringe.rc - - INCLUDEPATH += ..\qwt-6.1.6\src - INCLUDEPATH += ..\build_armadillo\tmp\include - INCLUDEPATH += ..\build_openCV\install\include - INCLUDEPATH += ..\build_libraw\install\include # LibRaw for camera RAW support - DEFINES += LIBRAW_NODLL # link LibRaw statically (no __declspec(dllimport)) - - LIBS += -L..\build_lapack\bin -llibblas - LIBS += -L..\build_lapack\bin -lliblapack - LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_calib3d460 - LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_core460 - LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_features2d460 - LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_highgui460 - LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_imgcodecs460 - LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_imgproc460 - LIBS += -L..\build_libraw\install\lib -lraw # LibRaw (static) for camera RAW support - LIBS += -lws2_32 # Winsock: LibRaw needs htons/ntohs/htonl/ntohl on Windows - LIBS += -ldbghelp # for SetUnhandledExceptionFilter - LIBS += -lz # zip compression library needed for cnpy.cpp - - # This is for armadillo to not use wrapper. See https://gitlab.com/conradsnicta/armadillo-code#6-linux-and-macos-compiling-and-linking - DEFINES += ARMA_DONT_USE_WRAPPER -} - -# LINUX ############ -unix: !mac { - message("Using LINUX project configuration.") - contains( CONFIG,debug ) { message("no extra debug libraries") } - - INCLUDEPATH += /usr/include/opencv4 - INCLUDEPATH += /usr/include/qwt - - LIBS += -larmadillo - LIBS += -lGLU - LIBS += -lopencv_calib3d - LIBS += -lopencv_core - LIBS += -lopencv_features2d - LIBS += -lopencv_highgui - LIBS += -lopencv_imgcodecs - LIBS += -lopencv_imgproc - LIBS += -lopencv_imgproc - LIBS += -lqwt-qt5 - LIBS += -lz # zip compression library needed for cnpy.cpp - -} - -# MAC ############## -macx { - message("Using MACOS project configuration.") - message( ................................ ) - message("..........PRO FILE: $$_PRO_FILE_") - message("......PRO FILE PWD: $$_PRO_FILE_PWD_") - message( ................... ) - - CONFIG += app_bundle - CONFIG += sdk_no_version_check - CONFIG += link_pkgconfig - CONFIG += silent - - QMAKE_FULL_VERSION=APP_VERSION - QMAKE_MACOSX_DEPLOYMENT_TARGET = 11.0 - QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64 - - CONFIG( debug, debug|release ) { DESTDIR = build/debug } - CONFIG( release, debug|release ) { DESTDIR = build/release } - - MOC_DIR = $$DESTDIR/.moc - OBJECTS_DIR = $$DESTDIR/.obj #these change between build and release. - RCC_DIR = $$DESTDIR/.qrc - UI_DIR = $$DESTDIR/.ui - QMAKE_MKDIR = /usr/local/bin/mkdir # This tells QMAKE which mkdir command to use. - QMAKE_PKG_CONFIG = /opt/homebrew/bin/pkg-config # This tells QMAKE which pkg-config executable to use. - PKG_CONFIG_PATH = $$[QT_INSTALL_LIBS]/pkgconfig - INCLUDEPATH += -I$$[QT_INSTALL_PLUGINS] - LIBS += -L$$[QT_INSTALL_PLUGINS] - PKGCONFIG += armadillo opencv Qt5Qwt6 - - message(........QT_VERSION: $$[QT_VERSION]) - message(.QT_INSTALL_PREFIX: $$[QT_INSTALL_PREFIX]) - message(QT_INSTALL_HEADERS: $$[QT_INSTALL_HEADERS]) - message(...QT_INSTALL_LIBS: $$[QT_INSTALL_LIBS]) - message(QT_INSTALL_PLUGINS: $$[QT_INSTALL_PLUGINS]) - message(...................) - message(...........DESTDIR: $$DESTDIR) - message(...........MOC_DIR: $$MOC_DIR) - message(.......OBJECTS_DIR: $$OBJECTS_DIR) - message(...........RCC_DIR: $$RCC_DIR) - message(............UI_DIR: $$UI_DIR) - message(...................) - message(.......QMAKE_MKDIR: $$QMAKE_MKDIR) - message(..QMAKE_PKG_CONFIG: $$QMAKE_PKG_CONFIG) - message(...PKG_CONFIG_PATH: $$PKG_CONFIG_PATH) - message(.......INCLUDEPATH: $$INCLUDEPATH) - message(..............LIBS: $$LIBS) - message(.........PKGCONFIG: $$PKGCONFIG) - message(............CONFIG: $$CONFIG) -} - -# Below are the includes for source files and other resources, sorted alphabetically. ################################## -# If a filename contains spaces it will need quoting. - - -RESOURCES += DFTResources.qrc - -TRANSLATIONS += dftfringe_fr.ts - -INCLUDEPATH += ./bezier ./SingleApplication ./zernike ./cnpy - -SOURCES += SingleApplication/singleapplication.cpp \ - SingleApplication/singleapplication_p.cpp \ - zernike/zapm.cpp \ - annulushelpdlg.cpp \ - arbitrarywavefronthelp.cpp \ - arbitrarywavwidget.cpp \ - astigpolargraph.cpp \ - astigscatterplot.cpp \ - astigstatsdlg.cpp \ - autoinvertdlg.cpp \ - averagewavefrontfilesdlg.cpp \ - batchigramwizard.cpp \ - bathastigdlg.cpp \ - camcalibrationreviewdlg.cpp \ - cameracalibwizard.cpp \ - camwizardpage1.cpp \ - ccswappeddlg.cpp \ - circlefit.cpp \ - circleoutline.cpp \ - cnpy/cnpy.cpp \ - colorchannel.cpp \ - colorchanneldisplay.cpp \ - colormapviewerdlg.cpp \ - contourplot.cpp \ - contourrulerparams.cpp \ - contourtools.cpp \ - contourview.cpp \ - counterrotationdlg.cpp \ - cpoint.cpp \ - defocusdlg.cpp \ - dftarea.cpp \ - dftcolormap.cpp \ - dftthumb.cpp \ - dfttools.cpp \ - edgeplot.cpp \ - filteroutlinesdlg.cpp \ - foucaultview.cpp \ - generatetargetdlg.cpp \ - graphicsutilities.cpp \ - helpdlg.cpp \ - hotkeysdlg.cpp \ - igramarea.cpp \ - igramintensity.cpp \ - imagehisto.cpp \ - intensityplot.cpp \ - jitteroutlinedlg.cpp \ - lensetablemodel.cpp \ - main.cpp \ - mainwindow.cpp \ - messagereceiver.cpp \ - metricsdisplay.cpp \ - mirrordlg.cpp \ - myplotpicker.cpp \ - myutils.cpp \ - nullmarginhelpdlg.cpp \ - nullvariationdlg.cpp \ - oglrendered.cpp \ - oglview.cpp \ - outlinedialog.cpp \ - outlinehelpdocwidget.cpp \ - outlineplots.cpp \ - outlinestatsdlg.cpp \ - pdfcalibrationdlg.cpp \ - percentcorrectiondlg.cpp \ - pixelstats.cpp \ - plotcolor.cpp \ - profilecurve.cpp \ - profileplot.cpp \ - profileplotpicker.cpp \ - ronchicomparedialog.cpp \ - psfplot.cpp \ - psi_dlg.cpp \ - psiphasedisplay.cpp \ - psitiltoptions.cpp \ - punwrap.cpp \ - rawimage.cpp \ - regionedittools.cpp \ - rejectedwavefrontsdlg.cpp \ - reportdlg.cpp \ - reviewwindow.cpp \ - rmsplot.cpp \ - rotationdlg.cpp \ - settings2.cpp \ - settingsdebug.cpp \ - settingsdft.cpp \ - settingsGeneral2.cpp \ - settingsigram.cpp \ - settingsigramimportconfig.cpp \ - settingsprofile.cpp \ - showaliasdlg.cpp \ - showallcontoursdlg.cpp \ - simigramdlg.cpp \ - simulationsview.cpp \ - standastigwizard.cpp \ - startestmoviedlg.cpp \ - statsview.cpp \ - subtractwavefronatsdlg.cpp \ - surface3dcontrolsdlg.cpp \ - surfaceanalysistools.cpp \ - surfacegraph.cpp \ - surfacelightingproxy.cpp \ - surfacemanager.cpp \ - wavefrontloaderworker.cpp \ - transformwavefrontdlg.cpp \ - unwraperrorsview.cpp \ - usercolormapdlg.cpp \ - userdrawnprofiledlg.cpp \ - utils.cpp \ - vortexdebug.cpp \ - wavefront.cpp \ - wavefrontaveragefilterdlg.cpp \ - wavefrontfilterdlg.cpp \ - wftexaminer.cpp \ - wftstats.cpp \ - zernikedlg.cpp \ - zernikeeditdlg.cpp \ - zernikepolar.cpp \ - zernikeprocess.cpp \ - zernikes.cpp \ - zernikesmoothingdlg.cpp - -HEADERS += bezier/bezier.h \ - SingleApplication/singleapplication_p.h \ - SingleApplication/singleapplication.h \ - zernike/zapm_interface.h \ - annulushelpdlg.h \ - arbitrarywavefronthelp.h \ - astigpolargraph.h \ - arbitrarywavwidget.h \ - astigscatterplot.h \ - astigstatsdlg.h \ - autoinvertdlg.h \ - averagewavefrontfilesdlg.h \ - batchigramwizard.h \ - bathastigdlg.h \ - camcalibrationreviewdlg.h \ - cameracalibwizard.h \ - camwizardpage1.h \ - ccswappeddlg.h \ - circle.h \ - circleoutline.h \ - circleutils.h \ - cnpy/cnpy.h \ - colorchannel.h \ - colorchanneldisplay.h \ - colormapviewerdlg.h \ - contourplot.h \ - contourrulerparams.h \ - contourtools.h \ - contourview.h \ - counterrotationdlg.h \ - cpoint.h \ - defocusdlg.h \ - dftarea.h \ - dftcolormap.h \ - dftthumb.h \ - dfttools.h \ - edgeplot.h \ - filteroutlinesdlg.h \ - foucaultview.h \ - generatetargetdlg.h \ - graphicsutilities.h \ - helpdlg.h \ - hotkeysdlg.h \ - IgramArea.h \ - igramintensity.h \ - imagehisto.h \ - intensityplot.h \ - jitteroutlinedlg.h \ - lensetablemodel.h \ - mainwindow.h \ - messagereceiver.h \ - metricsdisplay.h \ - mirrordlg.h \ - myplotpicker.h \ - myutils.h \ - nullmarginhelpdlg.h \ - nullvariationdlg.h \ - oglrendered.h \ - oglview.h \ - outlinedialog.h \ - outlinehelpdocwidget.h \ - outlineplots.h \ - outlinestatsdlg.h \ - pdfcalibrationdlg.h \ - percentcorrectiondlg.h \ - percentCorrectionSurface.h \ - pixelstats.h \ - plotcolor.h \ - profilecurve.h \ - profileplot.h \ - profileplotpicker.h \ - ronchicomparedialog.h \ - psfplot.h \ - psi_dlg.h \ - psiphasedisplay.h \ - psitiltoptions.h \ - punwrap.h \ - rawimage.h \ - regionedittools.h \ - rejectedwavefrontsdlg.h \ - reportdlg.h \ - reviewwindow.h \ - rmsplot.h \ - rotationdlg.h \ - settings2.h \ - settingsdebug.h \ - settingsdft.h \ - settingsGeneral2.h \ - settingsigram.h \ - settingsigramimportconfig.h \ - settingsprofile.h \ - showaliasdlg.h \ - showallcontoursdlg.h \ - simigramdlg.h \ - simulationsview.h \ - standastigwizard.h \ - startestmoviedlg.h \ - statsview.h \ - subtractwavefronatsdlg.h \ - surface3dcontrolsdlg.h \ - surfaceanalysistools.h \ - surfacegraph.h \ - surfacelightingproxy.h \ - surfacemanager.h \ - wavefrontloaderworker.h \ - transformwavefrontdlg.h \ - unwraperrorsview.h \ - usercolormapdlg.h \ - userdrawnprofiledlg.h \ - utils.h \ - vortexdebug.h \ - wavefront.h \ - wavefrontaveragefilterdlg.h \ - wavefrontfilterdlg.h \ - wftexaminer.h \ - wftstats.h \ - zernikedlg.h \ - zernikeeditdlg.h \ - zernikepolar.h \ - zernikeprocess.h \ - zernikes.h \ - zernikesmoothingdlg.h - -FORMS += arbitrarywavefronthelp.ui \ - annulushelpdlg.ui \ - astigpolargraph.ui \ - astigstatsdlg.ui \ - autoinvertdlg.ui \ - averagewavefrontfilesdlg.ui \ - batchigramwizard.ui \ - bathastigdlg.ui \ - camcalibrationreviewdlg.ui \ - cameracalibwizard.ui \ - camwizardpage1.ui \ - ccswappeddlg.ui \ - colorchanneldisplay.ui \ - colormapviewerdlg.ui \ - contourrulerparams.ui \ - contourtools.ui \ - contourview.ui \ - counterrotationdlg.ui \ - defocusdlg.ui \ - dftarea.ui \ - dftthumb.ui \ - dfttools.ui \ - edgeplot.ui \ - filteroutlinesdlg.ui \ - foucaultview.ui \ - generatetargetdlg.ui \ - helpdlg.ui \ - hotkeysdlg.ui \ - igramintensity.ui \ - jitteroutlinedlg.ui \ - mainwindow.ui \ - metricsdisplay.ui \ - mirrordlg.ui \ - nullmarginhelpdlg.ui \ - nullvariationdlg.ui \ - oglrendered.ui \ - outlinedialog.ui \ - outlinehelpdocwidget.ui \ - outlineplots.ui \ - outlinestatsdlg.ui \ - pdfcalibrationdlg.ui \ - percentcorrectiondlg.ui \ - pixelstats.ui \ - profileplot.ui \ - psfplot.ui \ - psi_dlg.ui \ - psiphasedisplay.ui \ - psitiltoptions.ui \ - regionedittools.ui \ - rejectedwavefrontsdlg.ui \ - reportdlg.ui \ - reviewwindow.ui \ - rotationdlg.ui \ - settings2.ui \ - settingsdebug.ui \ - settingsdft.ui \ - settingsGeneral2.ui \ - settingsigram.ui \ - settingsigramimportconfig.ui \ - settingsprofile.ui \ - showaliasdlg.ui \ - showallcontoursdlg.ui \ - simigramdlg.ui \ - simulationsview.ui \ - standastigwizard.ui \ - startestmoviedlg.ui \ - statsview.ui \ - subtractwavefronatsdlg.ui \ - surface3dcontrolsdlg.ui \ - surfaceanalysistools.ui \ - transformwavefrontdlg.ui \ - unwraperrorsview.ui \ - usercolormapdlg.ui \ - userdrawnprofiledlg.ui \ - vortexdebug.ui \ - wavefrontaveragefilterdlg.ui \ - wavefrontfilterdlg.ui \ - wftexaminer.ui \ - zernikedlg.ui \ - zernikeeditdlg.ui \ - zernikesmoothingdlg.ui - -DISTFILES += buildingDFTFringe64.txt \ - ColorMaps/Dale1.cmp \ - ColorMaps/Dale2.cmp \ - ColorMaps/Dale3.cmp \ - ColorMaps/Diverging_BrBG.cmp \ - ColorMaps/Diverging_bwr.cmp \ - ColorMaps/Diverging_coolwarm.cmp \ - ColorMaps/Diverging_PiYG.cmp \ - ColorMaps/Diverging_PRGn.cmp \ - ColorMaps/Diverging_PuOr.cmp \ - ColorMaps/Diverging_RdBu.cmp \ - ColorMaps/Diverging_RdGy.cmp \ - ColorMaps/Diverging_RdYlBu.cmp \ - ColorMaps/Diverging_RdYlGn.cmp \ - ColorMaps/Diverging_seismic.cmp \ - ColorMaps/Diverging_Spectral.cmp \ - ColorMaps/Miscellaneous_brg.cmp \ - ColorMaps/Miscellaneous_CMRmap.cmp \ - ColorMaps/Miscellaneous_cubehelix.cmp \ - ColorMaps/Miscellaneous_flag.cmp \ - ColorMaps/Miscellaneous_gist_earth.cmp \ - ColorMaps/Miscellaneous_gist_ncar.cmp \ - ColorMaps/Miscellaneous_gist_rainbow.cmp \ - ColorMaps/Miscellaneous_gist_stern.cmp \ - ColorMaps/Miscellaneous_gnuplot.cmp \ - ColorMaps/Miscellaneous_gnuplot2.cmp \ - ColorMaps/Miscellaneous_hsv.cmp \ - ColorMaps/Miscellaneous_jet.cmp \ - ColorMaps/Miscellaneous_nipy_spectral.cmp \ - ColorMaps/Miscellaneous_ocean.cmp \ - ColorMaps/Miscellaneous_prism.cmp \ - ColorMaps/Miscellaneous_rainbow.cmp \ - ColorMaps/Miscellaneous_terrain.cmp \ - "ColorMaps/Perceptually Uniform Sequential_inferno.cmp" \ - "ColorMaps/Perceptually Uniform Sequential_magma.cmp" \ - "ColorMaps/Perceptually Uniform Sequential_plasma.cmp" \ - "ColorMaps/Perceptually Uniform Sequential_viridis.cmp" \ - ColorMaps/Qualitative_Accent.cmp \ - ColorMaps/Qualitative_Dark2.cmp \ - ColorMaps/Qualitative_Paired.cmp \ - ColorMaps/Qualitative_Pastel1.cmp \ - ColorMaps/Qualitative_Pastel2.cmp \ - ColorMaps/Qualitative_Set1.cmp \ - ColorMaps/Qualitative_Set2.cmp \ - ColorMaps/Qualitative_Set3.cmp \ - "ColorMaps/Sequential (2)_afmhot.cmp" \ - "ColorMaps/Sequential (2)_autumn.cmp" \ - "ColorMaps/Sequential (2)_bone.cmp" \ - "ColorMaps/Sequential (2)_cool.cmp" \ - "ColorMaps/Sequential (2)_copper.cmp" \ - "ColorMaps/Sequential (2)_gist_heat.cmp" \ - "ColorMaps/Sequential (2)_gray.cmp" \ - "ColorMaps/Sequential (2)_hot.cmp" \ - "ColorMaps/Sequential (2)_pink.cmp" \ - "ColorMaps/Sequential (2)_spring.cmp" \ - "ColorMaps/Sequential (2)_summer.cmp" \ - "ColorMaps/Sequential (2)_winter.cmp" \ - ColorMaps/Sequential_Blues.cmp \ - ColorMaps/Sequential_BuGn.cmp \ - ColorMaps/Sequential_BuPu.cmp \ - ColorMaps/Sequential_GnBu.cmp \ - ColorMaps/Sequential_Greens.cmp \ - ColorMaps/Sequential_Greys.cmp \ - ColorMaps/Sequential_Oranges.cmp \ - ColorMaps/Sequential_OrRd.cmp \ - ColorMaps/Sequential_PuBu.cmp \ - ColorMaps/Sequential_PuBuGn.cmp \ - ColorMaps/Sequential_PuRd.cmp \ - ColorMaps/Sequential_Purples.cmp \ - ColorMaps/Sequential_RdPu.cmp \ - ColorMaps/Sequential_Reds.cmp \ - ColorMaps/Sequential_YlGn.cmp \ - ColorMaps/Sequential_YlGnBu.cmp \ - ColorMaps/Sequential_YlOrBr.cmp \ - ColorMaps/Sequential_YlOrRd.cmp \ - ColorMaps/spring.cmp \ - COPYING.LESSER.txt \ - COPYING.txt \ - README.md \ - RevisionHistory.html - - - - From ff7895af9f03e7252a78d28ac71e32d5d99e8e58 Mon Sep 17 00:00:00 2001 From: sotisbg Date: Sat, 25 Jul 2026 15:02:16 +0300 Subject: [PATCH 7/9] Restore QT5 Windows build (Qt 5.15) for the RAW installer The QT6 (Qt 6.8.3) build renders the whole UI and the report at a different resolution on high-DPI monitors than the previous Qt 5.15 build the user prefers. Bring back DFTFringe_QT5.pro and the QT5 windows workflow (version-string patch + tag trigger already included) so we can ship the RAW installer on Qt 5.15 again. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/build-windows-QT5.yml | 441 +++++++++++++++++++ DFTFringe_QT5.pro | 562 ++++++++++++++++++++++++ 2 files changed, 1003 insertions(+) create mode 100644 .github/workflows/build-windows-QT5.yml create mode 100644 DFTFringe_QT5.pro diff --git a/.github/workflows/build-windows-QT5.yml b/.github/workflows/build-windows-QT5.yml new file mode 100644 index 00000000..98d1d090 --- /dev/null +++ b/.github/workflows/build-windows-QT5.yml @@ -0,0 +1,441 @@ +name: build-windows-QT5 +on: + push: + branches: + - master + tags: + - 'v*' + pull_request: + workflow_dispatch: + workflow_call: + +env: + armadillo_version: 15.2.2 + QWT_version: 6.1.6 + openCV_version: 4.6.0 + QT_version: 5.15.2 + lapack_version: 3.12.1 + libraw_version: 0.22.2 + mingw_version: 810 + python_version: 3.13 + +jobs: + cache-mingw-from-QT: + runs-on: windows-latest + steps: + # this will restore/cache everything in /Tools depending on cache hit/miss + - name: Cache minGW + id: cache-minGW + uses: actions/cache@v4 + with: + path: Tools + key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 + + # all what follows is only run on cache miss + - name: install newer python + if: steps.cache-minGW.outputs.cache-hit != 'true' + uses: actions/setup-python@v5 + with: + python-version: ${{env.python_version}} + - name: install aqtinstall tool + if: steps.cache-minGW.outputs.cache-hit != 'true' + run: pip install aqtinstall + - name: install correct minGW version + if: steps.cache-minGW.outputs.cache-hit != 'true' + run: aqt install-tool windows desktop tools_mingw qt.tools.win64_mingw${{env.mingw_version}} + # path is Tools\mingw${{env.mingw_version}}_64\bin\ + - name: install QT installer framework + if: steps.cache-minGW.outputs.cache-hit != 'true' + run: aqt install-tool windows desktop tools_ifw + # path is Tools\QtInstallerFramework\4.7\bin\ + + build-openCV-with-QT: + runs-on: windows-latest + needs: cache-mingw-from-QT + steps: + # this will restore/cache everything depending on cache hit/miss + - name: Cache QT and openCV + uses: actions/cache/@v4 + id: cache-openCV-QT + with: + path: | + build_openCV\install\x64\mingw\bin\*.dll + build_openCV\install\include\* + ${{env.QT_version}}\mingw81_64\bin\* + ${{env.QT_version}}\mingw81_64\include\* + ${{env.QT_version}}\mingw81_64\lib\* + ${{env.QT_version}}\mingw81_64\mkspecs\* + ${{env.QT_version}}\mingw81_64\plugins\platforms\* + ${{env.QT_version}}\mingw81_64\plugins\imageformats\* + key: ${{ runner.os }}-openCV-${{env.openCV_version}}-QT-${{env.QT_version}} + + # all what follows is only run on cache miss + + # restore cached minGW + - uses: actions/cache/restore@v4 + if: steps.cache-openCV-QT.outputs.cache-hit != 'true' + id: cache-minGW + with: + path: Tools + key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 + fail-on-cache-miss: true + - name: install newer python + if: steps.cache-openCV-QT.outputs.cache-hit != 'true' + uses: actions/setup-python@v5 + with: + python-version: ${{env.python_version}} + - name: add minGW to path + if: steps.cache-openCV-QT.outputs.cache-hit != 'true' + shell: bash + run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH + - name: install aqtinstall tool + if: steps.cache-openCV-QT.outputs.cache-hit != 'true' + run: pip install aqtinstall + - name: install QT + if: steps.cache-openCV-QT.outputs.cache-hit != 'true' + run: aqt install-qt windows desktop ${{env.QT_version}} win64_mingw81 -m qtcharts qtdatavis3d + - uses: actions/checkout@v4 + if: steps.cache-openCV-QT.outputs.cache-hit != 'true' + with: + repository: 'opencv/opencv' + ref: '${{env.openCV_version}}' + path: './openCV' + - name: cmake generate + if: steps.cache-openCV-QT.outputs.cache-hit != 'true' + run: cmake -G "MinGW Makefiles" -S openCV -B build_openCV -D WITH_QT=ON -D WITH_OPENGL=ON -D Qt5_DIR=:./${{env.QT_version}}/mingw81_64/lib/cmake/Qt5 + - name: cmake generate again + if: steps.cache-openCV-QT.outputs.cache-hit != 'true' + run: cmake -G "MinGW Makefiles" -S openCV -B build_openCV + - name: cmake build + if: steps.cache-openCV-QT.outputs.cache-hit != 'true' + run: cmake --build ./build_openCV -j4 + - name: cmake install + if: steps.cache-openCV-QT.outputs.cache-hit != 'true' + run: cmake --install ./build_openCV + + build-QWT: + runs-on: windows-latest + needs: cache-mingw-from-QT + steps: + # this will restore/cache everything depending on cache hit/miss + - name: cache QWT + uses: actions/cache/@v4 + id: cache-QWT + with: + path: | + qwt-${{env.QWT_version}}\src + qwt-${{env.QWT_version}}\lib\*.dll + key: ${{ runner.os }}-QWT-${{env.QWT_version}} + + # all what follows is only run on cache miss + + # restore cached minGW + - uses: actions/cache/restore@v4 + if: steps.cache-QWT.outputs.cache-hit != 'true' + id: cache-minGW + with: + path: Tools + key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 + fail-on-cache-miss: true + - name: add minGW to path + if: steps.cache-QWT.outputs.cache-hit != 'true' + shell: bash + run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH + - name: install wget + if: steps.cache-QWT.outputs.cache-hit != 'true' + run: choco install -y wget + - name: download QWT + if: steps.cache-QWT.outputs.cache-hit != 'true' + # I specified the mirror because one of the random mirrors did not work during my tests + run: wget -O qwt-${{env.QWT_version}}.zip https://sourceforge.net/projects/qwt/files/qwt/${{env.QWT_version}}/qwt-${{env.QWT_version}}.zip/download?use_mirror=pilotfiber + - name: extract archive + if: steps.cache-QWT.outputs.cache-hit != 'true' + run: 7z x qwt-${{env.QWT_version}}.zip + - name: install newer python + if: steps.cache-QWT.outputs.cache-hit != 'true' + uses: actions/setup-python@v5 + with: + python-version: ${{env.python_version}} + - name: install aqtinstall tool + if: steps.cache-QWT.outputs.cache-hit != 'true' + run: pip install aqtinstall + - name: install qmake + if: steps.cache-QWT.outputs.cache-hit != 'true' + run: aqt install-qt windows desktop ${{env.QT_version}} win64_mingw81 --archives qtbase qtsvg + - name: qmake + if: steps.cache-QWT.outputs.cache-hit != 'true' + run: cd qwt-${{env.QWT_version}} ; ..\${{env.QT_version}}\mingw81_64\bin\qmake.exe + - name: build + if: steps.cache-QWT.outputs.cache-hit != 'true' + run: cd qwt-${{env.QWT_version}} ; mingw32-make -j4 + + build-lapack-armadillo: + runs-on: windows-latest + needs: cache-mingw-from-QT + steps: + # this will restore/cache everything depending on cache hit/miss + - name: Cache lapack build + id: cache-lapack + uses: actions/cache@v4 + with: + path: | + build_lapack\bin\liblapack.dll + build_lapack\bin\libblas.dll + build_armadillo\tmp\include + key: ${{ runner.os }}-lapack-${{env.lapack_version}}-armadillo-${{env.armadillo_version}} + + # all what follows is only run on cache miss + + # restore cached minGW + - uses: actions/cache/restore@v4 + if: steps.cache-lapack.outputs.cache-hit != 'true' + id: cache-minGW + with: + path: Tools + key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 + fail-on-cache-miss: true + - name: add minGW to path + if: steps.cache-lapack.outputs.cache-hit != 'true' + shell: bash + run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH + - uses: actions/checkout@v4 + if: steps.cache-lapack.outputs.cache-hit != 'true' + with: + repository: 'Reference-LAPACK/lapack' + ref: 'v${{env.lapack_version}}' + path: './lapack' + # See https://github.com/Reference-LAPACK/lapack/issues/305 : CMAKE_SHARED_LINKER_FLAGS is fixing a build issue + - name: cmake generate + if: steps.cache-lapack.outputs.cache-hit != 'true' + run: cmake -G "MinGW Makefiles" -S lapack -B build_lapack -D BUILD_SHARED_LIBS=ON -D CMAKE_SHARED_LINKER_FLAGS="-Wl,--allow-multiple-definition" + - name: cmake build + if: steps.cache-lapack.outputs.cache-hit != 'true' + run: cmake --build ./build_lapack -j4 + # now that Lapack is built, do the Armadillo build + - name: install wget + if: steps.cache-lapack.outputs.cache-hit != 'true' + run: choco install -y wget + - name: download armadillo + if: steps.cache-lapack.outputs.cache-hit != 'true' + # I specified the mirror because one of the random mirrors did not work during my tests + run: wget -O armadillo-${{env.armadillo_version}}.tar.xz http://sourceforge.net/projects/arma/files/armadillo-${{env.armadillo_version}}.tar.xz/download?use_mirror=versaweb + # Extract in two step. First step write to stdo and second step read from stdi. + # This avoids intermediate file creation + # It must run in CMD because powershell corrupts pipes + - name: extract archive + if: steps.cache-lapack.outputs.cache-hit != 'true' + run: 7z x -so armadillo-${{env.armadillo_version}}.tar.xz | 7z x -si -ttar + shell: cmd + # Armadillo relies on Lapack, it's important it knowns where it is during genration to be configured correctly + - name: cmake generate + if: steps.cache-lapack.outputs.cache-hit != 'true' + run: cmake -D CMAKE_PREFIX_PATH=${{github.workspace}}/build_lapack -G "MinGW Makefiles" -S armadillo-${{env.armadillo_version}} -B build_armadillo + - name: cmake build + if: steps.cache-lapack.outputs.cache-hit != 'true' + run: cmake --build ./build_armadillo -j4 + + build-libraw: + runs-on: windows-latest + needs: cache-mingw-from-QT + steps: + # this will restore/cache everything depending on cache hit/miss + - name: cache LibRaw + uses: actions/cache/@v4 + id: cache-libraw + with: + path: | + build_libraw\install\include\libraw\* + build_libraw\install\lib\libraw.a + key: ${{ runner.os }}-libraw-${{env.libraw_version}}-mingw${{env.mingw_version}} + + # all what follows is only run on cache miss + + # restore cached minGW + - uses: actions/cache/restore@v4 + if: steps.cache-libraw.outputs.cache-hit != 'true' + id: cache-minGW + with: + path: Tools + key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 + fail-on-cache-miss: true + - name: add minGW to path + if: steps.cache-libraw.outputs.cache-hit != 'true' + shell: bash + run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH + - name: install wget + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: choco install -y wget + - name: download LibRaw + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: wget -O LibRaw.tar.gz https://github.com/LibRaw/LibRaw/archive/refs/tags/${{env.libraw_version}}.tar.gz + # Extract in two steps: first gunzip to stdout, then untar from stdin. + # Must run in CMD because powershell corrupts pipes. + - name: extract archive + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: 7z x -so LibRaw.tar.gz | 7z x -si -ttar + shell: cmd + - name: build LibRaw static library + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: cd LibRaw-${{env.libraw_version}} ; mingw32-make -f Makefile.mingw library + - name: install LibRaw (headers + static lib) into build_libraw\install + if: steps.cache-libraw.outputs.cache-hit != 'true' + run: | + mkdir -Force ".\build_libraw\install\include\libraw" | Out-Null + mkdir -Force ".\build_libraw\install\lib" | Out-Null + Copy-Item ".\LibRaw-${{env.libraw_version}}\libraw\*.h" -Destination ".\build_libraw\install\include\libraw" + Copy-Item ".\LibRaw-${{env.libraw_version}}\lib\libraw.a" -Destination ".\build_libraw\install\lib" + + build-DFTFringe: + runs-on: windows-latest + needs: [cache-mingw-from-QT, build-lapack-armadillo, build-QWT, build-openCV-with-QT, build-libraw] + steps: + + # because problem matcher will not work when chechout in a subfolder, + # checkout at root and then copy everything in folder. + # Match will be done in build folder, and file at root will be used to link the match + # Note checkouting twice is not working. + # This copy is done before adding any more file into folders + - uses: actions/checkout@v4 + # with: + # path: 'DFTFringe' + + # copy all files for problem matcher to work + - name: copy files into build folder (problem matcher workaround) + run: | + mkdir ".\DFTFringe" + Copy-Item ".\*" -Destination ".\DFTFringe" -Exclude @("DFTFringe") -Recurse + + + # restore cached minGW + - uses: actions/cache/restore@v4 + id: cache-minGW + with: + path: Tools + key: ${{ runner.os }}-mingw${{env.mingw_version}}_64 + fail-on-cache-miss: true + - name: add minGW to path + shell: bash + run: echo "${{github.workspace}}\Tools\mingw${{env.mingw_version}}_64\bin" >> $GITHUB_PATH + # restore cached lapack and armadillo + - uses: actions/cache/restore@v4 + id: cache-lapack + with: + path: | + build_lapack\bin\liblapack.dll + build_lapack\bin\libblas.dll + build_armadillo\tmp\include + key: ${{ runner.os }}-lapack-${{env.lapack_version}}-armadillo-${{env.armadillo_version}} + fail-on-cache-miss: true + # restore cached QWT + - uses: actions/cache/restore@v4 + id: cache-QWT + with: + path: | + qwt-${{env.QWT_version}}\src + qwt-${{env.QWT_version}}\lib\*.dll + key: ${{ runner.os }}-QWT-${{env.QWT_version}} + fail-on-cache-miss: true + # restore cached LibRaw + - uses: actions/cache/restore@v4 + id: cache-libraw + with: + path: | + build_libraw\install\include\libraw\* + build_libraw\install\lib\libraw.a + key: ${{ runner.os }}-libraw-${{env.libraw_version}}-mingw${{env.mingw_version}} + fail-on-cache-miss: true + # restore cached openCV and QT + - uses: actions/cache/restore@v4 + id: cache-openCV-QT + with: + path: | + build_openCV\install\x64\mingw\bin\*.dll + build_openCV\install\include\* + ${{env.QT_version}}\mingw81_64\bin\* + ${{env.QT_version}}\mingw81_64\include\* + ${{env.QT_version}}\mingw81_64\lib\* + ${{env.QT_version}}\mingw81_64\mkspecs\* + ${{env.QT_version}}\mingw81_64\plugins\platforms\* + ${{env.QT_version}}\mingw81_64\plugins\imageformats\* + key: ${{ runner.os }}-openCV-${{env.openCV_version}}-QT-${{env.QT_version}} + fail-on-cache-miss: true + + # this enables the problem matcher + #- uses: ammaraskar/gcc-problem-matcher@master + + # Update the 2 strings automatically + # MY_AUTOMATED_VERSION_STRING + # MY_AUTOMATED_DATE_STRING + - name: Put release name into a variable (pull request) + if: ${{ github.event_name == 'pull_request' }} + # suffix will be c18a74e0f4f4db36eddc66a68eb08e91cd6c6a1c_5108ce7c3ac60bec1e0867bb10c4497db67e3606 + # Because build is a merge commit, clearly identifies the PR commit and base commit + run: | + echo "WORKFLOW_VERSION=${{github.event.pull_request.head.sha}}_${{github.event.pull_request.base.sha}}" >> $env:GITHUB_ENV + - name: Put release name into a variable (tag) + if: ${{ startsWith(github.event.ref, 'refs/tags/v') }} + # suffix will be tag like v1.2.3 or v1.0.0-beta+exp.sha.5114f8512 as long as it respects semver + run: | + echo "WORKFLOW_VERSION=${{github.ref_name}}" >> $env:GITHUB_ENV + - name: Put release name into a variable (single commit) + if: ${{ !startsWith(github.event.ref, 'refs/tags/v') && github.event_name != 'pull_request'}} + # suffix will be commit sha 5108ce7c3ac60bec1e0867bb10c4497db67e3606 + run: | + echo "WORKFLOW_VERSION=${{github.sha}}" >> $env:GITHUB_ENV + + - name: Find and Replace MY_AUTOMATED_VERSION_STRING + run: | + echo "${{env.WORKFLOW_VERSION}}" + (Get-Content DFTFringe/DFTFringeInstaller/config/config.xml).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringeInstaller/config/config.xml + (Get-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml + (Get-Content DFTFringe/DFTFringe.pro).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringe.pro + (Get-Content DFTFringe/DFTFringe_QT5.pro).replace('MY_AUTOMATED_VERSION_STRING', '${{env.WORKFLOW_VERSION}}') | Set-Content DFTFringe/DFTFringe_QT5.pro + - name: Put current date into a variable + run: | + $NOW=& Get-Date -format yyyy-MM-dd + echo "NOW=$NOW" >> $env:GITHUB_ENV + - name: Find and Replace MY_AUTOMATED_DATE_STRING + run: | + echo "${{env.NOW}}" + (Get-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml).replace('MY_AUTOMATED_DATE_STRING', '${{env.NOW}}') | Set-Content DFTFringe/DFTFringeInstaller/packages/com.githubdoe.DFTFringe/meta/package.xml + + - run: cd DFTFringe ; ..\${{env.QT_version}}\mingw81_64\bin\qmake.exe DFTFringe_QT5.pro + #- run: echo "::add-matcher::.github/matcher/uic_matcher.json" + - run: cd DFTFringe ; mingw32-make -j4 + #- run: echo "::remove-matcher owner=uic-problem-matcher::" + + - name: copy needed dlls not found by windeployqt + run: | + Copy-Item ".\DFTFringe\Release\DFTFringe.exe.debug" -Destination ".\" + mkdir ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\DFTFringe\Release\DFTFringe.exe" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\build_lapack\bin\liblapack.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\build_lapack\bin\libblas.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_calib3d460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_core460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_features2d460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_flann460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_highgui460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_imgcodecs460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\build_openCV\install\x64\mingw\bin\libopencv_imgproc460.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\qwt-${{env.QWT_version}}\lib\qwt.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\${{env.QT_version}}\mingw81_64\bin\Qt5OpenGL.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\tools\mingw${{env.mingw_version}}_64\bin\libquadmath-0.dll" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + Copy-Item ".\DFTFringe\ColorMaps" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data\ColorMaps" -Recurse + mkdir ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data\res" + Copy-Item ".\DFTFringe\res\surface_LeY_icon.ico" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data\res" + Copy-Item ".\DFTFringe\res\help" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data\res\help" -Recurse + Copy-Item ".\DFTFringe\RevisionHistory.html" -Destination ".\DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data" + - name: automatically add QT dependencies with windeployqt + run: .\${{env.QT_version}}\mingw81_64\bin\windeployqt.exe DFTFringe\DFTFringeInstaller\packages\com.githubdoe.DFTFringe\data\DFTFringe.exe + + - name: make installer using QT installer framework + run: Tools\QtInstallerFramework\4.7\bin\binarycreator.exe -c DFTFringe\DFTFringeInstaller\config\config.xml -p DFTFringe\DFTFringeInstaller\packages DFTFringeInstaller_QT5_${{env.WORKFLOW_VERSION}} + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: DFTFringe-windows-build-artifact-QT5 + path: | + DFTFringeInstaller_QT5_${{env.WORKFLOW_VERSION}}.exe + DFTFringe.exe.debug diff --git a/DFTFringe_QT5.pro b/DFTFringe_QT5.pro new file mode 100644 index 00000000..6f1f6319 --- /dev/null +++ b/DFTFringe_QT5.pro @@ -0,0 +1,562 @@ +# ____ _____ _____ _____ _ +# | \| __|_ _| __|___|_|___ ___ ___ +# | | | __| | | | __| _| | | . | -_| +# |____/|__| |_| |__| |_| |_|_|_|_ |___| +# |___| + + +TARGET = DFTFringe + +VERSION = MY_AUTOMATED_VERSION_STRING + +DEFINES += APP_VERSION=\\\"$$VERSION\\\" +DEFINES += QAPPLICATION_CLASS=QApplication + +TEMPLATE = app + +QT += charts concurrent core datavisualization gui multimedia multimediawidgets network opengl widgets xml + +qtHaveModule(printsupport): QT += printsupport + +QMAKE_CXXFLAGS += -std=c++14 + +# disable qDebug() in release +CONFIG( release, debug|release ) { + message("Release build") + DEFINES += QT_NO_DEBUG_OUTPUT +} + +# Below are the three platform specific project configurations for WINDOWS, LINUX and MAC + +# WINDOWS ########## +win32 { + message("Using WINDOWS project configuration.") + + CONFIG( debug, debug|release ) { + LIBS += -L..\qwt-6.1.6\lib -lqwtd # debug + } else { + LIBS += -L..\qwt-6.1.6\lib -lqwt # release + CONFIG+=force_debug_info # keep debug infos (even in release build) to be able to link stacktrace address to actual function + CONFIG+=separate_debug_info # separate debug infos into a .exe.debug to not grow the .exe + } + + # NOTE: RC_FILE is Windows only, breaks Mac (and Linux?) builds if it in their scope. + RC_FILE = DFTFringe.rc + + INCLUDEPATH += ..\qwt-6.1.6\src + INCLUDEPATH += ..\build_armadillo\tmp\include + INCLUDEPATH += ..\build_openCV\install\include + INCLUDEPATH += ..\build_libraw\install\include # LibRaw for camera RAW support + DEFINES += LIBRAW_NODLL # link LibRaw statically (no __declspec(dllimport)) + + LIBS += -L..\build_lapack\bin -llibblas + LIBS += -L..\build_lapack\bin -lliblapack + LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_calib3d460 + LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_core460 + LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_features2d460 + LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_highgui460 + LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_imgcodecs460 + LIBS += -L..\build_openCV\install\x64\mingw\bin -llibopencv_imgproc460 + LIBS += -L..\build_libraw\install\lib -lraw # LibRaw (static) for camera RAW support + LIBS += -lws2_32 # Winsock: LibRaw needs htons/ntohs/htonl/ntohl on Windows + LIBS += -ldbghelp # for SetUnhandledExceptionFilter + LIBS += -lz # zip compression library needed for cnpy.cpp + + # This is for armadillo to not use wrapper. See https://gitlab.com/conradsnicta/armadillo-code#6-linux-and-macos-compiling-and-linking + DEFINES += ARMA_DONT_USE_WRAPPER +} + +# LINUX ############ +unix: !mac { + message("Using LINUX project configuration.") + contains( CONFIG,debug ) { message("no extra debug libraries") } + + INCLUDEPATH += /usr/include/opencv4 + INCLUDEPATH += /usr/include/qwt + + LIBS += -larmadillo + LIBS += -lGLU + LIBS += -lopencv_calib3d + LIBS += -lopencv_core + LIBS += -lopencv_features2d + LIBS += -lopencv_highgui + LIBS += -lopencv_imgcodecs + LIBS += -lopencv_imgproc + LIBS += -lopencv_imgproc + LIBS += -lqwt-qt5 + LIBS += -lz # zip compression library needed for cnpy.cpp + +} + +# MAC ############## +macx { + message("Using MACOS project configuration.") + message( ................................ ) + message("..........PRO FILE: $$_PRO_FILE_") + message("......PRO FILE PWD: $$_PRO_FILE_PWD_") + message( ................... ) + + CONFIG += app_bundle + CONFIG += sdk_no_version_check + CONFIG += link_pkgconfig + CONFIG += silent + + QMAKE_FULL_VERSION=APP_VERSION + QMAKE_MACOSX_DEPLOYMENT_TARGET = 11.0 + QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64 + + CONFIG( debug, debug|release ) { DESTDIR = build/debug } + CONFIG( release, debug|release ) { DESTDIR = build/release } + + MOC_DIR = $$DESTDIR/.moc + OBJECTS_DIR = $$DESTDIR/.obj #these change between build and release. + RCC_DIR = $$DESTDIR/.qrc + UI_DIR = $$DESTDIR/.ui + QMAKE_MKDIR = /usr/local/bin/mkdir # This tells QMAKE which mkdir command to use. + QMAKE_PKG_CONFIG = /opt/homebrew/bin/pkg-config # This tells QMAKE which pkg-config executable to use. + PKG_CONFIG_PATH = $$[QT_INSTALL_LIBS]/pkgconfig + INCLUDEPATH += -I$$[QT_INSTALL_PLUGINS] + LIBS += -L$$[QT_INSTALL_PLUGINS] + PKGCONFIG += armadillo opencv Qt5Qwt6 + + message(........QT_VERSION: $$[QT_VERSION]) + message(.QT_INSTALL_PREFIX: $$[QT_INSTALL_PREFIX]) + message(QT_INSTALL_HEADERS: $$[QT_INSTALL_HEADERS]) + message(...QT_INSTALL_LIBS: $$[QT_INSTALL_LIBS]) + message(QT_INSTALL_PLUGINS: $$[QT_INSTALL_PLUGINS]) + message(...................) + message(...........DESTDIR: $$DESTDIR) + message(...........MOC_DIR: $$MOC_DIR) + message(.......OBJECTS_DIR: $$OBJECTS_DIR) + message(...........RCC_DIR: $$RCC_DIR) + message(............UI_DIR: $$UI_DIR) + message(...................) + message(.......QMAKE_MKDIR: $$QMAKE_MKDIR) + message(..QMAKE_PKG_CONFIG: $$QMAKE_PKG_CONFIG) + message(...PKG_CONFIG_PATH: $$PKG_CONFIG_PATH) + message(.......INCLUDEPATH: $$INCLUDEPATH) + message(..............LIBS: $$LIBS) + message(.........PKGCONFIG: $$PKGCONFIG) + message(............CONFIG: $$CONFIG) +} + +# Below are the includes for source files and other resources, sorted alphabetically. ################################## +# If a filename contains spaces it will need quoting. + + +RESOURCES += DFTResources.qrc + +TRANSLATIONS += dftfringe_fr.ts + +INCLUDEPATH += ./bezier ./SingleApplication ./zernike ./cnpy + +SOURCES += SingleApplication/singleapplication.cpp \ + SingleApplication/singleapplication_p.cpp \ + zernike/zapm.cpp \ + annulushelpdlg.cpp \ + arbitrarywavefronthelp.cpp \ + arbitrarywavwidget.cpp \ + astigpolargraph.cpp \ + astigscatterplot.cpp \ + astigstatsdlg.cpp \ + autoinvertdlg.cpp \ + averagewavefrontfilesdlg.cpp \ + batchigramwizard.cpp \ + bathastigdlg.cpp \ + camcalibrationreviewdlg.cpp \ + cameracalibwizard.cpp \ + camwizardpage1.cpp \ + ccswappeddlg.cpp \ + circlefit.cpp \ + circleoutline.cpp \ + cnpy/cnpy.cpp \ + colorchannel.cpp \ + colorchanneldisplay.cpp \ + colormapviewerdlg.cpp \ + contourplot.cpp \ + contourrulerparams.cpp \ + contourtools.cpp \ + contourview.cpp \ + counterrotationdlg.cpp \ + cpoint.cpp \ + defocusdlg.cpp \ + dftarea.cpp \ + dftcolormap.cpp \ + dftthumb.cpp \ + dfttools.cpp \ + edgeplot.cpp \ + filteroutlinesdlg.cpp \ + foucaultview.cpp \ + generatetargetdlg.cpp \ + graphicsutilities.cpp \ + helpdlg.cpp \ + hotkeysdlg.cpp \ + igramarea.cpp \ + igramintensity.cpp \ + imagehisto.cpp \ + intensityplot.cpp \ + jitteroutlinedlg.cpp \ + lensetablemodel.cpp \ + main.cpp \ + mainwindow.cpp \ + messagereceiver.cpp \ + metricsdisplay.cpp \ + mirrordlg.cpp \ + myplotpicker.cpp \ + myutils.cpp \ + nullmarginhelpdlg.cpp \ + nullvariationdlg.cpp \ + oglrendered.cpp \ + oglview.cpp \ + outlinedialog.cpp \ + outlinehelpdocwidget.cpp \ + outlineplots.cpp \ + outlinestatsdlg.cpp \ + pdfcalibrationdlg.cpp \ + percentcorrectiondlg.cpp \ + pixelstats.cpp \ + plotcolor.cpp \ + profilecurve.cpp \ + profileplot.cpp \ + profileplotpicker.cpp \ + ronchicomparedialog.cpp \ + psfplot.cpp \ + psi_dlg.cpp \ + psiphasedisplay.cpp \ + psitiltoptions.cpp \ + punwrap.cpp \ + rawimage.cpp \ + regionedittools.cpp \ + rejectedwavefrontsdlg.cpp \ + reportdlg.cpp \ + reviewwindow.cpp \ + rmsplot.cpp \ + rotationdlg.cpp \ + settings2.cpp \ + settingsdebug.cpp \ + settingsdft.cpp \ + settingsGeneral2.cpp \ + settingsigram.cpp \ + settingsigramimportconfig.cpp \ + settingsprofile.cpp \ + showaliasdlg.cpp \ + showallcontoursdlg.cpp \ + simigramdlg.cpp \ + simulationsview.cpp \ + standastigwizard.cpp \ + startestmoviedlg.cpp \ + statsview.cpp \ + subtractwavefronatsdlg.cpp \ + surface3dcontrolsdlg.cpp \ + surfaceanalysistools.cpp \ + surfacegraph.cpp \ + surfacelightingproxy.cpp \ + surfacemanager.cpp \ + wavefrontloaderworker.cpp \ + transformwavefrontdlg.cpp \ + unwraperrorsview.cpp \ + usercolormapdlg.cpp \ + userdrawnprofiledlg.cpp \ + utils.cpp \ + vortexdebug.cpp \ + wavefront.cpp \ + wavefrontaveragefilterdlg.cpp \ + wavefrontfilterdlg.cpp \ + wftexaminer.cpp \ + wftstats.cpp \ + zernikedlg.cpp \ + zernikeeditdlg.cpp \ + zernikepolar.cpp \ + zernikeprocess.cpp \ + zernikes.cpp \ + zernikesmoothingdlg.cpp + +HEADERS += bezier/bezier.h \ + SingleApplication/singleapplication_p.h \ + SingleApplication/singleapplication.h \ + zernike/zapm_interface.h \ + annulushelpdlg.h \ + arbitrarywavefronthelp.h \ + astigpolargraph.h \ + arbitrarywavwidget.h \ + astigscatterplot.h \ + astigstatsdlg.h \ + autoinvertdlg.h \ + averagewavefrontfilesdlg.h \ + batchigramwizard.h \ + bathastigdlg.h \ + camcalibrationreviewdlg.h \ + cameracalibwizard.h \ + camwizardpage1.h \ + ccswappeddlg.h \ + circle.h \ + circleoutline.h \ + circleutils.h \ + cnpy/cnpy.h \ + colorchannel.h \ + colorchanneldisplay.h \ + colormapviewerdlg.h \ + contourplot.h \ + contourrulerparams.h \ + contourtools.h \ + contourview.h \ + counterrotationdlg.h \ + cpoint.h \ + defocusdlg.h \ + dftarea.h \ + dftcolormap.h \ + dftthumb.h \ + dfttools.h \ + edgeplot.h \ + filteroutlinesdlg.h \ + foucaultview.h \ + generatetargetdlg.h \ + graphicsutilities.h \ + helpdlg.h \ + hotkeysdlg.h \ + IgramArea.h \ + igramintensity.h \ + imagehisto.h \ + intensityplot.h \ + jitteroutlinedlg.h \ + lensetablemodel.h \ + mainwindow.h \ + messagereceiver.h \ + metricsdisplay.h \ + mirrordlg.h \ + myplotpicker.h \ + myutils.h \ + nullmarginhelpdlg.h \ + nullvariationdlg.h \ + oglrendered.h \ + oglview.h \ + outlinedialog.h \ + outlinehelpdocwidget.h \ + outlineplots.h \ + outlinestatsdlg.h \ + pdfcalibrationdlg.h \ + percentcorrectiondlg.h \ + percentCorrectionSurface.h \ + pixelstats.h \ + plotcolor.h \ + profilecurve.h \ + profileplot.h \ + profileplotpicker.h \ + ronchicomparedialog.h \ + psfplot.h \ + psi_dlg.h \ + psiphasedisplay.h \ + psitiltoptions.h \ + punwrap.h \ + rawimage.h \ + regionedittools.h \ + rejectedwavefrontsdlg.h \ + reportdlg.h \ + reviewwindow.h \ + rmsplot.h \ + rotationdlg.h \ + settings2.h \ + settingsdebug.h \ + settingsdft.h \ + settingsGeneral2.h \ + settingsigram.h \ + settingsigramimportconfig.h \ + settingsprofile.h \ + showaliasdlg.h \ + showallcontoursdlg.h \ + simigramdlg.h \ + simulationsview.h \ + standastigwizard.h \ + startestmoviedlg.h \ + statsview.h \ + subtractwavefronatsdlg.h \ + surface3dcontrolsdlg.h \ + surfaceanalysistools.h \ + surfacegraph.h \ + surfacelightingproxy.h \ + surfacemanager.h \ + wavefrontloaderworker.h \ + transformwavefrontdlg.h \ + unwraperrorsview.h \ + usercolormapdlg.h \ + userdrawnprofiledlg.h \ + utils.h \ + vortexdebug.h \ + wavefront.h \ + wavefrontaveragefilterdlg.h \ + wavefrontfilterdlg.h \ + wftexaminer.h \ + wftstats.h \ + zernikedlg.h \ + zernikeeditdlg.h \ + zernikepolar.h \ + zernikeprocess.h \ + zernikes.h \ + zernikesmoothingdlg.h + +FORMS += arbitrarywavefronthelp.ui \ + annulushelpdlg.ui \ + astigpolargraph.ui \ + astigstatsdlg.ui \ + autoinvertdlg.ui \ + averagewavefrontfilesdlg.ui \ + batchigramwizard.ui \ + bathastigdlg.ui \ + camcalibrationreviewdlg.ui \ + cameracalibwizard.ui \ + camwizardpage1.ui \ + ccswappeddlg.ui \ + colorchanneldisplay.ui \ + colormapviewerdlg.ui \ + contourrulerparams.ui \ + contourtools.ui \ + contourview.ui \ + counterrotationdlg.ui \ + defocusdlg.ui \ + dftarea.ui \ + dftthumb.ui \ + dfttools.ui \ + edgeplot.ui \ + filteroutlinesdlg.ui \ + foucaultview.ui \ + generatetargetdlg.ui \ + helpdlg.ui \ + hotkeysdlg.ui \ + igramintensity.ui \ + jitteroutlinedlg.ui \ + mainwindow.ui \ + metricsdisplay.ui \ + mirrordlg.ui \ + nullmarginhelpdlg.ui \ + nullvariationdlg.ui \ + oglrendered.ui \ + outlinedialog.ui \ + outlinehelpdocwidget.ui \ + outlineplots.ui \ + outlinestatsdlg.ui \ + pdfcalibrationdlg.ui \ + percentcorrectiondlg.ui \ + pixelstats.ui \ + profileplot.ui \ + psfplot.ui \ + psi_dlg.ui \ + psiphasedisplay.ui \ + psitiltoptions.ui \ + regionedittools.ui \ + rejectedwavefrontsdlg.ui \ + reportdlg.ui \ + reviewwindow.ui \ + rotationdlg.ui \ + settings2.ui \ + settingsdebug.ui \ + settingsdft.ui \ + settingsGeneral2.ui \ + settingsigram.ui \ + settingsigramimportconfig.ui \ + settingsprofile.ui \ + showaliasdlg.ui \ + showallcontoursdlg.ui \ + simigramdlg.ui \ + simulationsview.ui \ + standastigwizard.ui \ + startestmoviedlg.ui \ + statsview.ui \ + subtractwavefronatsdlg.ui \ + surface3dcontrolsdlg.ui \ + surfaceanalysistools.ui \ + transformwavefrontdlg.ui \ + unwraperrorsview.ui \ + usercolormapdlg.ui \ + userdrawnprofiledlg.ui \ + vortexdebug.ui \ + wavefrontaveragefilterdlg.ui \ + wavefrontfilterdlg.ui \ + wftexaminer.ui \ + zernikedlg.ui \ + zernikeeditdlg.ui \ + zernikesmoothingdlg.ui + +DISTFILES += buildingDFTFringe64.txt \ + ColorMaps/Dale1.cmp \ + ColorMaps/Dale2.cmp \ + ColorMaps/Dale3.cmp \ + ColorMaps/Diverging_BrBG.cmp \ + ColorMaps/Diverging_bwr.cmp \ + ColorMaps/Diverging_coolwarm.cmp \ + ColorMaps/Diverging_PiYG.cmp \ + ColorMaps/Diverging_PRGn.cmp \ + ColorMaps/Diverging_PuOr.cmp \ + ColorMaps/Diverging_RdBu.cmp \ + ColorMaps/Diverging_RdGy.cmp \ + ColorMaps/Diverging_RdYlBu.cmp \ + ColorMaps/Diverging_RdYlGn.cmp \ + ColorMaps/Diverging_seismic.cmp \ + ColorMaps/Diverging_Spectral.cmp \ + ColorMaps/Miscellaneous_brg.cmp \ + ColorMaps/Miscellaneous_CMRmap.cmp \ + ColorMaps/Miscellaneous_cubehelix.cmp \ + ColorMaps/Miscellaneous_flag.cmp \ + ColorMaps/Miscellaneous_gist_earth.cmp \ + ColorMaps/Miscellaneous_gist_ncar.cmp \ + ColorMaps/Miscellaneous_gist_rainbow.cmp \ + ColorMaps/Miscellaneous_gist_stern.cmp \ + ColorMaps/Miscellaneous_gnuplot.cmp \ + ColorMaps/Miscellaneous_gnuplot2.cmp \ + ColorMaps/Miscellaneous_hsv.cmp \ + ColorMaps/Miscellaneous_jet.cmp \ + ColorMaps/Miscellaneous_nipy_spectral.cmp \ + ColorMaps/Miscellaneous_ocean.cmp \ + ColorMaps/Miscellaneous_prism.cmp \ + ColorMaps/Miscellaneous_rainbow.cmp \ + ColorMaps/Miscellaneous_terrain.cmp \ + "ColorMaps/Perceptually Uniform Sequential_inferno.cmp" \ + "ColorMaps/Perceptually Uniform Sequential_magma.cmp" \ + "ColorMaps/Perceptually Uniform Sequential_plasma.cmp" \ + "ColorMaps/Perceptually Uniform Sequential_viridis.cmp" \ + ColorMaps/Qualitative_Accent.cmp \ + ColorMaps/Qualitative_Dark2.cmp \ + ColorMaps/Qualitative_Paired.cmp \ + ColorMaps/Qualitative_Pastel1.cmp \ + ColorMaps/Qualitative_Pastel2.cmp \ + ColorMaps/Qualitative_Set1.cmp \ + ColorMaps/Qualitative_Set2.cmp \ + ColorMaps/Qualitative_Set3.cmp \ + "ColorMaps/Sequential (2)_afmhot.cmp" \ + "ColorMaps/Sequential (2)_autumn.cmp" \ + "ColorMaps/Sequential (2)_bone.cmp" \ + "ColorMaps/Sequential (2)_cool.cmp" \ + "ColorMaps/Sequential (2)_copper.cmp" \ + "ColorMaps/Sequential (2)_gist_heat.cmp" \ + "ColorMaps/Sequential (2)_gray.cmp" \ + "ColorMaps/Sequential (2)_hot.cmp" \ + "ColorMaps/Sequential (2)_pink.cmp" \ + "ColorMaps/Sequential (2)_spring.cmp" \ + "ColorMaps/Sequential (2)_summer.cmp" \ + "ColorMaps/Sequential (2)_winter.cmp" \ + ColorMaps/Sequential_Blues.cmp \ + ColorMaps/Sequential_BuGn.cmp \ + ColorMaps/Sequential_BuPu.cmp \ + ColorMaps/Sequential_GnBu.cmp \ + ColorMaps/Sequential_Greens.cmp \ + ColorMaps/Sequential_Greys.cmp \ + ColorMaps/Sequential_Oranges.cmp \ + ColorMaps/Sequential_OrRd.cmp \ + ColorMaps/Sequential_PuBu.cmp \ + ColorMaps/Sequential_PuBuGn.cmp \ + ColorMaps/Sequential_PuRd.cmp \ + ColorMaps/Sequential_Purples.cmp \ + ColorMaps/Sequential_RdPu.cmp \ + ColorMaps/Sequential_Reds.cmp \ + ColorMaps/Sequential_YlGn.cmp \ + ColorMaps/Sequential_YlGnBu.cmp \ + ColorMaps/Sequential_YlOrBr.cmp \ + ColorMaps/Sequential_YlOrRd.cmp \ + ColorMaps/spring.cmp \ + COPYING.LESSER.txt \ + COPYING.txt \ + README.md \ + RevisionHistory.html + + + + From 6726ea160e8821b300715df03af8754124d599a2 Mon Sep 17 00:00:00 2001 From: sotisbg Date: Sat, 25 Jul 2026 21:44:52 +0300 Subject: [PATCH 8/9] Fit selected max order on Import Current Wavefront Import Current Wavefront copied wf->InputZerns, which is fitted with zernikePolar and capped at Z_TERMS (49 = order 12), ignoring the max order spinbox. Re-fit the current wavefront with ZernFitWavefront (zpmC) at the selected order instead, so order 22 yields all 144 coefficients. A subsequent Save then writes the actually-selected term count to the .zrn file. Keep m_zernEnables sized to the term count when the order changes. Co-Authored-By: Claude Opus 4.8 --- zernikeeditdlg.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/zernikeeditdlg.cpp b/zernikeeditdlg.cpp index f7815d2d..8a4972e3 100644 --- a/zernikeeditdlg.cpp +++ b/zernikeeditdlg.cpp @@ -149,11 +149,24 @@ void zernikeEditDlg::on_useCurrent_clicked() QMessageBox::warning(0,"No wave fronts available!", "First load or create a wave front"); return; } - m_zernEnables = zernEnables; - tableModel->blockSignals(true); + wavefront *wf = m_sm->m_wavefronts[m_sm->m_currentNdx]; + + // Re-fit the current wavefront to the max order selected in this dialog. + // wf->InputZerns is fitted with zernikePolar which is capped at Z_TERMS (49, + // i.e. order 12); ZernFitWavefront uses zpmC and honours m_maxOrder, so at + // order 22 it returns all (maxOrder/2+1)^2 = 144 coefficients in the same + // sequential order as the .zrn file. This is what makes a later Save write + // the actually-selected number of terms. + zernikeProcess &zp = *zernikeProcess::get_Instance(); + zp.setMaxOrder(m_maxOrder); + std::vector zs = zp.ZernFitWavefront(*wf); + if (zs.empty()) // fit cancelled by the user + return; - tableModel->setValues(m_sm->m_wavefronts[m_sm->m_currentNdx]->InputZerns,m_sm->m_wavefronts[m_sm->m_currentNdx]->useSANull ); - ui->sizeSb->setValue(m_sm->m_wavefronts[m_sm->m_currentNdx]->data.cols); + m_zernEnables.assign(zs.size(), true); + tableModel->blockSignals(true); + tableModel->setValues(zs, wf->useSANull); + ui->sizeSb->setValue(wf->data.cols); tableModel->blockSignals(false); tableModel->update(); } @@ -174,6 +187,7 @@ void zernikeEditDlg::on_maxOrder_valueChanged(int arg1) m_noOfTerms = zp.getNumberOfTerms(); ui->numberOfTerms->setText(QString("%1 Terms").arg(m_noOfTerms)); tableModel->resizeRows(m_noOfTerms); + m_zernEnables.resize(m_noOfTerms, true); // keep enables in sync with the term count emit termCountChanged(m_noOfTerms); } From 26f12ffcedf5dc42abc31e5f3fd5b1645844817f Mon Sep 17 00:00:00 2001 From: sotisbg Date: Sat, 25 Jul 2026 21:50:15 +0300 Subject: [PATCH 9/9] make-release: build the RAW installer with Qt5 Point the release workflow at build-windows-QT5.yml (Qt 5.15.2) and pull the DFTFringe-windows-build-artifact-QT5 artifact so the drafted installer is DFTFringeInstaller_QT5_.exe instead of the Qt6 build. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/make-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index 4e92b218..9b583323 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -29,7 +29,7 @@ jobs: # acually build the artifacts that will be uploaded to release call-build-windows: needs: check-semver - uses: ./.github/workflows/build-windows.yml + uses: ./.github/workflows/build-windows-QT5.yml # linux build is mainly here to check it builds. We have no acrtifact now. call-build-linux: permissions: @@ -45,7 +45,7 @@ jobs: # get artifact uploaded from build workflow - uses: actions/download-artifact@v4 with: - name: DFTFringe-windows-build-artifact + name: DFTFringe-windows-build-artifact-QT5 # create the GitHub release and upload the artifacts - name: publish Release uses: softprops/action-gh-release@v1 @@ -59,5 +59,5 @@ jobs: # an automated release note is generated based on PRs to master generate_release_notes: true files: | - DFTFringeInstaller_${{github.ref_name}}.exe + DFTFringeInstaller_QT5_${{github.ref_name}}.exe Z_DFTFringe.exe.debug