mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-08-07 06:02:26 +02:00
config takes image height and width instead of n_pixels
This commit is contained in:
@@ -12,9 +12,13 @@
|
||||
using namespace std;
|
||||
using namespace buffer_config;
|
||||
|
||||
EigerAssembler::EigerAssembler(const int n_modules, const int bit_depth):
|
||||
EigerAssembler::EigerAssembler(const int n_modules, const int bit_depth,
|
||||
const int image_height, const int image_width):
|
||||
n_modules_(n_modules),
|
||||
n_rows_(n_modules/2),
|
||||
image_height_(image_height),
|
||||
image_width_(image_width),
|
||||
n_rows_(image_width / MODULE_Y_SIZE),
|
||||
n_columns_(image_height / MODULE_X_SIZE),
|
||||
n_eiger_modules_(n_modules/4),
|
||||
bit_depth_(bit_depth),
|
||||
n_bytes_per_frame_(MODULE_N_PIXELS * bit_depth / 8),
|
||||
@@ -64,8 +68,8 @@ void EigerAssembler::assemble_image(const char* src_meta,
|
||||
// init good image status = 0
|
||||
image_meta->status = 0;
|
||||
image_meta->id = frame_meta->id;
|
||||
image_meta->height = n_rows_ * (MODULE_Y_SIZE + EXTEND_Y_PIXELS);
|
||||
image_meta->width = n_rows_ * (MODULE_X_SIZE + EXTEND_X_PIXELS);
|
||||
image_meta->height = image_height_;
|
||||
image_meta->width = image_width_;
|
||||
image_meta->dtype = (bit_depth_ <= 8) ? 1 : bit_depth_ / 8;
|
||||
image_meta->encoding = 0;
|
||||
image_meta->source_id = 0;
|
||||
|
||||
@@ -45,7 +45,7 @@ int main (int argc, char *argv[])
|
||||
const int bit_depth = atoi(argv[2]);
|
||||
auto const stream_name = "assembler";
|
||||
|
||||
const size_t IMAGE_N_BYTES = config.image_n_pixels * bit_depth / 8;
|
||||
const size_t IMAGE_N_BYTES = config.image_height * config.image_width * bit_depth / 8;
|
||||
auto ctx = zmq_ctx_new();
|
||||
zmq_ctx_set(ctx, ZMQ_IO_THREADS, ASSEMBLER_ZMQ_IO_THREADS);
|
||||
auto sender = BufferUtils::bind_socket(
|
||||
@@ -60,13 +60,16 @@ int main (int argc, char *argv[])
|
||||
cout << " Details of Assembler:";
|
||||
cout << " detector_name: " << config.detector_name;
|
||||
cout << " || n_modules: " << config.n_modules;
|
||||
cout << " || img width: " << config.image_width;
|
||||
cout << " || img height: " << config.image_height;
|
||||
cout << endl;
|
||||
#endif
|
||||
|
||||
const size_t FRAME_N_BYTES = MODULE_N_PIXELS * bit_depth / 8;
|
||||
const size_t N_PACKETS_PER_FRAME = FRAME_N_BYTES / DATA_BYTES_PER_PACKET;
|
||||
|
||||
EigerAssembler assembler(config.n_modules, bit_depth);
|
||||
EigerAssembler assembler(config.n_modules, bit_depth,
|
||||
config.image_width, config.image_height);
|
||||
|
||||
#ifdef DEBUG_OUTPUT
|
||||
using namespace date;
|
||||
|
||||
Reference in New Issue
Block a user