version 1.0.0-rc.24

This commit is contained in:
2024-11-17 14:55:09 +01:00
parent aeeae33ad9
commit adc13ff33e
361 changed files with 12513 additions and 3314 deletions

View File

@@ -165,39 +165,27 @@ void StrongPixelSet::ReadFPGAOutput(const DiffractionExperiment & experiment,
auto pixel_depth = experiment.GetByteDepthImage();
auto out_ptr = (uint32_t *) output.spot_finding_result.strong_pixel;
if (pixel_depth == 2) {
for (int i = 0; i < RAW_MODULE_SIZE / (8 * sizeof(out_ptr[0])); i++) {
size_t npixel = i * 8 * sizeof(out_ptr[0]);
size_t line = npixel / RAW_MODULE_COLS;
for (int i = 0; i < RAW_MODULE_SIZE / (8 * sizeof(out_ptr[0])); i++) {
size_t npixel = i * 8 * sizeof(out_ptr[0]);
size_t line = npixel / RAW_MODULE_COLS;
if (out_ptr[i] != 0) {
std::bitset<32> bitset(out_ptr[i]);
if (out_ptr[i] != 0) {
std::bitset<32> bitset(out_ptr[i]);
for (int j = 0; j < 32; j++) {
if (bitset.test(j)) {
size_t col = (npixel | j) % RAW_MODULE_COLS;
for (int j = 0; j < 32; j++) {
if (bitset.test(j)) {
size_t col = (npixel | j) % RAW_MODULE_COLS;
if (pixel_depth == 2)
AddStrongPixel(col, line, output.pixels[npixel | j]);
}
}
}
}
} else {
for (int i = 0; i < RAW_MODULE_SIZE / (8 * sizeof(out_ptr[0])); i++) {
size_t npixel = i * 8 * sizeof(out_ptr[0]);
size_t line = npixel / RAW_MODULE_COLS;
if (out_ptr[i] != 0) {
std::bitset<32> bitset(out_ptr[i]);
for (int j = 0; j < 32; j++) {
if (bitset.test(j)) {
size_t col = (npixel | j) % RAW_MODULE_COLS;
AddStrongPixel(col, line, ((int32_t *) output.pixels)[npixel | j]);
}
else if (pixel_depth == 1)
AddStrongPixel(col, line, ((int8_t *)output.pixels)[npixel | j]);
else if (pixel_depth == 4)
AddStrongPixel(col, line, ((int32_t *)output.pixels)[npixel | j]);
}
}
}
}
}
uint32_t StrongPixelSet::GetStrongPixelCount() const {