From be01036ddea40a890188eb102f401b58bd0f2be5 Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Wed, 7 Jul 2021 11:31:07 +0200 Subject: [PATCH] Calculate bits per pixel from dtype --- std-det-writer/src/JFH5Writer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/std-det-writer/src/JFH5Writer.cpp b/std-det-writer/src/JFH5Writer.cpp index 21879bd..cdb5deb 100644 --- a/std-det-writer/src/JFH5Writer.cpp +++ b/std-det-writer/src/JFH5Writer.cpp @@ -53,7 +53,8 @@ void JFH5Writer::open_run(const string& output_file, current_run_id_ = run_id; image_y_size_ = image_y_size; image_x_size_ = image_x_size; - bits_per_pixel_ = bits_per_pixel; + // The last digit in the enum value represents the number of bytes/pixel. + bits_per_pixel_ = (dtype % 10) * 8; image_n_bytes_ = (image_y_size_ * image_x_size_ * bits_per_pixel_) / 8; #ifdef DEBUG_OUTPUT