LensSerious 0.1
Lens-correction mathematics as data, not as a library of callbacks
Loading...
Searching...
No Matches
ls_eval_t Struct Reference

One lens resolved at one shooting configuration, as a flat block of scalars. More...

#include <lensserious_eval.h>

+ Collaboration diagram for ls_eval_t:

Data Fields

float norm_scale
 
float norm_unscale
 
float center_x
 
float center_y
 
float vig_scale
 
float vig_center_x
 
float vig_center_y
 
float scale
 
int dist_model
 
int tca_model
 
int vig_model
 
int enabled
 
int geom_from
 
int geom_to
 
float geom_focal
 
int reverse
 
float dist_terms [3]
 
float tca_terms [6]
 
float vig_terms [3]
 
int knot_axes
 
int knot_n
 
float knot_r [3][16]
 
float knot_c [3][16]
 
int knot_vn
 
float knot_vr [16]
 
float knot_v [16]
 

Detailed Description

One lens resolved at one shooting configuration, as a flat block of scalars.

Scalars only, and no vector types: a struct of float and int has the same layout under every host C ABI and under OpenCL C, so this can be memcpy'd into a kernel argument. Anything richer (a float2 centre, say) would lay out differently and corrupt every field after it, silently. tests/parity_lensfun.c pins the size.

Produced by ls_eval_from_modifier(); consumed by ls_eval_map() and ls_eval_vignette_factor(), on either side.

Definition at line 143 of file lensserious_eval.h.

Field Documentation

◆ center_x

float ls_eval_t::center_x

Definition at line 147 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), and ls_eval_map().

◆ center_y

float ls_eval_t::center_y

optical centre, in normalized coordinates

Definition at line 147 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), and ls_eval_map().

◆ dist_model

int ls_eval_t::dist_model

◆ dist_terms

float ls_eval_t::dist_terms[3]

Definition at line 172 of file lensserious_eval.h.

Referenced by ls_eval_dist(), ls_eval_from_modifier(), and ls_eval_undist_factor().

◆ enabled

int ls_eval_t::enabled

LS_EVAL_ENABLE_* actually resolved

Definition at line 159 of file lensserious_eval.h.

Referenced by ls_eval_adopt_vignetting(), ls_eval_coord_chain(), ls_eval_from_modifier(), ls_eval_map(), and ls_eval_vignette_factor().

◆ geom_focal

float ls_eval_t::geom_focal

focal / LS_EVAL_GEOM_HALF_HEIGHT_MM

Definition at line 162 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), and ls_eval_geometry().

◆ geom_from

int ls_eval_t::geom_from

the lens's own projection, LS_EVAL_LENS_*

Definition at line 160 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), and ls_eval_geometry().

◆ geom_to

int ls_eval_t::geom_to

the projection asked for

Definition at line 161 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), and ls_eval_geometry().

◆ knot_axes

int ls_eval_t::knot_axes

Which axes the knot table serves, as LS_EVAL_ENABLE_* bits.

A maker's curve is distortion and lateral CA together – green IS the distortion, and each channel's departure from green IS the aberration. So a consumer that wants the table's geometry but somebody else's CA asks for DISTORTION alone, and every channel then follows the green curve, leaving the ordinary TCA stage free to run after it. Asking for both is the usual case and keeps the three-curve evaluation.

Definition at line 195 of file lensserious_eval.h.

Referenced by ls_eval_coord_chain(), ls_eval_from_modifier(), and ls_eval_map().

◆ knot_c

float ls_eval_t::knot_c[3][16]

Definition at line 198 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), and ls_eval_knot_factor().

◆ knot_n

int ls_eval_t::knot_n

Definition at line 196 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), and ls_eval_knot_factor().

◆ knot_r

float ls_eval_t::knot_r[3][16]

Definition at line 197 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), and ls_eval_knot_factor().

◆ knot_v

float ls_eval_t::knot_v[16]

◆ knot_vn

int ls_eval_t::knot_vn

◆ knot_vr

float ls_eval_t::knot_vr[16]

◆ norm_scale

float ls_eval_t::norm_scale

centred pixel coordinates -> calibration-normalized

Definition at line 145 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), and ls_eval_map().

◆ norm_unscale

float ls_eval_t::norm_unscale

and back

Definition at line 146 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), and ls_eval_map().

◆ reverse

int ls_eval_t::reverse

Non-zero when this block describes the REVERSE direction (lensfun's reverse flag).

It is not "the same chain, backwards". Upstream registers different callbacks at different priorities, so the composition order itself changes: forward runs scale(100) -> geometry(500) -> distortion(750), reverse runs undistortion(250) -> geometry(500) -> scale(900). The projection endpoints are swapped and the scale factor is stored un-reciprocated by the resolver, so only the ORDER and the choice of dist/undist live here.

Definition at line 171 of file lensserious_eval.h.

Referenced by ls_eval_coord_chain(), ls_eval_from_modifier(), ls_eval_map(), and ls_eval_vignette_from_r2().

◆ scale

float ls_eval_t::scale

linear scaling, already reciprocal; 1.0 when off

Definition at line 155 of file lensserious_eval.h.

Referenced by ls_eval_coord_chain(), and ls_eval_from_modifier().

◆ tca_model

int ls_eval_t::tca_model

LS_EVAL_TCA_*

Definition at line 157 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), ls_eval_tca(), and ls_eval_untca().

◆ tca_terms

float ls_eval_t::tca_terms[6]

Definition at line 173 of file lensserious_eval.h.

Referenced by ls_eval_from_modifier(), ls_eval_tca(), and ls_eval_untca().

◆ vig_center_x

float ls_eval_t::vig_center_x

◆ vig_center_y

float ls_eval_t::vig_center_y

centre / aspect_ratio_correction

Definition at line 154 of file lensserious_eval.h.

Referenced by ls_eval_adopt_vignetting(), ls_eval_from_modifier(), ls_eval_vignette_factor(), and ls_modifier_apply_vignetting().

◆ vig_model

int ls_eval_t::vig_model

LS_EVAL_VIG_*

Definition at line 158 of file lensserious_eval.h.

Referenced by ls_eval_adopt_vignetting(), ls_eval_from_modifier(), and ls_eval_vignette_from_r2().

◆ vig_scale

float ls_eval_t::vig_scale

norm_scale / aspect_ratio_correction

Definition at line 153 of file lensserious_eval.h.

Referenced by ls_eval_adopt_vignetting(), ls_eval_from_modifier(), ls_eval_vignette_factor(), and ls_modifier_apply_vignetting().

◆ vig_terms

float ls_eval_t::vig_terms[3]

The documentation for this struct was generated from the following file: