Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions .github/workflows/build-linux-QT5.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build-linux-clazy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
66 changes: 65 additions & 1 deletion .github/workflows/build-windows-QT5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
workflow_dispatch:
workflow_call:
Expand All @@ -13,6 +15,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

Expand Down Expand Up @@ -231,9 +234,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,
Expand Down Expand Up @@ -281,6 +335,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
Expand Down Expand Up @@ -326,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
Expand Down
65 changes: 63 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -338,7 +399,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::"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
53 changes: 53 additions & 0 deletions BUILD_RAW_NOTES.md
Original file line number Diff line number Diff line change
@@ -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 → свали построения артефакт.
10 changes: 9 additions & 1 deletion DFTFringe.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -55,6 +57,8 @@ 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 += -lws2_32 # Winsock: LibRaw needs htons/ntohs/htonl/ntohl on Windows
LIBS += -ldbghelp # for SetUnhandledExceptionFilter
LIBS += -lz # zip compression library needed for cnpy.cpp

Expand All @@ -70,6 +74,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

Expand All @@ -82,6 +87,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
}

Expand Down Expand Up @@ -114,7 +120,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])
Expand Down Expand Up @@ -222,6 +228,7 @@ SOURCES += SingleApplication/singleapplication.cpp \
psiphasedisplay.cpp \
psitiltoptions.cpp \
punwrap.cpp \
rawimage.cpp \
regionedittools.cpp \
rejectedwavefrontsdlg.cpp \
reportdlg.cpp \
Expand Down Expand Up @@ -344,6 +351,7 @@ HEADERS += bezier/bezier.h \
psiphasedisplay.h \
psitiltoptions.h \
punwrap.h \
rawimage.h \
regionedittools.h \
rejectedwavefrontsdlg.h \
reportdlg.h \
Expand Down
Loading
Loading