jfjoch_viewer: Track top-pixels without storing/sorting all valid pixels

This commit is contained in:
2025-12-12 11:36:54 +01:00
parent d70c60c501
commit e03d0677ba
9 changed files with 241 additions and 51 deletions
@@ -290,11 +290,15 @@ void JFJochDiffractionImage::DrawBeamCenter() {
void JFJochDiffractionImage::DrawTopPixels() {
int i = 0;
for (auto iter = image->ValidPixels().crbegin();
iter != image->ValidPixels().rend() && i < show_highest_pixels;
iter++, i++)
DrawCross(iter->second % image->Dataset().experiment.GetXPixelsNum() + 0.5,
iter->second / image->Dataset().experiment.GetXPixelsNum() + 0.5, 15, 3);
for (const auto& p : image->GetTopPixels()) {
if (i >= show_highest_pixels)
break;
const int32_t idx = p.second;
DrawCross(idx % image->Dataset().experiment.GetXPixelsNum() + 0.5,
idx / image->Dataset().experiment.GetXPixelsNum() + 0.5, 15, 3);
i++;
}
}