FaceGen 3 SDKs Reference
Loading...
Searching...
No Matches
FgPhotoFit.h
1//
2// Copyright (c) 2023 Singular Inversions Inc. (facegen.com)
3// Created: May 28, 2003.
4// Authors: John Leung, Andrew Beatty
5//
6// FaceGen 3 Photofit
7//
8// USE:
9//
10// This DLL should only ever be used by a single thread at a time - it is
11// not re-entrant or multi-thread safe.
12//
13// DESIGN:
14//
15// The API function calls are C-style using only simple data structures to keep the DLL binary
16// interface compatible across different compilers. Structure sizes are multiples of 4 bytes so
17// there should be no padding issues between compilers. Data structure member functions do not
18// affect the function ABI and the data structures do not contain implementation-dependent type
19// structures such as std::vector. And of course this API returns error codes instead of throwing
20// exceptions.
21//
22// HCSI := Head Coordinate System in Inches.
23// Origin at centre of face
24// X - face left (viewer's right)
25// Y - face up
26// Z - face forward
27//
28
29#ifndef FG_PHOTOFIT_H
30#define FG_PHOTOFIT_H
31
32#include "FgDynLib.h"
33#include "FgTransform.hpp"
34
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45#include <string.h>
46
56{
58 unsigned int width;
60 unsigned int height;
66 unsigned int widthStep;
75 const void *imageData;
82 unsigned int numPoints;
84 unsigned int pointX[11];
86 unsigned int pointY[11];
87};
88
91{
93 float coordGS[50];
95 float coordGA[30];
97 float coordTS[50];
99 unsigned long long detailSize; // Just in case compiled with 64 bit padding
116 void *transforms; // C++ type Mat44D[]
117};
118
123FG_DLL_DECLARE
124void
125fgppDiagnostics(int outputOn);
126
131FG_DLL_DECLARE
132void
134
139FG_DLL_DECLARE
140void
141fgppLogFile(char const * fnameUtf8);
142
143#ifdef _WIN32
148FG_DLL_DECLARE
149void
150fgppLogFileW(const wchar_t * fnameUtf);
151#endif
152
157FG_DLL_DECLARE
158void
168 int (*cancelCheck)(int milestone));
169
174FG_DLL_DECLARE
175int
177
179FG_DLL_DECLARE
180void
183 unsigned int numThreads);
184
195FG_DLL_DECLARE
196int
197fgppInitialize(char const *fitDataDirectory);
198
199#ifdef _WIN32
209FG_DLL_DECLARE
210int
211fgppInitializeW(
213 const wchar_t *fitDataDirectory);
214#endif
215
227FG_DLL_DECLARE
228int
231 float dist);
232
237FG_DLL_DECLARE
238void
241 int msd);
242
244FG_DLL_DECLARE
245void
253 int level);
254
266FG_DLL_DECLARE
267int
270 const FgppUserDataS * pointsData);
271
287FG_DLL_DECLARE
288int
291 unsigned int numPhotos,
292 const FgppUserDataS *userDataArray,
296 long withHair,
300 long frontDetailOnly,
301 FgppFgCPackS *fgCPack
302);
303
308FG_DLL_DECLARE
309void
311
314#ifdef __cplusplus
315}
316#endif
317
318#endif // #ifndef FG_PHOTOFIT_H
FG_DLL_DECLARE void fgppSetNumThreads(unsigned int numThreads)
FG_DLL_DECLARE int fgppValidatePoints(const FgppUserDataS *pointsData)
FG_DLL_DECLARE int fgppNumberOfMilestones()
FG_DLL_DECLARE void fgppSetCancelCallback(int(*cancelCheck)(int milestone))
FG_DLL_DECLARE int fgppFitImages(unsigned int numPhotos, const FgppUserDataS *userDataArray, long withHair, long frontDetailOnly, FgppFgCPackS *fgCPack)
FG_DLL_DECLARE void fgppSetMirrorSideDetail(int msd)
FG_DLL_DECLARE void fgppDeallocate()
FG_DLL_DECLARE void fgppLogFile(char const *fnameUtf8)
FG_DLL_DECLARE void fgppSetSpeedup(int level)
FG_DLL_DECLARE void fgppDiagnosticIndent(int level)
FG_DLL_DECLARE int fgppInitialize(char const *fitDataDirectory)
FG_DLL_DECLARE int fgppSetCameraDistance(float dist)
FG_DLL_DECLARE void fgppDiagnostics(int outputOn)
Results of a Photofit.
Definition FgPhotoFit.h:91
void * detailTexPtr
Definition FgPhotoFit.h:107
float coordTS[50]
Texture (color) symmetric coefficients.
Definition FgPhotoFit.h:97
float coordGA[30]
Geometric (shape) asymmetric coefficients.
Definition FgPhotoFit.h:95
void * transforms
Definition FgPhotoFit.h:116
unsigned long long detailSize
Number of bytes in the detail texture array.
Definition FgPhotoFit.h:99
float coordGS[50]
Geometric (shape) symmetric coefficients.
Definition FgPhotoFit.h:93
Arguments for the Photofit.
Definition FgPhotoFit.h:56
const void * imageData
Definition FgPhotoFit.h:75
unsigned int numPoints
Definition FgPhotoFit.h:82
unsigned int widthStep
Definition FgPhotoFit.h:66
unsigned int height
Height of image in pixels.
Definition FgPhotoFit.h:60
unsigned int pointY[11]
The Y values of the boostrap points in pixel coordinates (0,0) at top left pixel.
Definition FgPhotoFit.h:86
unsigned int width
Width of image in pixels.
Definition FgPhotoFit.h:58
unsigned int pointX[11]
The X values of the boostrap points in pixel coordinates (0,0) at top left pixel.
Definition FgPhotoFit.h:84