Skip to content

Commit 85d321e

Browse files
committed
Merge new LUT calibrator into p010
2 parents ede2e4a + 09b515b commit 85d321e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+4617
-1567
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@
3131
[submodule "external/stb"]
3232
path = external/stb
3333
url = https://github.com/nothings/stb.git
34+
[submodule "external/linalg"]
35+
path = external/linalg
36+
url = https://github.com/sgorsten/linalg.git

CMakeLists.txt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -550,14 +550,11 @@ if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
550550
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi")
551551
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-psabi")
552552
endif()
553-
if(COMPILER_SUPPORTS_CXX17 AND Qt_VERSION EQUAL 6)
554-
message(STATUS "Enabling support for C++17 for QT6")
553+
if(COMPILER_SUPPORTS_CXX17)
554+
message(STATUS "Enabling support for C++17")
555555
set(CMAKE_CXX_STANDARD 17)
556-
elseif(COMPILER_SUPPORTS_CXX11)
557-
message(STATUS "Enabling support for C++11")
558-
set(CMAKE_CXX_STANDARD 11)
559556
else()
560-
message(STATUS "No support for C++11 detected. Compilation will most likely fail on your compiler")
557+
message(STATUS "No support for C++17 detected. Compilation will most likely fail on your compiler")
561558
endif()
562559
else()
563560
include(CheckCXXCompilerFlag)
@@ -691,8 +688,8 @@ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_D
691688
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/packages.cmake)
692689

693690
# external targets
694-
if (WIN32 AND TARGET stb AND TARGET flatbuffers AND TARGET protobuf-nanopb AND TARGET lunasvg AND TARGET flatc AND TARGET qmqtt AND TARGET liblzma AND TARGET sqlite3)
695-
set_target_properties(stb qmqtt flatbuffers protobuf-nanopb lunasvg flatc resources uninstall liblzma sqlite3 PROPERTIES FOLDER ExternalLibsTargets)
691+
if (WIN32 AND TARGET stb AND TARGET flatbuffers AND TARGET protobuf-nanopb AND TARGET lunasvg AND TARGET flatc AND TARGET qmqtt AND TARGET liblzma AND TARGET sqlite3 AND TARGET precompiled_hyperhdr_headers)
692+
set_target_properties(stb qmqtt flatbuffers protobuf-nanopb lunasvg flatc resources uninstall liblzma sqlite3 precompiled_hyperhdr_headers PROPERTIES FOLDER ExternalLibsTargets)
696693
else()
697694
set_target_properties(resources uninstall PROPERTIES FOLDER ExternalLibsTargets)
698695
endif()

external/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ if(ENABLE_WS281XPWM)
7878
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/rpi_ws281x)
7979
endif()
8080

