SDK 2.0.0. C++ API is shared with Windows. Enums: Parameter enums.
Point resource_path at resource.fbd
Pass the file, not a directory:
fopen.
One engine, serial ProcessImage
Create returns a shared_ptr. The engine is not a singleton. Serialize ProcessImage (and mutating setters) on one thread. If external_context = true, that thread must have a current GL context.
FrameType on the frame
Large stills (preview vs export)
Do not feed full-resolution pixels intoProcessImage on every slider change, and do not throw the original away after scaling.
When the photo opens, keep the full buffer and build one preview frame (long edge about 1280–1440). Slider changes process the preview (FrameType::Image). Export processes a full-resolution frame with the same setters. Output size matches the input. Camera preview stays capture resolution + FrameType::Video.
Intensities and skin-only
Realtime: start around0.15–0.3. Reshape is [-1.0, 1.0]. Use SetBeautySkinOnly(true) so smoothing stays on skin.
Filters and stickers
.fbd path or bytes. Takes effect on the next ProcessImage. Do not swap assets every frame.
GetStats
Shared library
- Development:
LD_LIBRARY_PATH - Shipping:
RPATH/RUNPATH, or install to/usr/local/lib+ldconfig - Keep
libfacebetter.soand headers from the same SDK build (./scripts/build_linux.shor the download zip)
OpenGL
Defaultexternal_context = false uses an SDK-managed OpenGL context. If GLFW / EGL already owns the context, set true and process on that thread. Need a working Mesa/NVIDIA/AMD driver; glxinfo should report 3.0+.
Pause when idle
SkipProcessImage when the window is unmapped. engine.reset() when the session ends.
Auth
license_token for offline hosts; otherwise app_id + app_key online v2. Load secrets from env/config, not source. See Auth & License.
