lensfun: lensfun.h Source File

- Main Page
- Related Pages
- Modules
- Classes
- Files
- Examples

- File List
- File Members

# lensfun.h

Go to the documentation of this file.

    00001 /*
    00002     LensFun - a library for maintaining a database of photographical lenses,
    00003     and providing the means to correct some of the typical lens distortions.
    00004     Copyright (C) 2007 by Andrew Zabolotny
    00005
    00006     This library is free software; you can redistribute it and/or
    00007     modify it under the terms of the GNU Library General Public
    00008     License as published by the Free Software Foundation; either
    00009     version 2 of the License, or (at your option) any later version.
    00010
    00011     This library is distributed in the hope that it will be useful,
    00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00014     Library General Public License for more details.
    00015
    00016     You should have received a copy of the GNU Library General Public
    00017     License along with this library; if not, write to the Free
    00018     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00019 */
    00020
    00021 #ifndef __LENSFUN_H__
    00022 #define __LENSFUN_H__
    00023
    00024 #include <stddef.h>
    00025
    00026 #ifdef __cplusplus
    00027 extern "C" {
    00029 #  define C_TYPEDEF(t,c)
    00030 #else
    00031 #  define C_TYPEDEF(t,c) typedef t c c;
    00032 #endif
    00033
    00039 /*----------------------------------------------------------------------------*/
    00040
    00047 #ifdef CONF_SYMBOL_VISIBILITY
    00048 #   if defined PLATFORM_WINDOWS
    00049 #       define LF_EXPORT    __declspec(dllexport)
    00050 #   elif defined CONF_COMPILER_GCC
    00051 #       define LF_EXPORT    __attribute__((visibility("default")))
    00052 #   else
    00053 #       error "I don't know how to change symbol visibility for your compiler"
    00054 #   endif
    00055 #else
    00056 #   if defined CONF_COMPILER_MSVC
    00057 #       define LF_EXPORT    __declspec(dllimport)
    00058 #   else
    00059
    00060 #       define LF_EXPORT
    00061 #   endif
    00062 #endif
    00063
    00065 #define cbool int
    00066
    00075 typedef char *lfMLstr;
    00076
    00078 enum lfError
    00079 {
    00081     LF_NO_ERROR = 0,
    00083     LF_WRONG_FORMAT
    00084 };
    00085
    00086 C_TYPEDEF (enum, lfError)
    00087
    00088
    00096 LF_EXPORT void lf_free (void *data);
    00097
    00104 LF_EXPORT const char *lf_mlstr_get (const lfMLstr str);
    00105
    00121 LF_EXPORT lfMLstr lf_mlstr_add (lfMLstr str, const char *lang, const char *trstr);
    00122
    00130 LF_EXPORT lfMLstr lf_mlstr_dup (const lfMLstr str);
    00131
    00134 /*----------------------------------------------------------------------------*/
    00135
    00151 struct LF_EXPORT lfMount
    00152 {
    00154     lfMLstr Name;
    00156     char **Compat;
    00157
    00158 #ifdef __cplusplus
    00159
    00162     lfMount ();
    00163
    00167     lfMount &operator = (const lfMount &other);
    00168
    00172     ~lfMount ();
    00173
    00182     void SetName (const char *val, const char *lang = NULL);
    00183
    00189     void AddCompat (const char *val);
    00190
    00196     bool Check ();
    00197 #endif
    00198 };
    00199
    00200 C_TYPEDEF (struct, lfMount)
    00201
    00202
    00209 LF_EXPORT lfMount *lf_mount_new ();
    00210
    00219 LF_EXPORT void lf_mount_destroy (lfMount *mount);
    00220
    00230 LF_EXPORT void lf_mount_copy (lfMount *dest, const lfMount *source);
    00231
    00233 LF_EXPORT cbool lf_mount_check (lfMount *mount);
    00234
    00237 /*----------------------------------------------------------------------------*/
    00238
    00257 struct LF_EXPORT lfCamera
    00258 {
    00260     lfMLstr Maker;
    00262     lfMLstr Model;
    00264     lfMLstr Variant;
    00266     char *Mount;
    00268     float CropFactor;
    00270     int Score;
    00271
    00272 #ifdef __cplusplus
    00273
    00276     lfCamera ();
    00277
    00281     lfCamera (const lfCamera &other);
    00282
    00286     ~lfCamera ();
    00287
    00291     lfCamera &operator = (const lfCamera &other);
    00292
    00301     void SetMaker (const char *val, const char *lang = NULL);
    00302
    00311     void SetModel (const char *val, const char *lang = NULL);
    00312
    00321     void SetVariant (const char *val, const char *lang = NULL);
    00322
    00328     void SetMount (const char *val);
    00329
    00335     bool Check ();
    00336 #endif
    00337 };
    00338
    00339 C_TYPEDEF (struct, lfCamera)
    00340
    00341
    00348 LF_EXPORT lfCamera *lf_camera_new ();
    00349
    00358 LF_EXPORT void lf_camera_destroy (lfCamera *camera);
    00359
    00369 LF_EXPORT void lf_camera_copy (lfCamera *dest, const lfCamera *source);
    00370
    00372 LF_EXPORT cbool lf_camera_check (lfCamera *camera);
    00373
    00376 /*----------------------------------------------------------------------------*/
    00377
    00393 enum lfDistortionModel
    00394 {
    00396     LF_DIST_MODEL_NONE,
    00402     LF_DIST_MODEL_POLY3,
    00407     LF_DIST_MODEL_POLY5,
    00413     LF_DIST_MODEL_FOV1,
    00418     LF_DIST_MODEL_PTLENS,
    00419 };
    00420
    00421 C_TYPEDEF (enum, lfDistortionModel)
    00422
    00423
    00428 struct lfLensCalibDistortion
    00429 {
    00431     enum lfDistortionModel Model;
    00433     float Focal;
    00435     float Terms [3];
    00436 };
    00437
    00438 C_TYPEDEF (struct, lfLensCalibDistortion)
    00439
    00440
    00449 enum lfTCAModel
    00450 {
    00452     LF_TCA_MODEL_NONE,
    00459     LF_TCA_MODEL_LINEAR,
    00460
    00467     LF_TCA_MODEL_POLY3
    00468 };
    00469
    00470 C_TYPEDEF (enum, lfTCAModel)
    00471
    00472
    00478 struct lfLensCalibTCA
    00479 {
    00481     enum lfTCAModel Model;
    00483     float Focal;
    00485     float Terms [6];
    00486 };
    00487
    00488 C_TYPEDEF (struct, lfLensCalibTCA)
    00489
    00490
    00501 enum lfVignettingModel
    00502 {
    00504     LF_VIGNETTING_MODEL_NONE,
    00511     LF_VIGNETTING_MODEL_PA
    00512 };
    00513
    00514 C_TYPEDEF (enum, lfVignettingModel)
    00515
    00516
    00523 struct lfLensCalibVignetting
    00524 {
    00526     enum lfVignettingModel Model;
    00528     float Focal;
    00530     float Aperture;
    00532     float Distance;
    00534     float Terms [3];
    00535 };
    00536
    00537 C_TYPEDEF (struct, lfLensCalibVignetting)
    00538
    00539
    00542 struct lfParameter
    00543 {
    00545     const char *Name;
    00547     float Min;
    00549     float Max;
    00551     float Default;
    00552 };
    00553
    00554 C_TYPEDEF (struct, lfParameter)
    00555
    00556
    00559 enum lfLensType
    00560 {
    00562     LF_UNKNOWN,
    00564     LF_RECTILINEAR,
    00569     LF_FISHEYE,
    00571     LF_PANORAMIC,
    00576     LF_EQUIRECTANGULAR
    00577 };
    00578
    00579 C_TYPEDEF (enum, lfLensType)
    00580
    00581
    00591 struct LF_EXPORT lfLens
    00592 {
    00594     lfMLstr Maker;
    00596     lfMLstr Model;
    00598     float MinFocal;
    00600     float MaxFocal;
    00602     float MinAperture;
    00604     float MaxAperture;
    00606     char **Mounts;
    00616     float CenterX;
    00618     float CenterY;
    00620     float RedCCI;
    00622     float GreenCCI;
    00624     float BlueCCI;
    00626     float CropFactor;
    00628     lfLensType Type;
    00630     lfLensCalibDistortion **CalibDistortion;
    00632     lfLensCalibTCA **CalibTCA;
    00634     lfLensCalibVignetting **CalibVignetting;
    00636     int Score;
    00637
    00638 #ifdef __cplusplus
    00639
    00642     lfLens ();
    00643
    00647     lfLens (const lfLens &other);
    00648
    00652     ~lfLens ();
    00653
    00657     lfLens &operator = (const lfLens &other);
    00658
    00667     void SetMaker (const char *val, const char *lang = NULL);
    00668
    00677     void SetModel (const char *val, const char *lang = NULL);
    00678
    00685     void AddMount (const char *val);
    00686
    00694     void AddCalibDistortion (const lfLensCalibDistortion *dc);
    00695
    00701     bool RemoveCalibDistortion (int idx);
    00702
    00710     void AddCalibTCA (const lfLensCalibTCA *tcac);
    00711
    00717     bool RemoveCalibTCA (int idx);
    00718
    00726     void AddCalibVignetting (const lfLensCalibVignetting *vc);
    00727
    00733     bool RemoveCalibVignetting (int idx);
    00734
    00742     void GuessParameters ();
    00743
    00749     bool Check ();
    00750
    00766     static const char *GetDistortionModelDesc (
    00767         lfDistortionModel model, const char **details, const lfParameter ***params);
    00783     static const char *GetTCAModelDesc (
    00784         lfTCAModel model, const char **details, const lfParameter ***params);
    00785
    00801     static const char *GetVignettingModelDesc (
    00802         lfVignettingModel model, const char **details, const lfParameter ***params);
    00803
    00815     static const char *GetLensTypeDesc (lfLensType type, const char **details);
    00816
    00824     bool InterpolateDistortion (float focal, lfLensCalibDistortion &res) const;
    00825
    00833     bool InterpolateTCA (float focal, lfLensCalibTCA &res) const;
    00834
    00847     bool InterpolateVignetting (
    00848         float focal, float aperture, float distance, lfLensCalibVignetting &res) const;
    00849 #endif
    00850 };
    00851
    00852 C_TYPEDEF (struct, lfLens)
    00853
    00854
    00861 LF_EXPORT lfLens *lf_lens_new ();
    00862
    00871 LF_EXPORT void lf_lens_destroy (lfLens *lens);
    00872
    00882 LF_EXPORT void lf_lens_copy (lfLens *dest, const lfLens *source);
    00883
    00885 LF_EXPORT cbool lf_lens_check (lfLens *lens);
    00886
    00888 LF_EXPORT void lf_lens_guess_parameters (lfLens *lens);
    00889
    00891 LF_EXPORT const char *lf_get_distortion_model_desc (
    00892     enum lfDistortionModel model, const char **details, const lfParameter ***params);
    00893
    00895 LF_EXPORT const char *lf_get_tca_model_desc (
    00896     enum lfTCAModel model, const char **details, const lfParameter ***params);
    00897
    00899 LF_EXPORT const char *lf_get_vignetting_model_desc (
    00900     enum lfVignettingModel model, const char **details, const lfParameter ***params);
    00901
    00903 LF_EXPORT const char *lf_get_lens_type_desc (
    00904     enum lfLensType type, const char **details);
    00905
    00907 LF_EXPORT cbool lf_lens_interpolate_distortion (const lfLens *lens, float focal,
    00908     lfLensCalibDistortion *res);
    00909
    00911 LF_EXPORT cbool lf_lens_interpolate_tca (const lfLens *lens, float focal, lfLensCalibTCA *res);
    00912
    00914 LF_EXPORT cbool lf_lens_interpolate_vignetting (const lfLens *lens, float focal, float aperture,
    00915     float distance, lfLensCalibVignetting *res);
    00916
    00918 LF_EXPORT void lf_lens_add_calib_distortion (lfLens *lens, const lfLensCalibDistortion *dc);
    00919
    00921 LF_EXPORT cbool lf_lens_remove_calib_distortion (lfLens *lens, int idx);
    00922
    00924 LF_EXPORT void lf_lens_add_calib_tca (lfLens *lens, const lfLensCalibTCA *tcac);
    00925
    00927 LF_EXPORT cbool lf_lens_remove_calib_tca (lfLens *lens, int idx);
    00928
    00930 LF_EXPORT void lf_lens_add_calib_vignetting (lfLens *lens, const lfLensCalibVignetting *vc);
    00931
    00933 LF_EXPORT cbool lf_lens_remove_calib_vignetting (lfLens *lens, int idx);
    00934
    00937 /*----------------------------------------------------------------------------*/
    00938
    00948 enum
    00949 {
    00955     LF_SEARCH_LOOSE = 1
    00956 };
    00957
    00980 struct LF_EXPORT lfDatabase
    00981 {
    00983     char *HomeDataDir;
    00984
    00985 #ifdef __cplusplus
    00986
    00989     static lfDatabase *Create ();
    00990
    00994     void Destroy ();
    00995
    01004     lfError Load ();
    01005
    01017     lfError Load (const char *filename);
    01018
    01032     lfError Load (const char *errcontext, const char *data, size_t data_size);
    01033
    01041     lfError Save (const char *filename) const;
    01042
    01056     lfError Save (const char *filename,
    01057                   const lfMount *const *mounts,
    01058                   const lfCamera *const *cameras,
    01059                   const lfLens *const *lenses) const;
    01060
    01073     static char *Save (const lfMount *const *mounts,
    01074                        const lfCamera *const *cameras,
    01075                        const lfLens *const *lenses);
    01076
    01100     const lfCamera **FindCameras (const char *maker, const char *model) const;
    01101
    01121     const lfCamera **FindCamerasExt (const char *maker, const char *model,
    01122                                      int sflags = 0) const;
    01123
    01131     const lfCamera *const *GetCameras () const;
    01132
    01169     const lfLens **FindLenses (const lfCamera *camera, const char *maker,
    01170                                const char *model, int sflags = 0) const;
    01171
    01189     const lfLens **FindLenses (const lfLens *lens, int sflags = 0) const;
    01190
    01198     const lfLens *const *GetLenses () const;
    01199
    01207     const lfMount *FindMount (const char *mount) const;
    01208
    01216     const char *MountName (const char *mount) const;
    01217
    01225     const lfMount *const *GetMounts () const;
    01226
    01227 protected:
    01228     /* Prevent user from creating and destroying such objects */
    01229     lfDatabase () {}
    01230     ~lfDatabase () {}
    01231 #endif
    01232 };
    01233
    01234 C_TYPEDEF (struct, lfDatabase)
    01235
    01236
    01245 LF_EXPORT lfDatabase *lf_db_new (void);
    01246
    01255 LF_EXPORT void lf_db_destroy (lfDatabase *db);
    01256
    01258 LF_EXPORT lfError lf_db_load (lfDatabase *db);
    01259
    01261 LF_EXPORT lfError lf_db_load_file (lfDatabase *db, const char *filename);
    01262
    01264 LF_EXPORT lfError lf_db_load_data (lfDatabase *db, const char *errcontext,
    01265                                    const char *data, size_t data_size);
    01266
    01268 LF_EXPORT lfError lf_db_save_all (const lfDatabase *db, const char *filename);
    01269
    01271 LF_EXPORT lfError lf_db_save_file (const lfDatabase *db, const char *filename,
    01272                                    const lfMount *const *mounts,
    01273                                    const lfCamera *const *cameras,
    01274                                    const lfLens *const *lenses);
    01275
    01277 LF_EXPORT char *lf_db_save (const lfMount *const *mounts,
    01278                             const lfCamera *const *cameras,
    01279                             const lfLens *const *lenses);
    01280
    01282 LF_EXPORT const lfCamera **lf_db_find_cameras (
    01283     const lfDatabase *db, const char *maker, const char *model);
    01284
    01286 LF_EXPORT const lfCamera **lf_db_find_cameras_ext (
    01287     const lfDatabase *db, const char *maker, const char *model, int sflags);
    01288
    01290 LF_EXPORT const lfCamera *const *lf_db_get_cameras (const lfDatabase *db);
    01291
    01293 LF_EXPORT const lfLens **lf_db_find_lenses_hd (
    01294     const lfDatabase *db, const lfCamera *camera, const char *maker,
    01295     const char *lens, int sflags);
    01296
    01298 LF_EXPORT const lfLens **lf_db_find_lenses (
    01299     const lfDatabase *db, const lfLens *lens, int sflags);
    01300
    01302 LF_EXPORT const lfLens *const *lf_db_get_lenses (const lfDatabase *db);
    01303
    01305 LF_EXPORT const lfMount *lf_db_find_mount (const lfDatabase *db, const char *mount);
    01306
    01308 LF_EXPORT const char *lf_db_mount_name (const lfDatabase *db, const char *mount);
    01309
    01311 LF_EXPORT const lfMount *const *lf_db_get_mounts (const lfDatabase *db);
    01312
    01315 /*----------------------------------------------------------------------------*/
    01316
    01325 enum
    01326 {
    01328     LF_MODIFY_TCA        = 0x00000001,
    01330     LF_MODIFY_VIGNETTING = 0x00000002,
    01332     LF_MODIFY_CCI        = 0x00000004,
    01334     LF_MODIFY_DISTORTION = 0x00000008,
    01336     LF_MODIFY_GEOMETRY   = 0x00000010,
    01338     LF_MODIFY_SCALE      = 0x00000020,
    01340     LF_MODIFY_ALL        = ~0
    01341 };
    01342
    01344 enum lfPixelFormat
    01345 {
    01347     LF_PF_U8,
    01349     LF_PF_U16,
    01351     LF_PF_U32,
    01353     LF_PF_F32,
    01355     LF_PF_F64
    01356 };
    01357
    01358 C_TYPEDEF (enum, lfPixelFormat)
    01359
    01360
    01361 enum lfComponentRole
    01362 {
    01367     LF_CR_END = 0,
    01374     LF_CR_NEXT,
    01376     LF_CR_UNKNOWN,
    01378     LF_CR_INTENSITY,
    01380     LF_CR_RED,
    01382     LF_CR_GREEN,
    01384     LF_CR_BLUE
    01385 };
    01386
    01387 C_TYPEDEF (enum, lfComponentRole)
    01388
    01389
    01390 #define LF_CR_1(a)              (LF_CR_ ## a)
    01391
    01392 #define LF_CR_2(a,b)            ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4))
    01393
    01394 #define LF_CR_3(a,b,c)          ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
    01395                                  ((LF_CR_ ## c) << 8))
    01396
    01397 #define LF_CR_4(a,b,c,d)        ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
    01398                                  ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12))
    01399
    01400 #define LF_CR_5(a,b,c,d,e)      ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
    01401                                  ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
    01402                                  ((LF_CR_ ## e) << 16))
    01403
    01404 #define LF_CR_6(a,b,c,d,e,f)    ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
    01405                                  ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
    01406                                  ((LF_CR_ ## e) << 16) | ((LF_CR_ ## f) << 20))
    01407
    01408 #define LF_CR_7(a,b,c,d,e,f,g)   ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
    01409                                  ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
    01410                                  ((LF_CR_ ## e) << 16) | ((LF_CR_ ## f) << 20) | \
    01411                                  ((LF_CR_ ## g) << 24))
    01412
    01413 #define LF_CR_8(a,b,c,d,e,f,g,h) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
    01414                                  ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
    01415                                  ((LF_CR_ ## e) << 16) | ((LF_CR_ ## f) << 20) | \
    01416                                  ((LF_CR_ ## g) << 24) | ((LF_CR_ ## h) << 28))
    01417
    01432 typedef void (*lfSubpixelCoordFunc) (void *data, float *iocoord, int count);
    01433
    01457 typedef void (*lfModifyColorFunc) (void *data, float x, float y,
    01458                                    void *pixels, int comp_role, int count);
    01459
    01471 typedef void (*lfModifyCoordFunc) (void *data, float *iocoord, int count);
    01472
    01532 struct LF_EXPORT lfModifier
    01533 {
    01534 #ifdef __cplusplus
    01535
    01555     static lfModifier *Create (const lfLens *lens, float crop, int width, int height);
    01556
    01597     int Initialize (
    01598         const lfLens *lens, lfPixelFormat format, float focal, float aperture,
    01599         float distance, float scale, lfLensType targeom, int flags, bool reverse);
    01600
    01605     void Destroy ();
    01606
    01623     void AddCoordCallback (lfModifyCoordFunc callback, int priority,
    01624                            void *data, size_t data_size);
    01625
    01643     void AddSubpixelCallback (lfSubpixelCoordFunc callback, int priority,
    01644                               void *data, size_t data_size);
    01645
    01662     void AddColorCallback (lfModifyColorFunc callback, int priority,
    01663                            void *data, size_t data_size);
    01664
    01678     bool AddSubpixelCallbackTCA (lfLensCalibTCA &model, bool reverse = false);
    01679
    01694     bool AddColorCallbackVignetting (lfLensCalibVignetting &model, lfPixelFormat format,
    01695                                      bool reverse = false);
    01696
    01711     bool AddColorCallbackCCI (const lfLens *lens, lfPixelFormat format,
    01712                               bool reverse = false);
    01713
    01726     bool AddCoordCallbackDistortion (lfLensCalibDistortion &model, bool reverse = false);
    01727
    01740     bool AddCoordCallbackGeometry (lfLensType from, lfLensType to, float focal);
    01741
    01757     bool AddCoordCallbackScale (float scale, bool reverse = false);
    01758
    01771     float GetAutoScale (bool reverse);
    01772
    01801     bool ApplySubpixelDistortion (float xu, float yu, int width, int height,
    01802                                   float *res) const;
    01803
    01832     bool ApplyColorModification (void *pixels, float x, float y, int width, int height,
    01833                                  int comp_role, int row_stride) const;
    01834
    01861     bool ApplyGeometryDistortion (float xu, float yu, int width, int height,
    01862                                   float *res) const;
    01863
    01891     bool ApplySubpixelGeometryDistortion (float xu, float yu, int width, int height,
    01892                                           float *res) const;
    01893
    01894 protected:
    01895     /* Prevent user from creating and destroying such objects */
    01896     lfModifier () {}
    01897     ~lfModifier () {}
    01898 #elif defined _MSC_VER
    01899     /* Sucks, like always */
    01900     void *dummy;
    01901 #endif
    01902 };
    01903
    01904 C_TYPEDEF (struct, lfModifier)
    01905
    01906
    01907 LF_EXPORT lfModifier *lf_modifier_new (
    01908     const lfLens *lens, float crop, int width, int height);
    01909
    01911 LF_EXPORT void lf_modifier_destroy (lfModifier *modifier);
    01912
    01914 LF_EXPORT int lf_modifier_initialize (
    01915     lfModifier *modifier, const lfLens *lens, lfPixelFormat format,
    01916     float focal, float aperture, float distance, float scale,
    01917     lfLensType targeom, int flags, cbool reverse);
    01918
    01920 LF_EXPORT void lf_modifier_add_coord_callback (
    01921     lfModifier *modifier, lfModifyCoordFunc callback, int priority,
    01922     void *data, size_t data_size);
    01923
    01925 LF_EXPORT void lf_modifier_add_subpixel_callback (
    01926     lfModifier *modifier, lfSubpixelCoordFunc callback, int priority,
    01927     void *data, size_t data_size);
    01928
    01930 LF_EXPORT void lf_modifier_add_color_callback (
    01931     lfModifier *modifier, lfModifyColorFunc callback, int priority,
    01932     void *data, size_t data_size);
    01933
    01935 LF_EXPORT cbool lf_modifier_add_subpixel_callback_TCA (
    01936     lfModifier *modifier, lfLensCalibTCA *model, cbool reverse);
    01937
    01939 LF_EXPORT cbool lf_modifier_add_color_callback_vignetting (
    01940     lfModifier *modifier, lfLensCalibVignetting *model,
    01941     lfPixelFormat format, cbool reverse);
    01942
    01944 LF_EXPORT cbool lf_modifier_add_color_callback_CCI (
    01945     lfModifier *modifier, const lfLens *lens,
    01946     lfPixelFormat format, cbool reverse);
    01947
    01949 LF_EXPORT cbool lf_modifier_add_coord_callback_distortion (
    01950     lfModifier *modifier, lfLensCalibDistortion *model, cbool reverse);
    01951
    01953 LF_EXPORT cbool lf_modifier_add_coord_callback_geometry (
    01954     lfModifier *modifier, lfLensType from, lfLensType to, float focal);
    01955
    01957 LF_EXPORT cbool lf_modifier_add_coord_callback_scale (
    01958     lfModifier *modifier, float scale, cbool reverse);
    01959
    01961 LF_EXPORT float lf_modifier_get_auto_scale (
    01962     lfModifier *modifier, cbool reverse);
    01963
    01965 LF_EXPORT cbool lf_modifier_apply_subpixel_distortion (
    01966     lfModifier *modifier, float xu, float yu, int width, int height, float *res);
    01967
    01969 LF_EXPORT cbool lf_modifier_apply_color_modification (
    01970     lfModifier *modifier, void *pixels, float x, float y, int width, int height,
    01971     int comp_role, int row_stride);
    01972
    01974 LF_EXPORT cbool lf_modifier_apply_geometry_distortion (
    01975     lfModifier *modifier, float xu, float yu, int width, int height, float *res);
    01976
    01978 LF_EXPORT cbool lf_modifier_apply_subpixel_geometry_distortion (
    01979     lfModifier *modifier, float xu, float yu, int width, int height, float *res);
    01980
    01983 #undef cbool
    01984
    01985 #ifdef __cplusplus
    01986 }
    01987 #endif
    01988
    01989 #endif /* __LENSFUN_H__ */