#include <lensfun.h>
Public Member Functions | |
lfLens () | |
Create a new lens object, initializing all fields to default values. | |
lfLens (const lfLens &other) | |
Copy constructor. | |
~lfLens () | |
Destroy this and all associated objects. | |
lfLens & | operator= (const lfLens &other) |
Assignment operator. | |
void | SetMaker (const char *val, const char *lang=NULL) |
Add a string to camera maker. | |
void | SetModel (const char *val, const char *lang=NULL) |
Add a string to camera model. | |
void | AddMount (const char *val) |
Add a new mount type to this lens. | |
void | AddCalibDistortion (const lfLensCalibDistortion *dc) |
Add a new distortion calibration structure to the pool. | |
bool | RemoveCalibDistortion (int idx) |
Remove a calibration entry from the distortion calibration data. | |
void | AddCalibTCA (const lfLensCalibTCA *tcac) |
Add a new transversal chromatic aberration calibration structure to the pool. | |
bool | RemoveCalibTCA (int idx) |
Remove a calibration entry from the TCA calibration data. | |
void | AddCalibVignetting (const lfLensCalibVignetting *vc) |
Add a new vignetting calibration structure to the pool. | |
bool | RemoveCalibVignetting (int idx) |
Remove a calibration entry from the vignetting calibration data. | |
void | GuessParameters () |
This method fills some fields if they are missing but can be derived from other fields. | |
bool | Check () |
Check if a lens object is valid. | |
bool | InterpolateDistortion (float focal, lfLensCalibDistortion &res) const |
Interpolate lens geometry distortion data for given focal length. | |
bool | InterpolateTCA (float focal, lfLensCalibTCA &res) const |
Interpolate lens TCA calibration data for given focal length. | |
bool | InterpolateVignetting (float focal, float aperture, float distance, lfLensCalibVignetting &res) const |
Interpolate lens vignetting model parameters for given focal distance, aperture and focus distance. | |
Static Public Member Functions | |
static const char * | GetDistortionModelDesc (lfDistortionModel model, const char **details, const lfParameter ***params) |
Get the human-readable distortion model name and the descriptions of the parameters required by this model. | |
static const char * | GetTCAModelDesc (lfTCAModel model, const char **details, const lfParameter ***params) |
Get the human-readable transversal chromatic aberrations model name and the descriptions of the parameters required by this model. | |
static const char * | GetVignettingModelDesc (lfVignettingModel model, const char **details, const lfParameter ***params) |
Get the human-readable vignetting model name and the descriptions of the parameters required by this model. | |
static const char * | GetLensTypeDesc (lfLensType type, const char **details) |
Get the human-readable lens type name and a short description of this lens type. | |
Public Attributes | |
lfMLstr | Maker |
Lens maker (ex: "Rollei"). | |
lfMLstr | Model |
Lens model (ex: "Zoom-Rolleinar"). | |
float | MinFocal |
Minimum focal distance, mm (ex: 35). | |
float | MaxFocal |
Maximum focal distance, mm (ex: 105). | |
float | MinAperture |
Aperture at minimum focal distance (ex: 3.5). | |
float | MaxAperture |
Aperture at maximum focal distance (ex: 4.3). | |
char ** | Mounts |
Available mounts (NULL-terminated list) (ex: { "QBM", NULL }). | |
float | CenterX |
The horizontal shift of all lens distortions. | |
float | CenterY |
The vertical shift of all lens distortions. | |
float | RedCCI |
Lens colour contribution index (ISO/CCI, ISO 6728:1983). | |
float | GreenCCI |
Green component of lens CCI. | |
float | BlueCCI |
Blue component of lens CCI. | |
float | CropFactor |
Crop factor at which calibration measurements were taken. | |
lfLensType | Type |
Lens type. | |
lfLensCalibDistortion ** | CalibDistortion |
Lens distortion calibration data, NULL-terminated (unsorted). | |
lfLensCalibTCA ** | CalibTCA |
Lens TCA calibration data, NULL-terminated (unsorted). | |
lfLensCalibVignetting ** | CalibVignetting |
Lens vignetting calibration data, NULL-terminated (unsorted). | |
int | Score |
Lens matching score, used while searching: not actually a lens parameter. |
Unknown fields are set to NULL or 0.
To create a new lens object, use the lfLens::Create() or lf_lens_new() functions. After that fill the fields for which you have data, and invoke the lfLens::Check or lf_lens_check() function, which will check if existing data is enough and will fill some fields using information extracted from lens name.
void lfLens::SetMaker | ( | const char * | val, | |
const char * | lang = NULL | |||
) |
Add a string to camera maker.
If lang is NULL, this replaces the default value, otherwise a new language value is appended.
val | The new value for the Maker field. | |
lang | The language this field is in. |
void lfLens::SetModel | ( | const char * | val, | |
const char * | lang = NULL | |||
) |
Add a string to camera model.
If lang is NULL, this replaces the default value, otherwise a new language value is appended.
val | The new value for the Model field. | |
lang | The language this field is in. |
void lfLens::AddMount | ( | const char * | val | ) |
Add a new mount type to this lens.
This is not a multi-language string, this it's just plain replaced.
val | The new value to add to the Mounts array. |
void lfLens::AddCalibDistortion | ( | const lfLensCalibDistortion * | dc | ) |
Add a new distortion calibration structure to the pool.
The objects is copied, thus you can reuse it as soon as this function returns.
dc | The distortion calibration structure. |
bool lfLens::RemoveCalibDistortion | ( | int | idx | ) |
Remove a calibration entry from the distortion calibration data.
idx | The calibration data index (zero-based). |
void lfLens::AddCalibTCA | ( | const lfLensCalibTCA * | tcac | ) |
Add a new transversal chromatic aberration calibration structure to the pool.
The objects is copied, thus you can reuse it as soon as this function returns.
tcac | The transversal chromatic aberration calibration structure. |
bool lfLens::RemoveCalibTCA | ( | int | idx | ) |
Remove a calibration entry from the TCA calibration data.
idx | The calibration data index (zero-based). |
void lfLens::AddCalibVignetting | ( | const lfLensCalibVignetting * | vc | ) |
Add a new vignetting calibration structure to the pool.
The objects is copied, thus you can reuse it as soon as this function returns.
vc | The vignetting calibration structure. |
bool lfLens::RemoveCalibVignetting | ( | int | idx | ) |
Remove a calibration entry from the vignetting calibration data.
idx | The calibration data index (zero-based). |
void lfLens::GuessParameters | ( | ) |
This method fills some fields if they are missing but can be derived from other fields.
This includes such non-obvious parameters like the range of focal distances or the range of apertures, which can be derived from lens named (which is intelligently parsed) or from the list of calibrations.
bool lfLens::Check | ( | ) |
Check if a lens object is valid.
static const char* lfLens::GetDistortionModelDesc | ( | lfDistortionModel | model, | |
const char ** | details, | |||
const lfParameter *** | params | |||
) | [static] |
Get the human-readable distortion model name and the descriptions of the parameters required by this model.
model | The model. | |
details | If not NULL, this string will be set to a more detailed (technical) description of the model. This string may contain newlines. | |
params | If not NULL, this variable will be set to a pointer to an array of lfParameter structures, every structure describes a model parameter. The list is NULL-terminated. |
static const char* lfLens::GetTCAModelDesc | ( | lfTCAModel | model, | |
const char ** | details, | |||
const lfParameter *** | params | |||
) | [static] |
Get the human-readable transversal chromatic aberrations model name and the descriptions of the parameters required by this model.
model | The model. | |
details | If not NULL, this string will be set to a more detailed (technical) description of the model. This string may contain newlines. | |
params | If not NULL, this variable will be set to a pointer to an array of lfParameter structures, every structure describes a model parameter. The list is NULL-terminated. |
static const char* lfLens::GetVignettingModelDesc | ( | lfVignettingModel | model, | |
const char ** | details, | |||
const lfParameter *** | params | |||
) | [static] |
Get the human-readable vignetting model name and the descriptions of the parameters required by this model.
model | The model. | |
details | If not NULL, this string will be set to a more detailed (technical) description of the model. This string may contain newlines. | |
params | If not NULL, this variable will be set to a pointer to an array of lfParameter structures, every structure describes a model parameter. The list is NULL-terminated. |
static const char* lfLens::GetLensTypeDesc | ( | lfLensType | type, | |
const char ** | details | |||
) | [static] |
Get the human-readable lens type name and a short description of this lens type.
type | Lens type. | |
details | If not NULL, this string will be set to a more detailed (technical) description of the lens type. This string may contain newlines. |
bool lfLens::InterpolateDistortion | ( | float | focal, | |
lfLensCalibDistortion & | res | |||
) | const |
Interpolate lens geometry distortion data for given focal length.
focal | The focal distance at which we need geometry distortion parameters. | |
res | The resulting interpolated model. |
bool lfLens::InterpolateTCA | ( | float | focal, | |
lfLensCalibTCA & | res | |||
) | const |
Interpolate lens TCA calibration data for given focal length.
focal | The focal distance at which we need TCA parameters. | |
res | The resulting interpolated model. |
bool lfLens::InterpolateVignetting | ( | float | focal, | |
float | aperture, | |||
float | distance, | |||
lfLensCalibVignetting & | res | |||
) | const |
Interpolate lens vignetting model parameters for given focal distance, aperture and focus distance.
focal | The focal distance for which we need vignetting parameters. | |
aperture | The aperture value for which we need vignetting parameters. | |
distance | The focus distance for which we need vignetting parameters. | |
res | The resulting interpolated model. |
float lfLens::MinFocal |
float lfLens::MaxFocal |
float lfLens::MinAperture |
float lfLens::MaxAperture |
float lfLens::CenterX |
The horizontal shift of all lens distortions.
Note that distortion and TCA uses same geometrical lens center. It is given as a relative value to avoide dependency on the image and/or sensor sizes. The calibrated delta X and Y values are numbers in the -0.5 .. +0.5 range. For 1 we take the maximal image dimension (width or height) - this is related to the fact that the lens has a circular field of projection disregarding sensor size.
float lfLens::CenterY |
float lfLens::RedCCI |
float lfLens::CropFactor |