bit_depth defined via config file

This commit is contained in:
lhdamiani
2021-12-14 12:01:50 +01:00
parent 8b43fb67cd
commit 7fcda636dc
13 changed files with 55 additions and 62 deletions
+3 -6
View File
@@ -18,19 +18,16 @@ using namespace live_writer_config;
int main (int argc, char *argv[])
{
if (argc != 3) {
if (argc != 2) {
cout << endl;
cout << "Usage: std_det_writer [detector_json_filename]"
" [bit_depth]" << endl;
cout << "Usage: std_det_writer [detector_json_filename]" << endl;
cout << "\tdetector_json_filename: detector config file path." << endl;
cout << "\tbit_depth: bit depth of the incoming udp packets." << endl;
cout << endl;
exit(-1);
}
auto const config = DetWriterConfig::from_json_file(string(argv[1]));
const int bit_depth = atoi(argv[2]);
MPI_Init(nullptr, nullptr);
@@ -45,7 +42,7 @@ int main (int argc, char *argv[])
auto receiver = BufferUtils::connect_socket(
ctx, config.detector_name, "writer_agent");
const size_t IMAGE_N_BYTES = config.image_width * config.image_height * bit_depth / 8;
const size_t IMAGE_N_BYTES = config.image_width * config.image_height * config.bit_depth / 8;
RamBuffer image_buffer(config.detector_name + "_assembler",
sizeof(ImageMetadata), IMAGE_N_BYTES, 1, RAM_BUFFER_N_SLOTS);