Circular Aperture

template<IsSpectral TSpectral>
class CircularAperture : public huira::Aperture<TSpectral>

Circular optical aperture.

Models a circular aperture with a specified diameter and area, supporting PSF creation.

Template Parameters:

TSpectral – The spectral type (e.g., RGB, Visible8)

Public Functions

CircularAperture(units::Meter diameter)

Constructs a circular aperture with the given diameter.

Initializes the aperture and computes its area from the specified diameter.

Parameters:

diameter – The diameter of the aperture in meters.

Throws:

std::runtime_error – if the diameter is not positive and finite.

~CircularAperture() override = default
virtual void set_area(units::SquareMeter area) override

Sets the area of the aperture.

Directly sets the area value (in square meters) for the aperture.

Parameters:

area – The new area in square meters.

Throws:

std::runtime_error – if the area is not positive and finite.

inline virtual units::SquareMeter get_area() const override
virtual Vec2<float> sample(Sampler<float> &sampler) const override
void set_diameter(units::Meter diameter)

Sets the diameter of the aperture and updates the area.

Computes the area from the specified diameter and updates the internal area value.

Parameters:

diameter – The new diameter in meters.

Throws:

std::runtime_error – if the diameter is not positive and finite.

units::Meter get_diameter() const

Returns the diameter of the aperture.

Computes the diameter from the current area value.

Returns:

The diameter in meters.

virtual units::Meter get_bounding_radius() const override
virtual void rasterize_shape(Image<float> &kernel, float radius_pixels, float offset_x, float offset_y) const override

Draws a disk of the given radius as antialiased coverage. See Aperture::rasterize_shape().