17 namespace itk::itkpix::endec::orion {
19 extern factory::DecCore makeDecCore;
24 template<
typename T,
int cb_type = 0>
35 log.
debug(
"orion.DecCore(opt, evt)");
36 dec = makeDecCore(opt, *
this, 1);
43 inline void initialize() {
44 log.
debug(
"initialize()");
47 inline void finalize() {
48 log.
debug(
"finalize()");
51 inline void decode(uint64_t data64) { dec->
decode(data64); }
52 inline void decode(
const uint8_t *buff,
size_t size) { decode({ buff,
size }); }
53 inline void decode(
const uint64_t *buff64,
size_t size64) { decode({ buff64, size64 }); }
55 inline void decode(
const std::span<const uint8_t> buff) { dec->
decode(buff); }
56 inline void decode(
const std::span<const uint64_t> buff64) { dec->
decode(buff64); }
60 void evt_init(uint8_t tag)
override { cb.evt_init(tag); }
61 void evt_next(uint8_t tag)
override { cb.evt_next(tag); }
62 void evt_done()
override { cb.evt_done(); }
64 void add_hit(uint16_t col, uint16_t row, uint16_t tot)
override {
65 cb.add_hit(col, row, tot);
67 void add_qcore(uint8_t qcol, uint8_t qrow, uint64_t qtot)
override {
68 cb.add_qcore(qcol, qrow, qtot);
71 void add_hmap(uint8_t qcol, uint8_t qrow, uint16_t hmap, uint64_t tots)
override {
72 if (cb_type == 1) cb.add_hmap(qcol, qrow, hmap, tots);
73 if (cb_type == 0 || cb_type == 2) {
74 uint pix_col = qcol*8;
75 uint pix_row = qrow*2;
78 if (cb_type == 2) tots = ~tots;
82 uint i = __builtin_clz(htmp);
83 htmp ^= 0x80000000 >> i;
84 uint col = pix_col + (i - 16) % 8;
85 uint row = pix_row + (i - 16) / 8;
86 uint tot = tots >> 60;
88 if (cb_type == 0) cb.add_hit(col, row, tot);
89 if (cb_type == 2) qtot |= tot << (4*(31 - i));
93 cb.add_qcore(qcol, qrow, qtot);
98 uint8_t on_error(
EventError error)
override {
return cb.on_error(error); }
Definition: test_enc_dec.cpp:117
Core decoding interface.
Definition: deccore.hpp:22
virtual void decode(uint64_t data)=0
Decode single 64-bit data frame.
virtual void initialize()=0
Initialise decoder core.
virtual void finalize()=0
Finalise decoder core.
Callback interface for event.
Definition: evtcallback.hpp:45
Definition: deccore.hpp:25
Logger class definition, wrapper around CoreLogger, adds templated methods for different logging leve...
Definition: logger.hpp:108
void debug(fmt::format_string< Args... > fmt, Args &&...args)
Logs a message with debug level.
Definition: logger.hpp:140
Templates for ITkPix Decoder Core.
Callback on event decoding error.
Definition: evtcallback.hpp:15
Common encoder/decoder options.
Definition: options.hpp:10