29 # define C_TYPEDEF(t,c)
31 # define C_TYPEDEF(t,c) typedef t c c;
48 #define LF_VERSION_MAJOR 0
50 #define LF_VERSION_MINOR 2
52 #define LF_VERSION_MICRO 8
54 #define LF_VERSION_BUGFIX 0
56 #define LF_VERSION ((LF_VERSION_MAJOR << 24) | (LF_VERSION_MINOR << 16) | (LF_VERSION_MICRO << 8) | LF_VERSION_BUGFIX)
58 #if defined CONF_LENSFUN_STATIC
62 # ifdef CONF_SYMBOL_VISIBILITY
63 # if defined PLATFORM_WINDOWS
64 # define LF_EXPORT __declspec(dllexport)
65 # elif defined CONF_COMPILER_GCC
66 # define LF_EXPORT __attribute__((visibility("default")))
68 # error "I don't know how to change symbol visibility for your compiler"
71 # if defined PLATFORM_WINDOWS || defined _MSC_VER
72 # define LF_EXPORT __declspec(dllimport)
182 lfMount &operator = (
const lfMount &other);
197 void SetName (
const char *val,
const char *lang = NULL);
204 void AddCompat (
const char *val);
296 lfCamera (
const lfCamera &other);
306 lfCamera &operator = (
const lfCamera &other);
316 void SetMaker (
const char *val,
const char *lang = NULL);
326 void SetModel (
const char *val,
const char *lang = NULL);
336 void SetVariant (
const char *val,
const char *lang = NULL);
343 void SetMount (
const char *val);
729 lfLens (
const lfLens &other);
739 lfLens &operator = (
const lfLens &other);
749 void SetMaker (
const char *val,
const char *lang = NULL);
759 void SetModel (
const char *val,
const char *lang = NULL);
767 void AddMount (
const char *val);
783 bool RemoveCalibDistortion (
int idx);
799 bool RemoveCalibTCA (
int idx);
815 bool RemoveCalibVignetting (
int idx);
831 bool RemoveCalibCrop (
int idx);
847 bool RemoveCalibFov (
int idx);
856 void GuessParameters ();
880 static const char *GetDistortionModelDesc (
897 static const char *GetTCAModelDesc (
915 static const char *GetVignettingModelDesc (
933 static const char *GetCropDesc (
947 static const char *GetLensTypeDesc (
lfLensType type,
const char **details);
979 bool InterpolateVignetting (
1191 lfError Load (
const char *filename);
1206 lfError Load (
const char *errcontext,
const char *data,
size_t data_size);
1215 lfError Save (
const char *filename)
const;
1230 lfError Save (
const char *filename,
1233 const lfLens *
const *lenses)
const;
1247 static char *Save (
const lfMount *
const *mounts,
1249 const lfLens *
const *lenses);
1274 const lfCamera **FindCameras (
const char *maker,
const char *model)
const;
1295 const lfCamera **FindCamerasExt (
const char *maker,
const char *model,
1296 int sflags = 0)
const;
1305 const lfCamera *
const *GetCameras ()
const;
1343 const lfLens **FindLenses (
const lfCamera *camera,
const char *maker,
1344 const char *model,
int sflags = 0)
const;
1363 const lfLens **FindLenses (
const lfLens *lens,
int sflags = 0)
const;
1372 const lfLens *
const *GetLenses ()
const;
1381 const lfMount *FindMount (
const char *mount)
const;
1390 const char *MountName (
const char *mount)
const;
1399 const lfMount *
const *GetMounts ()
const;
1439 const
char *data,
size_t data_size);
1448 const
lfLens *const *lenses);
1453 const
lfLens *const *lenses);
1457 const
lfDatabase *db, const
char *maker, const
char *model);
1461 const
lfDatabase *db, const
char *maker, const
char *model,
int sflags);
1469 const
char *lens,
int sflags);
1564 #define LF_CR_1(a) (LF_CR_ ## a)
1566 #define LF_CR_2(a,b) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4))
1568 #define LF_CR_3(a,b,c) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1569 ((LF_CR_ ## c) << 8))
1571 #define LF_CR_4(a,b,c,d) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1572 ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12))
1574 #define LF_CR_5(a,b,c,d,e) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1575 ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
1576 ((LF_CR_ ## e) << 16))
1578 #define LF_CR_6(a,b,c,d,e,f) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1579 ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
1580 ((LF_CR_ ## e) << 16) | ((LF_CR_ ## f) << 20))
1582 #define LF_CR_7(a,b,c,d,e,f,g) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1583 ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
1584 ((LF_CR_ ## e) << 16) | ((LF_CR_ ## f) << 20) | \
1585 ((LF_CR_ ## g) << 24))
1587 #define LF_CR_8(a,b,c,d,e,f,g,h) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1588 ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
1589 ((LF_CR_ ## e) << 16) | ((LF_CR_ ## f) << 20) | \
1590 ((LF_CR_ ## g) << 24) | ((LF_CR_ ## h) << 28))
1632 void *pixels,
int comp_role,
int count);
1729 static lfModifier *Create (
const lfLens *lens,
float crop,
int width,
int height);
1773 float distance,
float scale,
lfLensType targeom,
int flags,
bool reverse);
1798 void *data,
size_t data_size);
1818 void *data,
size_t data_size);
1837 void *data,
size_t data_size);
1852 bool AddSubpixelCallbackTCA (
lfLensCalibTCA &model,
bool reverse =
false);
1869 bool reverse =
false);
1886 bool reverse =
false);
1931 bool AddCoordCallbackScale (
float scale,
bool reverse =
false);
1945 float GetAutoScale (
bool reverse);
1975 bool ApplySubpixelDistortion (
float xu,
float yu,
int width,
int height,
2006 bool ApplyColorModification (
void *pixels,
float x,
float y,
int width,
int height,
2007 int comp_role,
int row_stride)
const;
2035 bool ApplyGeometryDistortion (
float xu,
float yu,
int width,
int height,
2065 bool ApplySubpixelGeometryDistortion (
float xu,
float yu,
int width,
int height,
2072 #elif defined _MSC_VER
2082 const
lfLens *lens,
float crop,
int width,
int height);
2090 float focal,
float aperture,
float distance,
float scale,
2096 void *data,
size_t data_size);
2101 void *data,
size_t data_size);
2106 void *data,
size_t data_size);
2140 lfModifier *modifier,
float xu,
float yu,
int width,
int height,
float *res);
2144 lfModifier *modifier,
void *pixels,
float x,
float y,
int width,
int height,
2145 int comp_role,
int row_stride);
2149 lfModifier *modifier,
float xu,
float yu,
int width,
int height,
float *res);
2153 lfModifier *modifier,
float xu,
float yu,
int width,
int height,
float *res);