lensfun: lensfun.h File Reference

Classes | Defines | Typedefs | Enumerations | Functions

# lensfun.h File Reference

This file defines the interface to the lensfun library. More...

`#include <stddef.h>`

Go to the source code of this file.

## Classes
struct | lfMount
| This structure contains everything specific to a camera mount. More...
struct | lfCamera
| Camera data. More...
struct | lfLensCalibDistortion
| Lens distortion calibration data. More...
struct | lfLensCalibTCA
| Laterlal chromatic aberrations calibration data. More...
struct | lfLensCalibVignetting
| Lens vignetting calibration data. More...
struct | lfParameter
| This structure describes a single parameter for some lens model. More...
struct | lfLens
| Lens data. More...
struct | lfDatabase
| A lens database object. More...
struct | lfModifier
| A modifier object contains optimized data required to rectify a image. More...
## Defines
#define | C_TYPEDEF(t, c)
| Helper macro to make C/C++ work similarly.
#define | LF_EXPORT
| This macro expands to an appropiate symbol visibility declaration.
#define | cbool int
| C-compatible bool type; don't bother to define Yet Another Boolean Type.
#define | LF_CR_1(a) (LF_CR_ ## a)
| This macro defines a pixel format consisting of one component.
#define | LF_CR_2(a, b) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4))
| This macro defines a pixel format consisting of two components.
#define | LF_CR_3(a, b, c)
| This macro defines a pixel format consisting of three components.
#define | LF_CR_4(a, b, c, d)
| This macro defines a pixel format consisting of four components.
#define | LF_CR_5(a, b, c, d, e)
| This macro defines a pixel format consisting of five components.
#define | LF_CR_6(a, b, c, d, e, f)
| This macro defines a pixel format consisting of six components.
#define | LF_CR_7(a, b, c, d, e, f, g)
| This macro defines a pixel format consisting of seven components.
#define | LF_CR_8(a, b, c, d, e, f, g, h)
| This macro defines a pixel format consisting of seven components.
## Typedefs
typedef char * | lfMLstr
| The storage of "multi-language" strings is simple yet flexible, handy and effective.
typedef void(* | lfSubpixelCoordFunc )(void *data, float *iocoord, int count)
| A callback function which modifies the separate coordinates for all color components for every pixel in a strip, This kind of callbacks are used in the first stage of image modification.
typedef void(* | lfModifyColorFunc )(void *data, float x, float y, void *pixels, int comp_role, int count)
| A callback function which modifies the colors of a strip of pixels This kind of callbacks are used in the second stage of image modification.
typedef void(* | lfModifyCoordFunc )(void *data, float *iocoord, int count)
| A callback function which modifies the coordinates of a strip of pixels.
## Enumerations
enum | lfError { LF_NO_ERROR = 0, LF_WRONG_FORMAT }
| liblensdb error codes: negative codes are -errno, positive are here More...
enum | lfDistortionModel { LF_DIST_MODEL_NONE, LF_DIST_MODEL_POLY3, LF_DIST_MODEL_POLY5, LF_DIST_MODEL_FOV1, LF_DIST_MODEL_PTLENS }
| The lensdb library implements several lens distortion models. More...
enum | lfTCAModel { LF_TCA_MODEL_NONE, LF_TCA_MODEL_LINEAR, LF_TCA_MODEL_POLY3 }
| The lensdb library supports several models for lens lateral chromatic aberrations (also called transversal chromatic aberrations, TCA). More...
enum | lfVignettingModel { LF_VIGNETTING_MODEL_NONE, LF_VIGNETTING_MODEL_PA }
| The lensdb library supports several models for lens vignetting correction. More...
enum | lfLensType { LF_UNKNOWN, LF_RECTILINEAR, LF_FISHEYE, LF_PANORAMIC, LF_EQUIRECTANGULAR }
| Lens type. More...
enum | { LF_SEARCH_LOOSE = 1 }
| Flags controlling the behavior of database searches. More...
enum | { LF_MODIFY_TCA = 0x00000001, LF_MODIFY_VIGNETTING = 0x00000002, LF_MODIFY_CCI = 0x00000004, LF_MODIFY_DISTORTION = 0x00000008, LF_MODIFY_GEOMETRY = 0x00000010, LF_MODIFY_SCALE = 0x00000020, LF_MODIFY_ALL = ~0 }
| A list of bitmask flags used for ordering various image corrections. More...
enum | lfPixelFormat { LF_PF_U8, LF_PF_U16, LF_PF_U32, LF_PF_F32, LF_PF_F64 }
| A list of pixel formats supported by internal colour callbacks. More...
enum | lfComponentRole { LF_CR_END = 0, LF_CR_NEXT, LF_CR_UNKNOWN, LF_CR_INTENSITY, LF_CR_RED, LF_CR_GREEN, LF_CR_BLUE }
| These constants define the role of every pixel component, four bits each. More...
## Functions
void | lf_free (void *data)
| The basics of memory allocation: never free objects allocated by the library yourselves, instead use this function.
const char * | lf_mlstr_get (const lfMLstr str)
| Get a string corresponding to current locale from a multi-language string.
lfMLstr | lf_mlstr_add (lfMLstr str, const char *lang, const char *trstr)
| Add a new translated string to a multi-language string.
lfMLstr | lf_mlstr_dup (const lfMLstr str)
| Create a complete copy of a multi-language string.
lfMount * | lf_mount_new ()
| Create a new mount object.
void | lf_mount_destroy (lfMount *mount)
| Destroy a lfMount object.
void | lf_mount_copy (lfMount *dest, const lfMount *source)
| Copy the data from one lfMount structure into another.
cbool | lf_mount_check (lfMount *mount)
lfCamera * | lf_camera_new ()
| Create a new camera object.
void | lf_camera_destroy (lfCamera *camera)
| Destroy a lfCamera object.
void | lf_camera_copy (lfCamera *dest, const lfCamera *source)
| Copy the data from one lfCamera structure into another.
cbool | lf_camera_check (lfCamera *camera)
lfLens * | lf_lens_new ()
| Create a new lens object.
void | lf_lens_destroy (lfLens *lens)
| Destroy a lfLens object.
void | lf_lens_copy (lfLens *dest, const lfLens *source)
| Copy the data from one lfLens structure into another.
cbool | lf_lens_check (lfLens *lens)
void | lf_lens_guess_parameters (lfLens *lens)
const char * | lf_get_distortion_model_desc (enum lfDistortionModel model, const char **details, const lfParameter ***params)
const char * | lf_get_tca_model_desc (enum lfTCAModel model, const char **details, const lfParameter ***params)
const char * | lf_get_vignetting_model_desc (enum lfVignettingModel model, const char **details, const lfParameter ***params)
const char * | lf_get_lens_type_desc (enum lfLensType type, const char **details)
cbool | lf_lens_interpolate_distortion (const lfLens *lens, float focal, lfLensCalibDistortion *res)
cbool | lf_lens_interpolate_tca (const lfLens *lens, float focal, lfLensCalibTCA *res)
cbool | lf_lens_interpolate_vignetting (const lfLens *lens, float focal, float aperture, float distance, lfLensCalibVignetting *res)
void | lf_lens_add_calib_distortion (lfLens *lens, const lfLensCalibDistortion *dc)
cbool | lf_lens_remove_calib_distortion (lfLens *lens, int idx)
void | lf_lens_add_calib_tca (lfLens *lens, const lfLensCalibTCA *tcac)
cbool | lf_lens_remove_calib_tca (lfLens *lens, int idx)
void | lf_lens_add_calib_vignetting (lfLens *lens, const lfLensCalibVignetting *vc)
cbool | lf_lens_remove_calib_vignetting (lfLens *lens, int idx)
lfDatabase * | lf_db_new (void)
| Create a new empty database object.
void | lf_db_destroy (lfDatabase *db)
| Destroy the database object.
lfError | lf_db_load (lfDatabase *db)
lfError | lf_db_load_file (lfDatabase *db, const char *filename)
lfError | lf_db_load_data (lfDatabase *db, const char *errcontext, const char *data, size_t data_size)
lfError | lf_db_save_all (const lfDatabase *db, const char *filename)
lfError | lf_db_save_file (const lfDatabase *db, const char *filename, const lfMount *const *mounts, const lfCamera *const *cameras, const lfLens *const *lenses)
char * | lf_db_save (const lfMount *const *mounts, const lfCamera *const *cameras, const lfLens *const *lenses)
const lfCamera ** | lf_db_find_cameras (const lfDatabase *db, const char *maker, const char *model)
const lfCamera ** | lf_db_find_cameras_ext (const lfDatabase *db, const char *maker, const char *model, int sflags)
const lfCamera *const | lf_db_get_cameras (const lfDatabase *db)
const lfLens ** | lf_db_find_lenses_hd (const lfDatabase *db, const lfCamera *camera, const char *maker, const char *lens, int sflags)
const lfLens ** | lf_db_find_lenses (const lfDatabase *db, const lfLens *lens, int sflags)
const lfLens *const | lf_db_get_lenses (const lfDatabase *db)
const lfMount * | lf_db_find_mount (const lfDatabase *db, const char *mount)
const char * | lf_db_mount_name (const lfDatabase *db, const char *mount)
const lfMount *const | lf_db_get_mounts (const lfDatabase *db)
lfModifier * | lf_modifier_new (const lfLens *lens, float crop, int width, int height)
void | lf_modifier_destroy (lfModifier *modifier)
int | lf_modifier_initialize (lfModifier *modifier, const lfLens *lens, lfPixelFormat format, float focal, float aperture, float distance, float scale, lfLensType targeom, int flags, cbool reverse)
void | lf_modifier_add_coord_callback (lfModifier *modifier, lfModifyCoordFunc callback, int priority, void *data, size_t data_size)
void | lf_modifier_add_subpixel_callback (lfModifier *modifier, lfSubpixelCoordFunc callback, int priority, void *data, size_t data_size)
void | lf_modifier_add_color_callback (lfModifier *modifier, lfModifyColorFunc callback, int priority, void *data, size_t data_size)
cbool | lf_modifier_add_subpixel_callback_TCA (lfModifier *modifier, lfLensCalibTCA *model, cbool reverse)
cbool | lf_modifier_add_color_callback_vignetting (lfModifier *modifier, lfLensCalibVignetting *model, lfPixelFormat format, cbool reverse)
cbool | lf_modifier_add_color_callback_CCI (lfModifier *modifier, const lfLens *lens, lfPixelFormat format, cbool reverse)
cbool | lf_modifier_add_coord_callback_distortion (lfModifier *modifier, lfLensCalibDistortion *model, cbool reverse)
cbool | lf_modifier_add_coord_callback_geometry (lfModifier *modifier, lfLensType from, lfLensType to, float focal)
cbool | lf_modifier_add_coord_callback_scale (lfModifier *modifier, float scale, cbool reverse)
float | lf_modifier_get_auto_scale (lfModifier *modifier, cbool reverse)
cbool | lf_modifier_apply_subpixel_distortion (lfModifier *modifier, float xu, float yu, int width, int height, float *res)
cbool | lf_modifier_apply_color_modification (lfModifier *modifier, void *pixels, float x, float y, int width, int height, int comp_role, int row_stride)
cbool | lf_modifier_apply_geometry_distortion (lfModifier *modifier, float xu, float yu, int width, int height, float *res)
cbool | lf_modifier_apply_subpixel_geometry_distortion (lfModifier *modifier, float xu, float yu, int width, int height, float *res)

## Detailed Description

This file defines the interface to the lensfun library.