Thermal Camera SDK 11.4.10
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
Sdk.h
Go to the documentation of this file.
1// Copyright (c) 2008-2026 Optris GmbH & Co. KG
2
12#pragma once
13
14#include <array>
15#include <cstdint>
16#include <string>
17#include <vector>
18
19#include "otcsdk/Api.h"
22
23
25namespace optris
26{
27
29enum class Verbosity
30{
31 Off = 1,
32 Error = 2,
33 Warning = 3,
34 Info = 4,
35 Debug = 5,
36};
37
38
40class Sdk
41{
42public:
44 Sdk() = delete;
45
46
59 OTC_SDK_API static void init(Verbosity logScreen,
60 Verbosity logFile,
61 std::string logFilenamePrefix = "",
62 std::string customDataDirectory = "");
63
74 OTC_SDK_API static void configureLogger(Verbosity logScreen, Verbosity logFile, std::string logFilenamePrefix = "");
75
76
83 using LogCallback = void(OTC_SDK_C_CALL*)(int verbosityLevel, const char* message);
84
91 OTC_SDK_API static void setLogCallback(LogCallback callback, bool exclusive = false);
92
93
117 OTC_SDK_API static void setCustomDataDirectory(const std::string& customDataDirectory);
118
129 OTC_SDK_API static void clearCustomDataDirectory();
130
152
165 OTC_SDK_API static bool setCalibrationFileSources(const std::vector<CalibrationFileSource>& sources);
166
181 OTC_SDK_API static void setCalibrationFileSourceDirectory(const std::string& sourceDirectory);
182
188 OTC_SDK_API static void clearCalibrationFileSourceDirectory();
189
217 OTC_SDK_API static void addCalibrationFallbackServer(const std::string& url);
218
224 OTC_SDK_API static void clearCalibrationFallbackServers();
225
231 OTC_SDK_API static VersionInfo getVersionInfo();
232
233
244 OTC_SDK_API static void loadPalettes();
245
263 OTC_SDK_API static void loadPalettes(const std::string& directory);
264
270 OTC_SDK_API static std::vector<std::string> getPaletteNames();
271
283 OTC_SDK_API static std::vector<std::array<uint8_t, 3>> getPaletteColors(const std::string& name);
284
295 OTC_SDK_API static void registerPalette(const std::string& name,
296 const std::vector<std::array<uint8_t, 3>>& colors);
297
308 OTC_SDK_API static void savePalette(const std::string& name);
309};
310
311} // namespace optris
Contains defines controlling the Windows DLL export and import of symbols.
Contains an enum representing the different sources from which calibration files can be acquired.
Contains a class encapsulating version and build information about the SDK.
Static class granting access to SDK wide configuration and utility functions.
Definition Sdk.h:41
static OTC_SDK_API void init(Verbosity logScreen, Verbosity logFile, std::string logFilenamePrefix="", std::string customDataDirectory="")
Initializes the SDK.
static OTC_SDK_API void savePalette(const std::string &name)
Saves a registered palette as a CSV file in the user palette directory.
static OTC_SDK_API bool setCalibrationFileSources(const std::vector< CalibrationFileSource > &sources)
Sets the priority of the calibration file sources from an ordered list.
static OTC_SDK_API void setCalibrationFileSourceDirectory(const std::string &sourceDirectory)
Sets the source directory from which calibration files can be copied.
static OTC_SDK_API void addCalibrationFallbackServer(const std::string &url)
Appends a fallback server for internet calibration file downloads.
static OTC_SDK_API void setLogCallback(LogCallback callback, bool exclusive=false)
Sets a callback that receives SDK log messages.
static OTC_SDK_API void setCustomDataDirectory(const std::string &customDataDirectory)
Sets a custom data directory for the SDK to use.
static OTC_SDK_API void clearCalibrationFileSourceDirectory()
Clears a previously set source directory for calibration files.
static OTC_SDK_API std::vector< std::array< uint8_t, 3 > > getPaletteColors(const std::string &name)
Returns the 240 RGB color entries of the named palette.
static OTC_SDK_API void configureLogger(Verbosity logScreen, Verbosity logFile, std::string logFilenamePrefix="")
Configures the SDK internal logger.
static OTC_SDK_API void clearCalibrationFallbackServers()
Removes all fallback servers registered via Sdk::addCalibrationFallbackServer().
static OTC_SDK_API void clearCustomDataDirectory()
Clears a previously set custom data directory for the SDK.
static OTC_SDK_API std::vector< std::string > getPaletteNames()
Returns the names of all currently loaded palettes in sorted order.
void(OTC_SDK_C_CALL *)(int verbosityLevel, const char *message) LogCallback
Callback function type for receiving SDK log messages.
Definition Sdk.h:83
static OTC_SDK_API void loadPalettes()
Loads palettes from the SDK and user palette directories.
static OTC_SDK_API void loadPalettes(const std::string &directory)
Loads palettes from a custom directory.
static OTC_SDK_API void registerPalette(const std::string &name, const std::vector< std::array< uint8_t, 3 > > &colors)
Registers a palette at runtime without persisting it to disk.
Sdk()=delete
No constructor.
static OTC_SDK_API bool setCalibrationFileSources(CalibrationFileSource first, CalibrationFileSource second, CalibrationFileSource third)
Sets the priority of the calibration file sources.
static OTC_SDK_API VersionInfo getVersionInfo()
Returns an object holding version and build information about the SDK.
Encapsulates version and build information about the SDK.
Definition VersionInfo.h:28
Main SDK namespace.
Definition AlarmChannel.h:21
CalibrationFileSource
Represents the different sources from which the calibration files can be acquired.
Definition CalibrationFileSource.h:19
@ Error
Flag is in an error state.
Verbosity
Represents the different logging verbosity levels.
Definition Sdk.h:30
@ Off
Deactivated.