Files
Jungfraujoch/common/ROIBox.h
T
leonarski_f 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

27 lines
873 B
C++

// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include "ROIElement.h"
class ROIBox : public ROIElement {
int64_t x_min;
int64_t x_max;
int64_t y_min;
int64_t y_max;
public:
ROIBox(const std::string &name, int64_t x_min, int64_t x_max, int64_t y_min, int64_t y_max);
~ROIBox() override = default;
[[nodiscard]] int64_t GetXMin() const;
[[nodiscard]] int64_t GetXMax() const;
[[nodiscard]] int64_t GetYMin() const;
[[nodiscard]] int64_t GetYMax() const;
[[nodiscard]] int64_t GetWidth() const;
[[nodiscard]] int64_t GetHeight() const;
[[nodiscard]] int64_t GetArea() const;
bool CheckROI(int64_t x, int64_t y, float resolution, float phi_deg) const override;
ROIConfig ExportMetadata() const override;
};