29 # define C_TYPEDEF(t,c)
31 # define C_TYPEDEF(t,c) typedef t c c;
47 #ifdef CONF_SYMBOL_VISIBILITY
48 # if defined PLATFORM_WINDOWS
49 # define LF_EXPORT __declspec(dllexport)
50 # elif defined CONF_COMPILER_GCC
51 # define LF_EXPORT __attribute__((visibility("default")))
53 # error "I don't know how to change symbol visibility for your compiler"
56 # if defined CONF_COMPILER_MSVC
57 # define LF_EXPORT __declspec(dllimport)
167 lfMount &operator = (
const lfMount &other);
182 void SetName (
const char *val,
const char *lang = NULL);
189 void AddCompat (
const char *val);
281 lfCamera (
const lfCamera &other);
291 lfCamera &operator = (
const lfCamera &other);
301 void SetMaker (
const char *val,
const char *lang = NULL);
311 void SetModel (
const char *val,
const char *lang = NULL);
321 void SetVariant (
const char *val,
const char *lang = NULL);
328 void SetMount (
const char *val);
647 lfLens (
const lfLens &other);
657 lfLens &operator = (
const lfLens &other);
667 void SetMaker (
const char *val,
const char *lang = NULL);
677 void SetModel (
const char *val,
const char *lang = NULL);
685 void AddMount (
const char *val);
701 bool RemoveCalibDistortion (
int idx);
717 bool RemoveCalibTCA (
int idx);
733 bool RemoveCalibVignetting (
int idx);
742 void GuessParameters ();
766 static const char *GetDistortionModelDesc (
783 static const char *GetTCAModelDesc (
801 static const char *GetVignettingModelDesc (
815 static const char *GetLensTypeDesc (
lfLensType type,
const char **details);
847 bool InterpolateVignetting (
1017 lfError Load (
const char *filename);
1032 lfError Load (
const char *errcontext,
const char *data,
size_t data_size);
1041 lfError Save (
const char *filename)
const;
1056 lfError Save (
const char *filename,
1059 const lfLens *
const *lenses)
const;
1073 static char *Save (
const lfMount *
const *mounts,
1075 const lfLens *
const *lenses);
1100 const lfCamera **FindCameras (
const char *maker,
const char *model)
const;
1121 const lfCamera **FindCamerasExt (
const char *maker,
const char *model,
1122 int sflags = 0)
const;
1131 const lfCamera *
const *GetCameras ()
const;
1169 const lfLens **FindLenses (
const lfCamera *camera,
const char *maker,
1170 const char *model,
int sflags = 0)
const;
1189 const lfLens **FindLenses (
const lfLens *lens,
int sflags = 0)
const;
1198 const lfLens *
const *GetLenses ()
const;
1207 const lfMount *FindMount (
const char *mount)
const;
1216 const char *MountName (
const char *mount)
const;
1225 const lfMount *
const *GetMounts ()
const;
1265 const
char *data,
size_t data_size);
1274 const
lfLens *const *lenses);
1279 const
lfLens *const *lenses);
1283 const
lfDatabase *db, const
char *maker, const
char *model);
1287 const
lfDatabase *db, const
char *maker, const
char *model,
int sflags);
1295 const
char *lens,
int sflags);
1390 #define LF_CR_1(a) (LF_CR_ ## a)
1392 #define LF_CR_2(a,b) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4))
1394 #define LF_CR_3(a,b,c) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1395 ((LF_CR_ ## c) << 8))
1397 #define LF_CR_4(a,b,c,d) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1398 ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12))
1400 #define LF_CR_5(a,b,c,d,e) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1401 ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
1402 ((LF_CR_ ## e) << 16))
1404 #define LF_CR_6(a,b,c,d,e,f) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1405 ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
1406 ((LF_CR_ ## e) << 16) | ((LF_CR_ ## f) << 20))
1408 #define LF_CR_7(a,b,c,d,e,f,g) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1409 ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
1410 ((LF_CR_ ## e) << 16) | ((LF_CR_ ## f) << 20) | \
1411 ((LF_CR_ ## g) << 24))
1413 #define LF_CR_8(a,b,c,d,e,f,g,h) ((LF_CR_ ## a) | ((LF_CR_ ## b) << 4) | \
1414 ((LF_CR_ ## c) << 8) | ((LF_CR_ ## d) << 12) | \
1415 ((LF_CR_ ## e) << 16) | ((LF_CR_ ## f) << 20) | \
1416 ((LF_CR_ ## g) << 24) | ((LF_CR_ ## h) << 28))
1458 void *pixels,
int comp_role,
int count);
1555 static lfModifier *Create (
const lfLens *lens,
float crop,
int width,
int height);
1599 float distance,
float scale,
lfLensType targeom,
int flags,
bool reverse);
1624 void *data,
size_t data_size);
1644 void *data,
size_t data_size);
1663 void *data,
size_t data_size);
1678 bool AddSubpixelCallbackTCA (
lfLensCalibTCA &model,
bool reverse =
false);
1695 bool reverse =
false);
1712 bool reverse =
false);
1757 bool AddCoordCallbackScale (
float scale,
bool reverse =
false);
1771 float GetAutoScale (
bool reverse);
1801 bool ApplySubpixelDistortion (
float xu,
float yu,
int width,
int height,
1832 bool ApplyColorModification (
void *pixels,
float x,
float y,
int width,
int height,
1833 int comp_role,
int row_stride)
const;
1861 bool ApplyGeometryDistortion (
float xu,
float yu,
int width,
int height,
1891 bool ApplySubpixelGeometryDistortion (
float xu,
float yu,
int width,
int height,
1898 #elif defined _MSC_VER
1908 const
lfLens *lens,
float crop,
int width,
int height);
1916 float focal,
float aperture,
float distance,
float scale,
1922 void *data,
size_t data_size);
1927 void *data,
size_t data_size);
1932 void *data,
size_t data_size);
1966 lfModifier *modifier,
float xu,
float yu,
int width,
int height,
float *res);
1970 lfModifier *modifier,
void *pixels,
float x,
float y,
int width,
int height,
1971 int comp_role,
int row_stride);
1975 lfModifier *modifier,
float xu,
float yu,
int width,
int height,
float *res);
1979 lfModifier *modifier,
float xu,
float yu,
int width,
int height,
float *res);