81+
#=============================================================================
82+
# LINALG
83+
#=============================================================================
84+
85+
add_library(linalg INTERFACE)
86+
target_compile_definitions(linalg INTERFACE LINALG_FORWARD_COMPATIBLE )
87+
target_include_directories(linalg INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/linalg")
88+
8189
#=============================================================================
8290
# LUNASVG
8391
#=============================================================================

external/linalg

Submodule linalg added at 4460f1f

include/api/BaseAPI.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#pragma once
22

3+
#ifndef PCH_ENABLED
4+
#include <QThread>
5+
#include <memory>
6+
#endif
7+
38
#include <base/HyperHdrInstance.h>
49
#include <base/HyperHdrManager.h>
510
#include <base/AccessManager.h>
@@ -18,12 +23,12 @@ class BaseAPI : public QObject
1823

1924
struct ImageCmdData
2025
{
21-
int priority;
26+
int priority = 0;
2227
QString origin;
23-
int64_t duration;
24-
int width;
25-
int height;
26-
int scale;
28+
int64_t duration = 0;
29+
int width = 0;
30+
int height = 0;
31+
int scale = 0;
2732
QString format;
2833
QString imgName;
2934
QString imagedata;
@@ -122,6 +127,7 @@ class BaseAPI : public QObject
122127
std::shared_ptr<GrabberHelper> _systemGrabber;
123128
std::shared_ptr<PerformanceCounters> _performanceCounters;
124129
std::shared_ptr<DiscoveryWrapper> _discoveryWrapper;
130+
std::unique_ptr<QThread, std::function<void(QThread*)>> _lutCalibratorThread;
125131

126132
struct {
127133
bool init = false;

include/api/CallbackAPI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class CallbackAPI : public BaseAPI
3232
void subscribe(QJsonArray subsArr);
3333

3434
protected:
35-
std::unique_ptr<LutCalibrator> _lutCalibrator;
3635
Image<ColorRgb> _liveImage;
3736

3837
void stopDataConnections() override = 0;
@@ -59,11 +58,12 @@ private slots:
5958
void instancesListChangedHandler();
6059
void tokenChangeHandler(const QVector<AccessManager::AuthDefinition>& def);
6160
void signalBenchmarkUpdateHandler(int status, QString message);
62-
void lutCalibrationUpdateHandler(const QJsonObject& data);
6361
void performanceUpdateHandler(const QJsonObject& data);
6462
#ifdef ENABLE_BONJOUR
6563
void signalDiscoveryFoundServiceHandler(DiscoveryRecord::Service type, QList<DiscoveryRecord> records);
6664
#endif
65+
public slots:
66+
void lutCalibrationUpdateHandler(const QJsonObject& data);
6767

6868
private:
6969
QStringList _availableCommands;

include/base/Grabber.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ class Grabber : public DetectionAutomatic, public DetectionManual, protected Lut
117117

118118
void setSignalDetectionEnable(bool enable);
119119

120-
void setAutoSignalDetectionEnable(bool enable);
121-
122-
void benchmarkCapture(int status, QString message);
120+
void setAutoSignalDetectionEnable(bool enable);
123121

124122
QList<Grabber::DevicePropertiesItem> getVideoDeviceModesFullInfo(const QString& devicePath);
125123

@@ -163,6 +161,8 @@ public slots:
163161

164162
QStringList getVideoDevices() const;
165163

164+
void signalSetLutHandler(MemoryBuffer<uint8_t>* lut);
165+
166166
signals:
167167
void SignalNewCapturedFrame(const Image<ColorRgb>& image);
168168

@@ -270,9 +270,6 @@ public slots:
270270
bool _signalDetectionEnabled;
271271
bool _signalAutoDetectionEnabled;
272272
QSemaphore _synchro;
273-
274-
int _benchmarkStatus;
275-
QString _benchmarkMessage;
276273
};
277274

278275
bool sortDevicePropertiesItem(const Grabber::DevicePropertiesItem& v1, const Grabber::DevicePropertiesItem& v2);

include/base/GrabberWrapper.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ public slots:
3939
void stop();
4040
void revive();
4141

42-
void benchmarkCapture(int status, QString message);
43-
4442
QJsonObject getJsonInfo();
4543

4644
QJsonDocument startCalibration();
@@ -57,7 +55,6 @@ private slots:
5755
void SignalNewVideoImage(const QString& name, const Image<ColorRgb>& image);
5856
void SignalVideoStreamChanged(QString device, QString videoMode);
5957
void SignalCecKeyPressed(int key);
60-
void SignalBenchmarkUpdate(int status, QString message);
6158
void SignalInstancePauseChanged(int instance, bool isEnabled);
6259
void SignalSetNewComponentStateToAllInstances(hyperhdr::Components component, bool enable);
6360
void SignalSaveCalibration(QString saveData);

include/base/HyperHdrManager.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#endif
77

88
#include <image/ColorRgb.h>
9+
#include <utils/VideoBenchmark.h>
910
#include <utils/Logger.h>
1011
#include <utils/settings.h>
1112
#include <utils/Components.h>
@@ -43,6 +44,8 @@ class HyperHdrManager : public QObject
4344
bool areInstancesReady();
4445

4546
public slots:
47+
void handleRequestComponent(hyperhdr::Components component, int hyperHdrInd, bool listen);
48+
4649
void setSmoothing(int time);
4750

4851
void setSignalStateByCEC(bool enable);
@@ -101,6 +104,9 @@ public slots:
101104

102105
void SignalInstancePauseChanged(int instance, bool isEnabled);
103106

107+
void SignalBenchmarkUpdate(int status, QString message);
108+
void SignalBenchmarkCapture(int status, QString message);
109+
104110
private slots:
105111
void handleInstanceJustStarted();
106112

@@ -126,4 +132,5 @@ private slots:
126132
int _fireStarter;
127133

128134
QMap<quint8, PendingRequests> _pendingRequests;
135+
VideoBenchmark _videoBenchmark;
129136
};

include/flatbuffers/server/FlatBuffersServer.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class FlatBuffersServer : public QObject, protected LutLoader
3737
void SignalImportFromProto(int priority, int duration, const Image<ColorRgb>& image, QString clientDescription);
3838

3939
public slots:
40+
void handleRequestComponent(hyperhdr::Components component, int hyperHdrInd, bool listen);
41+
void signalSetLutHandler(MemoryBuffer<uint8_t>* lut);
4042
void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
4143
void initServer();
4244
int getHdrToneMappingEnabled();
@@ -70,4 +72,6 @@ private slots:
7072
QString _userLutFile;
7173
PixelFormat _currentLutPixelFormat;
7274
int _flatbufferToneMappingMode;
75+
bool _quarterOfFrameMode;
76+
bool _active;
7377
};

0 commit comments

Comments
 (0)