lensfun: Declaring lenses: \<lens\>

# Declaring lenses: <lens>

Possible embedded elements:

<maker>string</maker>
  Lens maker. This must be specified exactly as it is returned by EXIF reading libraries to allow for automatic recognition of the lens.
<model>string</model>
  Lens model. This must be specified exactly as it is returned by EXIF reading libraries to allow for automatic recognition of the lens. See below for extended information about the model name field.
<variant>string</variant>
  Lens variant. Sometimes there are several variants of the same lens which even sometimes differs in parameters.
<type>string</type> Lens type. This is one of: "rectilinear", "fisheye", "panoramic", "equirectangular".
<focal min="number" max="number" value="number" />
  Lens focal distance. This can be either a single value for a fixed-focal length lens, or a "min-max" range in the case of a zoom lens.
<aperture min="number" max="number" value="number" />
  Lens aperture. This can be either a single value for a fixed-aperture lens, or a "min-max" range in the case of a normal lens.
<mount>string</mount>
  Lens mount. There can be multiple <mount> entries if the same lens is manufactured with several mounts, or it has a variable mount (e.g. Tamron Adaptall).
<cropfactor>number</cropfactor>
  This is the crop factor of the camera with which all shots for computing distortion models were made. The library will compute correction factors if you used this lens on another camera with a different crop factor. Generally it is advised to use a camera with maximal crop factor for this lens, because the models may become imprecise for crop factors smaller than the one used for models.
<cci r="number" g="number" b="number" />
  The Colour Contribution Index of the lens, as defined by ISO 6728-83. Unfortunately, for now this data is unused as I couldn't find the respective standard (they are sold for 30 euros or more).
<calibration>calibration data</calibration>
  Lens calibration data format

Library recognizes several ways to specify lens parameters directly in lens model name. The first way to specify lens focal distance and aperture range is "[min focal]-[max focal]mm f/[min aperture]-[max aperture]" where the "mm" and "f/" are totally optional. For primes the 'max' values may be omited. Examples:

- 70-210mm f/4-5.6
- 18-55 3.5-5.6
- 50 f2

Another pattern for lens parameters is "[min aperture]-[max aperture]/[min focal]-[max focal]". Examples:

- 2.8-3.5/25-45
- 4.5/300

If you encode lens parameters directly in the lens name, you may omit the <focal> and <aperture> elements. Also if the range of focal distances is missing both from lens name and there's no <focal> element, the library tries to guess the range of focal distances from the <calibration> section.

Note the <type> lens element. This declares the lens geometry. Most lenses are rectilinear, so this is the default value if a <type> element is missing. However, the library also supports fish-eye, panoramic (cylindrical) and equirectilinear lens types. The library allows converting images from one geometry to another, e.g. you can transform for example fish-eye images to rectilinear, panoramic images to fish-eye and so on.