├── .clang-format
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows
│ ├── build.yml
│ └── release.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .vscode
└── settings.json
├── AppRun
├── CMakeLists.txt
├── CONTRIBUTING.md
├── Doxyfile.in
├── LICENSE
├── LeanHRPT-Decode.desktop
├── LeanHRPT-Decode.rc
├── README.md
├── calibration.ini
├── cmake
└── mingw-w64-x86_64.cmake
├── docker
├── build.sh
├── debian_bullseye
│ └── Dockerfile
└── ubuntu_jammy
│ └── Dockerfile
├── gradients.ini
├── images
├── .gitattributes
├── fy.webp
├── gui.webp
├── ir.webp
└── metop.webp
├── logo.svg
├── logo128.ico
├── presets.ini
├── projection.ini
├── src
├── commandline.cpp
├── commandline.h
├── config
│ ├── config.h
│ ├── gradient.h
│ ├── inipp.h
│ └── preset.h
├── decoders
│ ├── common
│ │ ├── aip.h
│ │ ├── amsu.h
│ │ └── tip.h
│ ├── decoder.cpp
│ ├── decoder.h
│ ├── fengyun_hrpt.cpp
│ ├── fengyun_hrpt.h
│ ├── meteor_hrpt.cpp
│ ├── meteor_hrpt.h
│ ├── meteor_lrpt.cpp
│ ├── meteor_lrpt.h
│ ├── metop_hrpt.cpp
│ ├── metop_hrpt.h
│ ├── noaa_dsb.h
│ ├── noaa_gac.cpp
│ ├── noaa_gac.h
│ ├── noaa_hrpt.cpp
│ └── noaa_hrpt.h
├── fingerprint.cpp
├── fingerprint.h
├── geo
│ ├── crs.cpp
│ ├── crs.h
│ ├── geodetic.h
│ ├── geolocation.cpp
│ ├── geolocation.h
│ ├── matrix.h
│ └── vector.h
├── geometry.cpp
├── geometry.h
├── image
│ ├── calibration.cpp
│ ├── calibration.h
│ ├── compositor.cpp
│ ├── compositor.h
│ ├── raw.cpp
│ └── raw.h
├── main.cpp
├── mainwindow.cpp
├── mainwindow.h
├── map.cpp
├── map.h
├── network.cpp
├── network.h
├── orbit.h
├── projectdialog.cpp
├── projectdialog.h
├── projection.cpp
├── projection.h
├── protocol
│ ├── ccsds
│ │ ├── deframer.cpp
│ │ ├── deframer.h
│ │ ├── demuxer.cpp
│ │ └── demuxer.h
│ ├── deframer.cpp
│ ├── deframer.h
│ ├── lrpt
│ │ ├── huffman.cpp
│ │ ├── huffman.h
│ │ ├── jpeg.cpp
│ │ ├── jpeg.h
│ │ ├── packet.cpp
│ │ └── packet.h
│ ├── repack.cpp
│ ├── repack.h
│ ├── reverse.h
│ └── timestamp.h
├── qt
│ ├── mainwindow.ui
│ ├── projectdialog.ui
│ └── qpaletteview.h
├── satinfo.h
└── util.h
└── tools
├── CMakeLists.txt
├── bin2cadu.cpp
├── bin2raw16.cpp
├── cli.h
└── vcdu2cadu.cpp
/.clang-format:
--------------------------------------------------------------------------------
1 | Language: Cpp
2 | BasedOnStyle: Google
3 | IndentWidth: 4
4 | ColumnLimit: 130 # Conserative estimate considering the size of modern displays
5 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | ko_fi: xerbo
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a bug report
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A description of what the bug is
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior
15 |
16 | **Expected behavior**
17 | A description of what you expected to happen
18 |
19 | **Platform**
20 | - Linux (if so please provide the distribution and version)
21 | - Windows
22 |
23 | **Version**
24 | Put the version of LeanHRPT you're running here (and compiler and environment information if building from source)
25 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest a feature
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the feature you would like**
11 | A concise description of what you want to happen and if possible how
12 |
13 | **Additional context**
14 | Add any other context or screenshots about the feature request here
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### C++ ###
2 | # Prerequisites
3 | *.d
4 |
5 | # Compiled Object files
6 | *.slo
7 | *.lo
8 | *.o
9 | *.obj
10 |
11 | # Precompiled Headers
12 | *.gch
13 | *.pch
14 |
15 | # Linker files
16 | *.ilk
17 |
18 | # Debugger Files
19 | *.pdb
20 |
21 | # Compiled Dynamic libraries
22 | *.so
23 | *.dylib
24 | *.dll
25 |
26 | # Fortran module files
27 | *.mod
28 | *.smod
29 |
30 | # Compiled Static libraries
31 | *.lai
32 | *.la
33 | *.a
34 | *.lib
35 |
36 | # Executables
37 | *.exe
38 | *.out
39 | *.app
40 | *.AppImage
41 |
42 | ### CMake ###
43 | CMakeLists.txt.user
44 | CMakeCache.txt
45 | CMakeFiles
46 | CMakeScripts
47 | Testing
48 | Makefile
49 | cmake_install.cmake
50 | install_manifest.txt
51 | compile_commands.json
52 | CTestTestfile.cmake
53 | _deps
54 | CMakeUserPresets.json
55 |
56 | ### CMake Patch ###
57 | # External projects
58 | *-prefix/
59 |
60 | ### LeanHRPT ###
61 | # Images
62 | *.webp
63 | *.jpg
64 | *.png
65 | *.tif
66 | !images/*
67 |
68 | # Binary files
69 | *.bin
70 | *.cadu
71 | *.vcdu
72 | *.raw16
73 | *.hrp
74 |
75 | # CMake build directory
76 | build/
77 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | fail_fast: false
2 | repos:
3 | - repo: https://github.com/pre-commit/pre-commit-hooks
4 | rev: v4.3.0
5 | hooks:
6 | - id: check-added-large-files
7 | - id: end-of-file-fixer
8 | - id: mixed-line-ending
9 | args: [ --fix=lf ]
10 |
11 | - repo: https://github.com/pocc/pre-commit-hooks
12 | rev: v1.3.5
13 | hooks:
14 | - id: clang-format
15 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "cSpell.words": [
3 | "AHRPT",
4 | "AMSU-A",
5 | "AVHRR",
6 | "backscan",
7 | "CADU",
8 | "CCSDS",
9 | "CPPDU",
10 | "deframer",
11 | "demod",
12 | "demuxer",
13 | "FengYun",
14 | "HIRS",
15 | "HRPT",
16 | "Imager",
17 | "imagers",
18 | "LeanHRPT",
19 | "libpredict",
20 | "LRPT",
21 | "MetOp",
22 | "MPDU",
23 | "MSUMR",
24 | "MTVZA",
25 | "MWIR",
26 | "NOAA",
27 | "POES",
28 | "shapefile",
29 | "shapefiles",
30 | "SWIR",
31 | "syncword",
32 | "VCDU",
33 | "VCID",
34 | "VIRR",
35 | "Xerbo"
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/AppRun:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | export HERE="$(dirname "$(readlink -f "${0}")")"
3 | export PATH="${HERE}/usr/bin/:${PATH}"
4 | export LD_LIBRARY_PATH="${HERE}/usr/lib/"
5 |
6 | EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | cut -d "=" -f 2)
7 | exec "${EXEC}" "$@"
8 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.0.0)
2 | project(LeanHRPT-Decode CXX)
3 |
4 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
5 | set(CMAKE_BUILD_TYPE Release)
6 |
7 | add_subdirectory(tools)
8 |
9 | set(CMAKE_AUTOMOC ON)
10 | set(CMAKE_AUTORCC ON)
11 | set(CMAKE_AUTOUIC ON)
12 |
13 | # Generate with `find src/ | grep "\\.cpp" | sort`
14 | file(GLOB_RECURSE CXX_SOURCE_FILES
15 | src/commandline.cpp
16 | src/decoders/decoder.cpp
17 | src/decoders/fengyun_hrpt.cpp
18 | src/decoders/meteor_hrpt.cpp
19 | src/decoders/meteor_lrpt.cpp
20 | src/decoders/metop_hrpt.cpp
21 | src/decoders/noaa_gac.cpp
22 | src/decoders/noaa_hrpt.cpp
23 | src/fingerprint.cpp
24 | src/geo/crs.cpp
25 | src/geo/geolocation.cpp
26 | src/geometry.cpp
27 | src/image/calibration.cpp
28 | src/image/compositor.cpp
29 | src/image/raw.cpp
30 | src/main.cpp
31 | src/mainwindow.cpp
32 | src/map.cpp
33 | src/network.cpp
34 | src/projectdialog.cpp
35 | src/projection.cpp
36 | src/protocol/ccsds/deframer.cpp
37 | src/protocol/ccsds/demuxer.cpp
38 | src/protocol/deframer.cpp
39 | src/protocol/lrpt/huffman.cpp
40 | src/protocol/lrpt/jpeg.cpp
41 | src/protocol/lrpt/packet.cpp
42 | src/protocol/repack.cpp
43 | )
44 | IF (WIN32)
45 | add_executable(LeanHRPT-Decode WIN32 ${CXX_SOURCE_FILES} LeanHRPT-Decode.rc)
46 | ELSE()
47 | add_executable(LeanHRPT-Decode ${CXX_SOURCE_FILES})
48 | ENDIF()
49 |
50 | set_property(TARGET LeanHRPT-Decode PROPERTY CXX_EXTENSIONS OFF)
51 | set_property(TARGET LeanHRPT-Decode PROPERTY CXX_STANDARD 14)
52 |
53 | target_include_directories(LeanHRPT-Decode PUBLIC src)
54 |
55 | target_compile_options(LeanHRPT-Decode PRIVATE -Wall -Wextra -Wpedantic)
56 |
57 | if (USE_ADDRESS_SANITIZER)
58 | target_compile_options(LeanHRPT-Decode PRIVATE -fsanitize=address -fno-omit-frame-pointer -g)
59 | target_link_options(LeanHRPT-Decode PRIVATE -fsanitize=address)
60 | endif()
61 |
62 | find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
63 | find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
64 | find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Network REQUIRED)
65 | target_link_libraries(LeanHRPT-Decode PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
66 | target_link_libraries(LeanHRPT-Decode PRIVATE Qt${QT_VERSION_MAJOR}::Network)
67 |
68 | find_library(MUPARSER_PATH NAMES muparser NO_CACHE REQUIRED)
69 | target_link_libraries(LeanHRPT-Decode PUBLIC ${MUPARSER_PATH})
70 | find_library(LIBPREDICT_PATH NAMES predict NO_CACHE REQUIRED)
71 | target_link_libraries(LeanHRPT-Decode PUBLIC ${LIBPREDICT_PATH})
72 | find_library(SHAPELIB_PATH NAMES shp NO_CACHE REQUIRED)
73 | target_link_libraries(LeanHRPT-Decode PUBLIC ${SHAPELIB_PATH})
74 |
75 | find_package(OpenMP)
76 | if(OpenMP_CXX_FOUND)
77 | target_link_libraries(LeanHRPT-Decode PRIVATE OpenMP::OpenMP_CXX)
78 | endif()
79 |
80 | # Get version from git
81 | find_package(Git)
82 | if (GIT_FOUND)
83 | execute_process(COMMAND ${GIT_EXECUTABLE} describe --tag WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} OUTPUT_VARIABLE GIT_TAG OUTPUT_STRIP_TRAILING_WHITESPACE)
84 | set(VERSION "${GIT_TAG}")
85 | else()
86 | set(VERSION "Unknown")
87 | endif()
88 | target_compile_definitions(LeanHRPT-Decode PRIVATE "VERSION=\"${VERSION}\"")
89 |
90 | # Binaries
91 | install(TARGETS LeanHRPT-Decode RUNTIME DESTINATION bin)
92 | # Desktop file and icon
93 | install(FILES ${CMAKE_SOURCE_DIR}/LeanHRPT-Decode.desktop DESTINATION share/applications)
94 | install(FILES ${CMAKE_SOURCE_DIR}/logo128.ico DESTINATION share/icons/hicolor/128x128/apps RENAME LeanHRPT-Decode.png)
95 | install(FILES ${CMAKE_SOURCE_DIR}/logo.svg DESTINATION share/icons/hicolor/scalable/apps RENAME LeanHRPT-Decode.svg)
96 | configure_file(logo128.ico logo128.ico COPYONLY)
97 | configure_file(logo.svg logo.svg COPYONLY)
98 | # Config files
99 | install(FILES ${CMAKE_SOURCE_DIR}/projection.ini DESTINATION share/leanhrpt)
100 | install(FILES ${CMAKE_SOURCE_DIR}/calibration.ini DESTINATION share/leanhrpt)
101 | install(FILES ${CMAKE_SOURCE_DIR}/presets.ini DESTINATION share/leanhrpt)
102 | install(FILES ${CMAKE_SOURCE_DIR}/gradients.ini DESTINATION share/leanhrpt)
103 | configure_file(projection.ini projection.ini COPYONLY)
104 | configure_file(calibration.ini calibration.ini COPYONLY)
105 | configure_file(presets.ini presets.ini COPYONLY)
106 | configure_file(gradients.ini gradients.ini COPYONLY)
107 |
108 | # Package information
109 | string(SUBSTRING ${VERSION} 1 -1 CPACK_PACKAGE_VERSION)
110 | set(CPACK_PACKAGE_NAME "LeanHRPT-Decode")
111 | set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An easy to use HRPT decoder")
112 | set(CPACK_PACKAGE_DESCRIPTION "LeanHRPT is an easy to use and powerful tool for the manipulation of Level 0 HRPT data.")
113 | set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/Xerbo/LeanHRPT-Decode")
114 | set(CPACK_PACKAGE_CONTACT "Xerbo (xerbo@protonmail.com)")
115 | # Debian
116 | set(CPACK_GENERATOR "DEB")
117 | set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
118 | set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
119 | set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "gdal-bin")
120 | set(CPACK_DEBIAN_PACKAGE_DEPENDS "libpredict")
121 | set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
122 |
123 | # Only allow packaging if we know what we are packaging
124 | if (NOT VERSION STREQUAL "Unknown")
125 | include(CPack)
126 | endif()
127 |
128 | option(BUILD_DOXYGEN "Create HTML/LaTeX documentation with Doxygen" OFF)
129 |
130 | if (BUILD_DOXYGEN)
131 | find_package(Doxygen)
132 | set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
133 | set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
134 | configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
135 |
136 | add_custom_target(doc_doxygen ALL
137 | COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
138 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
139 | COMMENT "Generating documentation with Doxygen"
140 | VERBATIM)
141 | endif()
142 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How To Contribute
2 |
3 | Thanks for showing an interest in improving LeanHRPT, these guidelines outline how you should go about contributing to the project.
4 |
5 | ## Did you find a bug?
6 |
7 | 1. Make sure the bug has not already been reported.
8 | 2. If an issue already exists, leave a thumbs up to "bump" the issue
9 | 3. If an issue doesn't exist, open a new one with a clear title and description and, if relevant, any files that cause the behaviour
10 |
11 | ## Do you have a patch that fixes a bug/adds a feature?
12 |
13 | 1. Fork this repository and put your changes on a *new branch*.
14 | 2. Make sure to use sensible commit names (no "Oops" commits)
15 | 3. Open a new pull request into master.
16 |
17 | If you don't have a GitHub account, you can email me the patch at `xerbo (at) protonmail (dot) com`
18 |
19 | ## Coding style
20 |
21 | The coding style of LeanHRPT is based off the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) with minor modifications (see `.clang-format`), in addition to this all files should use LF line endings and end in a newline. Use American english (i.e. color, not colour).
22 |
23 | To automate this LeanHRPT comes with [pre-commit](https://pre-commit.com/) hooks which will enforce these rules.
24 |
25 | ### Development environment
26 |
27 | LeanHRPT is developed with VSCode with the following extensions, while not required they may make your life easier:
28 |
29 | - [C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
30 | - [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)
31 | - [CMake](https://marketplace.visualstudio.com/items?itemName=twxs.cmake)
32 | - [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
33 | - [Clang-Format](https://marketplace.visualstudio.com/items?itemName=xaver.clang-format)
34 |
35 | ## Commit message style
36 |
37 | - Keep titles short to prevent wrapping (descriptions exist)
38 | - Split up large changes into multiple commits
39 | - Never use hastags for sequential counting in commits, as this interferes with issue/PR referencing
40 |
--------------------------------------------------------------------------------
/LeanHRPT-Decode.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Type=Application
3 | Name=LeanHRPT Decode
4 | Comment=An easy to use HRPT decoder
5 | Categories=HamRadio;Science
6 | Exec=LeanHRPT-Decode
7 | Icon=LeanHRPT-Decode
8 |
--------------------------------------------------------------------------------
/LeanHRPT-Decode.rc:
--------------------------------------------------------------------------------
1 | 1 ICON "logo128.ico"
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # LeanHRPT Decode
2 |
3 |
4 |
5 | [](https://github.com/Xerbo/LeanHRPT-Decode/actions/workflows/build.yml)
6 |
7 | LeanHRPT is an easy to use and powerful tool for the manipulation of Level 0 HRPT data. Also see [LeanHRPT Demod](https://github.com/Xerbo/LeanHRPT-Demod).
8 |
9 | ## Installation
10 |
11 | Compiled builds for Linux and Windows are available from the [releases](https://github.com/Xerbo/LeanHRPT-Decode/releases) page.
12 |
13 | ## Usage
14 |
15 | See the [wiki](https://github.com/Xerbo/LeanHRPT-Decode/wiki).
16 |
17 | ## Example results
18 |
19 | |FengYun-3B with the NCSWIR preset|MetOp-C SWIR with a map overlay|Projected NOAA IR image|
20 | |-|-|-|
21 | ||||
22 |
23 | ## Advanced
24 |
25 | ### Building from source
26 |
27 | You will need Qt (at least 5.14), [`muparser`](https://github.com/beltoforion/muparser), [`libpredict`](https://github.com/la1k/libpredict) and [`shapelib`](https://github.com/OSGeo/shapelib) installed.
28 |
29 | While MacOS isn't officially supported, compiling should be pretty similar to the steps below.
30 |
31 | #### Dependencies Installation
32 |
33 | ```sh
34 | # Debian/Ubuntu
35 | sudo apt install cmake gcc g++ qtbase5-dev libmuparser-dev libshp-dev
36 | git clone -b v2.0.0 https://github.com/la1k/libpredict && cd libpredict
37 | mkdir build && cd build
38 | cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ..
39 | cmake --build .
40 | sudo cmake --install .
41 | ```
42 |
43 | ```sh
44 | # Fedora
45 | sudo dnf install g++ cmake qt5-qtbase-devel muParser-devel shapelib-devel
46 | git clone -b v2.0.0 https://github.com/la1k/libpredict && cd libpredict
47 | mkdir build && cd build
48 | cmake -DCMAKE_BUILD_TYPE=Release ..
49 | cmake --build .
50 | sudo cmake --install .
51 | ```
52 |
53 | ```sh
54 | # MSYS2
55 | pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-qt5-base mingw-w64-x86_64-muparser mingw-w64-x86_64-shapelib mingw-w64-x86_64-ninja git
56 | git clone -b v2.0.0 https://github.com/la1k/libpredict && cd libpredict
57 | mkdir build && cd build
58 | cmake -DCMAKE_INSTALL_PREFIX=/mingw64 -DCMAKE_BUILD_TYPE=Release ..
59 | cmake --build .
60 | cmake --install .
61 | ```
62 |
63 | #### Development Setup
64 |
65 | ```sh
66 | mkdir build && cd build
67 | cmake ..
68 | cmake --build .
69 | ```
70 |
71 | ### Input file format
72 |
73 | Input files should be:
74 |
75 | - NOAA - raw data, raw16 or HRP
76 | - Meteor - raw data
77 | - MetOp - CADUs or VCDUs
78 | - FengYun - CADUs or VCDUs
79 |
80 | ## Credits
81 |
82 | - [`MeteorDemod`](https://github.com/Digitelektro/MeteorDemod) - geotransformation code
83 | - [JM (@g5juergenm)](https://twitter.com/g5juergenm) - testing and feedback
84 | - KentuckyFriedData - donation
85 |
--------------------------------------------------------------------------------
/calibration.ini:
--------------------------------------------------------------------------------
1 | #
2 | # LeanHRPT calibration coefficients file
3 | #
4 | # This file contains the coefficients used to calibrate channels,
5 | # currently it supports 3 types of calibration:
6 | # linear (VIRR and MSU-MR, default)
7 | # split_linear (AVHRR)
8 | # radiance (IR)
9 | #
10 | # Sources:
11 | # https://www.ospo.noaa.gov/data/ppp/notice_files/aug1021.html
12 | # http://www.nsmc.org.cn/en/NSMC/Contents/100089.html
13 | # https://www.eumetsat.int/media/49299
14 | # https://www.eumetsat.int/media/49298
15 | # NOAA KLM User's Guide, August 2014 Revision
16 | #
17 |
18 | [MetOp-A_AVHRR/1]
19 | type = split_linear
20 | a1 = 0.05747
21 | b1 = -2.324
22 | a2 = 0.1698
23 | b2 = -58.62
24 | c = 501.01
25 | [MetOp-A_AVHRR/2]
26 | type = split_linear
27 | a1 = 0.07261
28 | b1 = -2.886
29 | a2 = 0.2157
30 | b2 = -74.47
31 | c = 500.42
32 | [MetOp-A_AVHRR/3]
33 | type = split_linear
34 | a1 = 0.03539
35 | b1 = -1.454
36 | a2 = 0.2458
37 | b2 = -107.07
38 | c = 501.94
39 |
40 | [MetOp-B_AVHRR/1]
41 | type = split_linear
42 | a1 = 0.05732
43 | b1 = -2.258
44 | a2 = 0.1698
45 | b2 = -58.58
46 | c = 500.62
47 | [MetOp-B_AVHRR/2]
48 | type = split_linear
49 | a1 = 0.06435
50 | b1 = -2.598
51 | a2 = 0.1896
52 | b2 = -65.58
53 | c = 503.00
54 | [MetOp-B_AVHRR/3]
55 | type = split_linear
56 | a1 = 0.03290
57 | b1 = -1.382
58 | a2 = 0.2291
59 | b2 = -99.67
60 | c = 500.85
61 | [MetOp-B_AVHRR/4]
62 | type = radiance
63 | ns = -4.75
64 | b0 = 4.85
65 | b1 = -0.096771
66 | b2 = 0.00048091
67 | vc = 933.63
68 | a = 0.504183
69 | b = 0.998638
70 | [MetOp-B_AVHRR/5]
71 | type = radiance
72 | ns = -4.39
73 | b0 = 4.36
74 | b1 = -0.076635
75 | b2 = 0.00033524
76 | vc = 839.62
77 | a = 0.381279
78 | b = 0.998861
79 |
80 | [MetOp-C_AVHRR/1]
81 | type = split_linear
82 | a1 = 0.05506
83 | b1 = -2.223
84 | a2 = 0.1613
85 | b2 = -55.21
86 | c = 498.68
87 | [MetOp-C_AVHRR/2]
88 | type = split_linear
89 | a1 = 0.06351
90 | b1 = -2.601
91 | a2 = 0.1861
92 | b2 = -63.88
93 | c = 500.01
94 | [MetOp-C_AVHRR/3]
95 | type = split_linear
96 | a1 = 0.03269
97 | b1 = -1.326
98 | a2 = 0.2300
99 | b2 = -99.73
100 | c = 498.72
101 | [MetOp-C_AVHRR/4]
102 | type = radiance
103 | ns = -6.27
104 | b0 = 6.58
105 | b1 = -0.132030
106 | b2 = 0.00065922
107 | vc = 930.31
108 | a = 0.5899
109 | b = 0.998403
110 | [MetOp-C_AVHRR/5]
111 | type = radiance
112 | ns = -2.55
113 | b0 = 3.23
114 | b1 = -0.056920
115 | b2 = 0.00024963
116 | vc = 828.6
117 | a = 0.3781050
118 | b = 0.998854
119 |
120 | [NOAA-15_AVHRR/1]
121 | type = split_linear
122 | a1 = 0.05680
123 | b1 = -2.187
124 | a2 = 0.1633
125 | b2 = -54.99
126 | c = 496.00
127 | [NOAA-15_AVHRR/2]
128 | type = split_linear
129 | a1 = 0.05960
130 | b1 = -2.410
131 | a2 = 0.1629
132 | b2 = -55.24
133 | c = 511.00
134 | [NOAA-15_AVHRR/3]
135 | type = radiance
136 | ns = 0.0
137 | b0 = 0.0
138 | b1 = 0.0
139 | b2 = 0.0
140 | vc = 2695.9743
141 | a = 1.621256
142 | b = 0.998015
143 | [NOAA-15_AVHRR/4]
144 | type = radiance
145 | ns = -4.50
146 | b0 = 4.76
147 | b1 = -0.0932
148 | b2 = 0.0004524
149 | vc = 925.4075
150 | a = 0.337810
151 | b = 0.998719
152 | [NOAA-15_AVHRR/5]
153 | type = radiance
154 | ns = -3.61
155 | b0 = 3.83
156 | b1 = -0.0659
157 | b2 = 0.0002811
158 | vc = 839.8979
159 | a = 0.304558
160 | b = 0.999024
161 |
162 | [NOAA-18_AVHRR/1]
163 | type = split_linear
164 | a1 = 0.06168
165 | b1 = -2.432
166 | a2 = 0.1839
167 | b2 = -63.25
168 | c = 501.54
169 | [NOAA-18_AVHRR/2]
170 | type = split_linear
171 | a1 = 0.07524
172 | b1 = -2.964
173 | a2 = 0.2258
174 | b2 = -78.66
175 | c = 500.40
176 | [NOAA-18_AVHRR/3]
177 | type = radiance
178 | ns = 0.0
179 | b0 = 0.0
180 | b1 = 0.0
181 | b2 = 0.0
182 | vc = 2659.7952
183 | a = 1.698704
184 | b = 0.996960
185 | [NOAA-18_AVHRR/4]
186 | type = radiance
187 | ns = -5.53
188 | b0 = 5.82
189 | b1 = -0.11069
190 | b2 = 0.00052337
191 | vc = 928.1460
192 | a = 0.436645
193 | b = 0.998607
194 | [NOAA-18_AVHRR/5]
195 | type = radiance
196 | ns = -2.22
197 | b0 = 2.67
198 | b1 = -0.04360
199 | b2 = 0.00017715
200 | vc = 833.2532
201 | a = 0.253179
202 | b = 0.999057
203 |
204 | [NOAA-19_AVHRR/1]
205 | type = split_linear
206 | a1 = 0.05571
207 | b1 = -2.165
208 | a2 = 0.1643
209 | b2 = -56.49
210 | c = 496.43
211 | [NOAA-19_AVHRR/2]
212 | type = split_linear
213 | a1 = 0.06649
214 | b1 = -2.579
215 | a2 = 0.1981
216 | b2 = -68.37
217 | c = 500.37
218 | [NOAA-19_AVHRR/3]
219 | type = radiance
220 | ns = 0.0
221 | b0 = 0.0
222 | b1 = 0.0
223 | b2 = 0.0
224 | vc = 2670.0
225 | a = 1.67396
226 | b = 0.997364
227 | [NOAA-19_AVHRR/4]
228 | type = radiance
229 | ns = -5.49
230 | b0 = 5.70
231 | b1 = -0.11187
232 | b2 = 0.00054668
233 | vc = 928.9
234 | a = 0.53959
235 | b = 0.998534
236 | [NOAA-19_AVHRR/5]
237 | type = radiance
238 | ns = -3.39
239 | b0 = 3.58
240 | b1 = -0.05991
241 | b2 = 0.00024985
242 | vc = 831.9
243 | a = 0.36064
244 | b = 0.998913
245 |
246 | [FengYun-3B_VIRR/1]
247 | a = 0.1264
248 | b = -1.4320
249 | [FengYun-3B_VIRR/2]
250 | a = 0.1353
251 | b = -1.6236
252 | [FengYun-3B_VIRR/6]
253 | a = 0.0919
254 | b = -2.4821
255 | [FengYun-3B_VIRR/7]
256 | a = 0.0938
257 | b = -1.1494
258 | [FengYun-3B_VIRR/8]
259 | a = 0.0857
260 | b = -1.0280
261 | [FengYun-3B_VIRR/9]
262 | a = 0.0803
263 | b = -0.9636
264 | [FengYun-3B_VIRR/10]
265 | a = 0.0630
266 | b = -0.7628
267 |
268 | [FengYun-3C_VIRR/1]
269 | a = 0.1264
270 | b = -1.4320
271 | [FengYun-3C_VIRR/2]
272 | a = 0.1353
273 | b = -1.6236
274 | [FengYun-3C_VIRR/6]
275 | a = 0.0919
276 | b = -2.4821
277 | [FengYun-3C_VIRR/7]
278 | a = 0.0938
279 | b = -1.1494
280 | [FengYun-3C_VIRR/8]
281 | a = 0.0857
282 | b = -1.0280
283 | [FengYun-3C_VIRR/9]
284 | a = 0.0803
285 | b = -0.9636
286 | [FengYun-3C_VIRR/10]
287 | a = 0.0630
288 | b = -0.7628
289 |
--------------------------------------------------------------------------------
/cmake/mingw-w64-x86_64.cmake:
--------------------------------------------------------------------------------
1 | # Sample toolchain file for building for Windows from an Ubuntu Linux system.
2 | #
3 | # Typical usage:
4 | # *) install cross compiler: `sudo apt-get install mingw-w64`
5 | # *) cd build
6 | # *) cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake ..
7 |
8 | set(CMAKE_SYSTEM_NAME Windows)
9 | set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
10 |
11 | # cross compilers to use for C, C++ and Fortran
12 | set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
13 | set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
14 | set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran)
15 | set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
16 |
17 | # target environment on the build host system
18 | set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
19 |
20 | # modify default behavior of FIND_XXX() commands
21 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
22 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
23 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
24 |
--------------------------------------------------------------------------------
/docker/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd /root
3 | git clone https://github.com/la1k/libpredict.git && cd libpredict
4 | mkdir build && cd build
5 | cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ..
6 | make -j4
7 | make install
8 |
9 | cd /root/LeanHRPT-Decode
10 | mkdir build && cd build
11 | git config --global --add safe.directory /root/LeanHRPT-Decode
12 | cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release ..
13 | make -j4
14 | make package
15 |
--------------------------------------------------------------------------------
/docker/debian_bullseye/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM debian:bullseye
2 | COPY build.sh /root
3 | RUN chmod +x /root/build.sh
4 |
5 | ENV DEBIAN_FRONTEND=noninteractive
6 | ENV TZ=Etc/UTC
7 | RUN apt-get update
8 | RUN apt-get install -y git cmake g++ qtbase5-dev libmuparser-dev file dpkg-dev libshp-dev
9 |
--------------------------------------------------------------------------------
/docker/ubuntu_jammy/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:jammy
2 | COPY build.sh /root
3 | RUN chmod +x /root/build.sh
4 |
5 | ENV DEBIAN_FRONTEND=noninteractive
6 | ENV TZ=Etc/UTC
7 | RUN apt-get update
8 | RUN apt-get install -y git cmake g++ qtbase5-dev libmuparser-dev file dpkg-dev libshp-dev
9 |
--------------------------------------------------------------------------------
/gradients.ini:
--------------------------------------------------------------------------------
1 | [IronBow]
2 | author = FLIR
3 | map = 01083E,260277,530297,7B03A3,9F07A0,BA188B,D12C70,E44450,F25E30,FA7A13,FC9504,FAAF03,FBC909,FBDF29,FBEF63,F5FCBF
4 | [Lava]
5 | author = FLIR
6 | map = 0D1A44,1A4599,0760A3,03719D,028091,148186,64477B,95275D,B51D3C,D01B27,F33024,FC4B12,FD7402,FBA802,FDCE09,FEED9A
7 | [Artic]
8 | author = FLIR
9 | map = 0101AC,0105EF,043FFC,1999FB,2BDEFA,42E0E3,54B7BB,5B7F80,73635B,A3633D,CB6322,F66706,FD8D05,FCC604,FDE040,FEF1B0
10 | [Rainbow]
11 | author = FLIR
12 | map = 01054E,01297A,0246A6,045ECF,037AD3,169491,5EB42B,A9CC03,DED403,F4C709,FBA313,FD5F2A,FA1F3E,F73959,FA807C,FDC8AE
13 | [NDVI]
14 | author = NASA
15 | map = E3D6C6,E3D6C6,E3D6C6,E3D6C6,E3D6C6,E3D6C6,E3D6C6,E3D6C6,E3D6C6,E3D6C6,CFC0A2,B9AC7C,A19B52,85892E,6B771F,526321,3C4E20,263F08,132D02,132D02
16 |
--------------------------------------------------------------------------------
/images/.gitattributes:
--------------------------------------------------------------------------------
1 | fy.webp filter=lfs diff=lfs merge=lfs -text
2 | ir.webp filter=lfs diff=lfs merge=lfs -text
3 | metop.webp filter=lfs diff=lfs merge=lfs -text
4 | mhs.png filter=lfs diff=lfs merge=lfs -text
5 | gui.webp filter=lfs diff=lfs merge=lfs -text
6 |
--------------------------------------------------------------------------------
/images/fy.webp:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:7a27173662024bded4b6d917a741acbd1a1338a4b3ec5e59c307d4d76478e130
3 | size 308312
4 |
--------------------------------------------------------------------------------
/images/gui.webp:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:5819307f370e14aa93312410ee6f034d639f975c76ca59db5c921641d5461788
3 | size 181446
4 |
--------------------------------------------------------------------------------
/images/ir.webp:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:6dafe5d26c2e76648250bee90703eab2906a2ac00207bdd54c2d9e698e0c47fa
3 | size 147544
4 |
--------------------------------------------------------------------------------
/images/metop.webp:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:d007f4d75f1009a2ee8bc1b8bcc6b5ad17818708fd5c92f3303fa3f6a9035701
3 | size 1063796
4 |
--------------------------------------------------------------------------------
/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
109 |
--------------------------------------------------------------------------------
/logo128.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Xerbo/LeanHRPT-Decode/3801360ea22d8e39d81c67d7a9b09a5479b43ebc/logo128.ico
--------------------------------------------------------------------------------
/presets.ini:
--------------------------------------------------------------------------------
1 | #
2 | # LeanHRPT preset definition file
3 | #
4 | # It is formatted as ini and parsed by inipp (https://github.com/mcmtroffaes/inipp)
5 | # meaning that features like variables are supported.
6 | #
7 | # Presets for uncalibrated imagers will not function reliably over multiple files
8 |
9 | [Visible Color]
10 | description = Visible light band composite (daylight only)
11 | imagers = VIRR
12 | expression:VIRR = ch1,ch9,ch7
13 |
14 | [Natural Color (NIR)]
15 | description = Natural color using a red and near-infrared band (daylight only)
16 | imagers = AVHRR|MSU-MR|VIRR
17 | expression:AVHRR = ch2*0.6 + min(ch1,ch2)*0.4, ch2, ch1
18 | expression:MSU-MR = ch2*0.6 + min(ch1,ch2)*0.4, ch2, ch1
19 | expression:VIRR = ch2*0.6 + min(ch1,ch2)*0.4, ch2, ch1
20 |
21 | [Natural Color (SWIR)]
22 | description = Natural color using a red, near-infrared, and shortwave-infrared band (daylight only)
23 | imagers = MSU-MR|AVHRR|VIRR
24 | expression:AVHRR = 0.6*max(SWIR,min(ch2,ch1)) + 0.4*ch2, ch2, ch1
25 | expression:MSU-MR = 0.6*max(SWIR,min(ch2,ch1)) + 0.4*ch2, ch2, ch1
26 | expression:VIRR = 0.6*max(SWIR,min(ch2,ch1)) + 0.4*ch2, ch2, ch1
27 |
28 | [False Color (NIR)]
29 | description = Combination of red and near-infrared bands (daylight only)
30 | imagers = AVHRR|MSU-MR|VIRR
31 | expression:AVHRR = ch2,ch1,ch1
32 | expression:MSU-MR = ch2,ch1,ch1
33 | expression:VIRR = ch2,ch1,ch1
34 |
35 | [False Color (SWIR)]
36 | description = Combination of red, near-infrared, and shortwave-infrared bands (daylight only)
37 | imagers = AVHRR|MSU-MR|VIRR
38 | expression:AVHRR = ch3,ch2,ch1
39 | expression:MSU-MR = ch3,ch2,ch1
40 | expression:VIRR = ch6,ch2,ch1
41 |
42 | [False Color (LWIR)]
43 | description = Combination of red, near-infrared, and longwave-infrared bands (daylight only)
44 | imagers = AVHRR|MSU-MR|VIRR
45 | expression:AVHRR = ch1,ch2,ch4
46 | expression:MSU-MR = ch1,ch2,ch5
47 | expression:VIRR = ch1,ch2,ch4
48 |
49 | [NDVI]
50 | description = Normalized difference vegetation index
51 | imagers = AVHRR|MSU-MR|VIRR
52 | expression:AVHRR = (ch2-ch1)/(ch2+ch1)
53 | expression:MSU-MR = (ch2-ch1)/(ch2+ch1)
54 | expression:VIRR = (ch2-ch1)/(ch2+ch1)
55 |
56 | [NDVI Color]
57 | description = Colorized normalized difference vegetation index
58 | imagers = AVHRR|VIRR
59 | expression:AVHRR = ch2,max(ch2,((ch2-ch1)/(ch2+ch1))),ch1
60 | expression:VIRR = ch2,max(ch2,((ch2-ch1)/(ch2+ch1))),ch1
61 | # NDVI Color doesn't work with MSU-MR
62 |
63 | [Thermal Infrared]
64 | description = Longwave-infrared band (thermal, ~11000 nm)
65 | imagers = AVHRR|MSU-MR|VIRR|HIRS
66 | expression:AVHRR = ch4
67 | expression:MSU-MR = ch5
68 | expression:VIRR = ch4
69 | expression:HIRS = ch8
70 |
71 | [Volcanic Ash]
72 | description = Difference between 10.8 and 12.0 micron bands
73 | imagers = AVHRR|VIRR|MSU-MR|HIRS
74 | expression:AVHRR = ch4-ch5
75 | expression:VIRR = ch4-ch5
76 | expression:MSU-MR = ch5-ch6
77 | expression:HIRS = ch8-ch10
78 |
79 | [False Color (Land)]
80 | description = Basic false color, using any bands that achieve an approximation of land color
81 | imagers = HIRS|MHS|MTVZA|AMSU-A
82 | expression:MHS = ch1, ch1, ch2
83 | expression:HIRS = ch20, ch20, ch19
84 | expression:MTVZA = ch6*0.9+ch10*0.1, ch6, ch10
85 | expression:AMSU-A = ch1*0.6 + min(ch4,ch1)*0.4, ch2, ch4
86 |
87 | [183 GHz Water Vapor]
88 | description = False color using bands in the proximity of the 183.31 GHz water vapor peak
89 | imagers = MHS|MTVZA
90 | expression:MHS = ch3,ch4,ch5
91 | expression:MTVZA = ch28,ch29,ch30
92 |
--------------------------------------------------------------------------------
/projection.ini:
--------------------------------------------------------------------------------
1 | [NOAA-15_AVHRR]
2 | fov = 55
3 | yaw = -1.6
4 | roll = -0.1
5 | pitch = 0.0
6 | toffset = -0.03425
7 | [NOAA-18_AVHRR]
8 | fov = 54.9
9 | yaw = -1.8
10 | roll = -0.18
11 | pitch = 0
12 | toffset = -0.03425
13 | [NOAA-19_AVHRR]
14 | fov = 55.2
15 | yaw = 1.9
16 | roll = -0.08
17 | pitch = 0.0
18 | toffset = -0.03425
19 |
20 | [NOAA-18_HIRS]
21 | fov = 52.2
22 | yaw = 0.0
23 | roll = 0.0
24 | pitch = 0.0
25 | toffset = 0.0
26 | [NOAA-19_HIRS]
27 | fov = 52.2
28 | yaw = 0.0
29 | roll = 0.0
30 | pitch = 0.0
31 | toffset = 0.0
32 |
33 | # NOAA-18 MHS is dead
34 | [NOAA-19_MHS]
35 | fov = 50.0
36 | yaw = 0.0
37 | roll = 0.5
38 | pitch = 0.0
39 | toffset = 0.0
40 |
41 | [NOAA-18_AMSU-A]
42 | fov = 47.0
43 | yaw = -6.0
44 | roll = 0.0
45 | pitch = 0.0
46 | toffset = -7.0
47 | [NOAA-19_AMSU-A]
48 | fov = 47.0
49 | yaw = -6.0
50 | roll = 0.0
51 | pitch = 0.0
52 | toffset = -7.0
53 |
54 | [MetOp-A_AVHRR]
55 | fov = 55.2
56 | yaw = 0.3
57 | roll = -0.2
58 | pitch = 0.3
59 | toffset = 0.0
60 | [MetOp-B_AVHRR]
61 | fov = 55
62 | yaw = 0.1
63 | roll = 0.0
64 | pitch = 0.0
65 | toffset = -0.3
66 | [MetOp-C_AVHRR]
67 | fov = 55.1
68 | yaw = 0.2
69 | roll = -0.15
70 | pitch = 0.2
71 | toffset = 0.0
72 |
73 | [MetOp-A_MHS]
74 | fov = 50.0
75 | yaw = 0.0
76 | roll = 0.5
77 | pitch = 0.0
78 | toffset = 0.5
79 | [MetOp-B_MHS]
80 | fov = 50.0
81 | yaw = 0.0
82 | roll = 0.5
83 | pitch = 0.0
84 | toffset = 0.5
85 | [MetOp-C_MHS]
86 | fov = 50.0
87 | yaw = 0.0
88 | roll = 0.5
89 | pitch = 0.0
90 | toffset = 0.5
91 |
92 | [Meteor-M2_MSU-MR]
93 | fov = 54.8
94 | yaw = -3
95 | roll = 2.3
96 | pitch = 0.0
97 | toffset = -0.1
98 | [Meteor-M22_MSU-MR]
99 | fov = 54.9
100 | yaw = -2.6
101 | roll = 0.0
102 | pitch = 0.0
103 | toffset = 0.3
104 |
105 | [Meteor-M22_MTVZA]
106 | curved = true
107 | fov = 52.0
108 | yaw = 5.0
109 | roll = 0.0
110 | pitch = -53.3
111 | pitchscale = 0.9
112 | toffset = 0.0
113 |
114 | [FengYun-3C_VIRR]
115 | fov = 55.31
116 | yaw = 2.7
117 | roll = 0.0
118 | pitch = -0.15
119 | toffset = 0.0
120 | [FengYun-3B_VIRR]
121 | fov = 55.31
122 | yaw = 2.7
123 | roll = 0.0
124 | pitch = -0.15
125 | toffset = 0.0
126 |
--------------------------------------------------------------------------------
/src/commandline.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LeanHRPT Decode
3 | * Copyright (C) 2021-2022 Xerbo
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef LEANHRPT_COMMANDLINE_H_
20 | #define LEANHRPT_COMMANDLINE_H_
21 |
22 | #include
23 |
24 | int parseCommandLine(QCommandLineParser &parser);
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/src/config/config.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LeanHRPT Decode
3 | * Copyright (C) 2021-2022 Xerbo
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef LEANHRPT_CONFIG_CONFIG_H_
20 | #define LEANHRPT_CONFIG_CONFIG_H_
21 |
22 | #include
23 |
24 | #include
25 | #include
26 | #include
27 |
28 | // Load a config file, first try looking in the current directory and then config paths
29 | class Config : public inipp::Ini {
30 | public:
31 | Config(std::string filename) {
32 | // Local config
33 | if (try_load(filename)) return;
34 |
35 | // User config
36 | QString config = QStandardPaths::locate(QStandardPaths::ConfigLocation, QString::fromStdString("leanhrpt/" + filename));
37 | if (!config.isEmpty() && try_load(config.toStdString())) return;
38 |
39 | #ifndef _WIN32
40 | // Internal AppImage config
41 | std::string here = std::getenv("HERE") ? std::getenv("HERE") : "";
42 | if (!here.empty() && try_load(here + "/usr/share/leanhrpt/" + filename)) return;
43 | #endif
44 |
45 | // System config
46 | config = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QString::fromStdString("leanhrpt/" + filename));
47 | if (!config.isEmpty() && try_load(config.toStdString())) return;
48 |
49 | std::cerr << "Could not open " << filename << std::endl;
50 | }
51 |
52 | private:
53 | bool try_load(std::string filename) {
54 | std::filebuf file;
55 | if (file.open(filename, std::ios::in)) {
56 | std::istream stream(&file);
57 | parse(stream);
58 | interpolate();
59 | file.close();
60 | return true;
61 | }
62 |
63 | return false;
64 | }
65 | };
66 |
67 | #endif
68 |
--------------------------------------------------------------------------------
/src/config/gradient.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LeanHRPT Decode
3 | * Copyright (C) 2021-2022 Xerbo
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 |
19 | #ifndef LEANHRPT_CONFIG_GRADIENT_H_
20 | #define LEANHRPT_CONFIG_GRADIENT_H_
21 |
22 | #include
23 | #include