Skip to content

Commit 0035b40

Browse files
committed
backend: Export/import the Backend config as JSON
Add a new helper BackEnd::GetJsonConfig() to return a JSON string of the current Backend register configuration and tile data. The parameters are the actual register values to be programmed into the hardware, and currently all dumped as unsigned. Add a check for the environment variable LIBPISP_CONFIG_DUMP, and if if it is set, use the filename provided to dump the config/tile JSON output as a one-shot operation. Add a new helper BackEnd::SetJsonConfig() to read a JSON string and import the Backend register configuration. Tile data does not get imported, and will need a BackEnd::Prepare() call to re-generate the tile data. Signed-off-by: Naushir Patuck <[email protected]>
1 parent 4b19cee commit 0035b40

File tree

4 files changed

+581
-0
lines changed

4 files changed

+581
-0
lines changed

src/libpisp/backend/backend.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#pragma once
99

1010
#include <map>
11+
#include <string>
1112
#include <vector>
1213

1314
#include "common/shm_mutex.hpp"
@@ -130,6 +131,9 @@ class BackEnd
130131

131132
unsigned int GetMaxDownscale() const;
132133

134+
std::string GetJsonConfig(pisp_be_tiles_config *config);
135+
void SetJsonConfig(const std::string &json_config);
136+
133137
void lock()
134138
{
135139
mutex_.lock();
@@ -175,6 +179,7 @@ class BackEnd
175179
std::vector<std::pair<double, std::string>> resample_select_list_;
176180
pisp_be_sharpen_config default_sharpen_;
177181
pisp_be_sh_fc_combine_config default_shfc_;
182+
std::string last_dump_file_;
178183
};
179184

180185
} // namespace libpisp

0 commit comments

Comments
 (0)