Airy Disk¶
-
template<IsSpectral TSpectral>
class AiryDisk : public huira::PSF<TSpectral>¶ Airy disk point spread function (PSF).
Models the PSF of a circular aperture using the Airy disk formula for diffraction-limited optics.
- Template Parameters:
TSpectral – The spectral type (e.g., RGB, Visible8)
Public Functions
-
AiryDisk(units::Meter focal_length, units::Meter pitch_x, units::Meter pitch_y, units::Meter aperture_diameter, int radius, int banks)¶
Constructs an AiryDisk PSF with the given optical parameters.
- Parameters:
focal_length – The focal length of the optical system in meters.
pitch_x – The pixel pitch in the x direction in meters.
pitch_y – The pixel pitch in the y direction in meters.
aperture_diameter – The diameter of the circular aperture in meters.
radius – The kernel radius in pixels.
banks – The number of polyphase banks.
-
~AiryDisk() override = default¶
-
virtual TSpectral evaluate(float x, float y) override¶
Evaluates the Airy disk PSF at the given pixel offset.
Computes the intensity at the specified (x, y) offset from the center, using the Airy disk formula.
- Parameters:
x – Horizontal offset from the center in pixel coordinates.
y – Vertical offset from the center in pixel coordinates.
- Returns:
The PSF intensity for each spectral channel.
-
void build_polyphase_cache(int radius, int banks)¶
Builds the polyphase kernel cache for the PSF.
Allocates and fills the cache with polyphase kernels for efficient PSF evaluation.
- Parameters:
radius – The kernel radius in pixels.
banks – The number of polyphase banks.
-
Image<TSpectral> generate_convolution_kernel(int radius)¶
Generates a single centered kernel suitable for whole-image convolution.
Unlike the polyphase cache, this produces exactly one kernel with zero subpixel offset, by directly integrating evaluate() over each pixel with stratified sampling. There is no super-resolution intermediate LUT and no bank multiplicity, so memory is dim^2 pixels regardless of radius - large frame-wide kernels (radius of hundreds to thousands of pixels) are practical. The result is normalized to unit energy per channel.
evaluate() must be thread-safe: pixels are integrated in parallel.
- Parameters:
radius – The kernel radius in pixels (kernel dimension is 2 * radius + 1).
- Returns:
The normalized convolution kernel.
-
const Image<TSpectral> &get_kernel(float u, float v) const¶
Retrieves the polyphase kernel for the given normalized coordinates.
Returns the cached kernel corresponding to the specified subpixel position.
- Parameters:
u – Normalized horizontal coordinate in [0, 1].
v – Normalized vertical coordinate in [0, 1].
- Returns:
Reference to the corresponding kernel image.
-
inline int get_radius() const¶
-
inline int get_banks() const¶
Protected Attributes
-
struct huira::PSF::PolyphaseCache cache_¶