Files
Jungfraujoch/common/ROIElement.h
T
leonarski_fandClaude Opus 4.8 9e57219b31 common: add azimuthal-angle (phi) sectors to ROIAzimuthal
ROIAzimuthal can now be restricted to an azimuthal-angle sector in
addition to its Q/d range, enabling STXM-style directional ROIs. phi
bounds are optional (both-or-neither); absent means a full 360 ring, so
existing Q-only azimuthal ROIs are unchanged.

- ROIElement::CheckROI gains a phi_deg argument; box/circle ignore it.
- MarkROI gains an optional phi_map; ROIMap builds it from Phi_rad
  alongside the resolution map only when azimuthal ROIs are present.
- phi bounds are normalized to [0,360) and wrap-around sectors are
  supported (phi_min > phi_max).
- ROIConfigAzim carries phi_min/phi_max (kept trivially copyable for the
  union; phi_min == phi_max means full ring).

No phi crosses the wire yet (CBOR/API wiring follows separately).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 09:21:39 +02:00

24 lines
811 B
C++

// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <string>
#include <vector>
#include <cstdint>
#include "JFJochMessages.h"
class ROIElement {
protected:
std::string name;
explicit ROIElement(const std::string &name);
public:
virtual ~ROIElement() = default;
[[nodiscard]] std::string GetName() const;
[[nodiscard]] virtual ROIConfig ExportMetadata() const = 0;
[[nodiscard]] virtual bool CheckROI(int64_t x, int64_t y, float resolution, float phi_deg) const = 0;
void MarkROI(std::vector<uint16_t> &v, uint16_t value_to_mark, int64_t xpixel, int64_t ypixel,
const std::vector<float> &resolution_map, const std::vector<float> &phi_map = {}) const;
};