Applies to: Windows and Linux. All APIs are in thefacebetternamespace.
SDK version:1.3.1
Logging
LogLevel
LogConfig
Log configuration struct. Fields:console_enabled— write to stdout (defaultfalse)file_enabled— write to a file (defaultfalse)level— minimum log level to output (defaultInfo)file_name— log file path; only used whenfile_enabled = true(default"")
Engine
EngineConfig
Engine initialization config struct. Fields:app_id— application ID from the dashboardapp_key— application key from the dashboardresource_path— path toresource.fbd(relative or absolute)license_json— offline/online license JSON string (optional)external_context— whether the caller provides the OpenGL context (defaultfalse)
- If
license_jsonis non-empty → use license JSON (supports both online response and offline license) - Otherwise → use
app_id+app_keywith network verification
BeautyEffectEngine
The main beauty engine class. Non-copyable, non-assignable.Static Methods
SetLogConfig
Create to capture initialization messages.
Returns
0 on success, non-zero on failure.
Create
nullptr on failure.
Beauty Parameters
SetBeautyParam (Basic)
[0.0, 1.0]; 0 disables the effect.
SetBeautyParam (Reshape)
SetBeautyParam (Makeup)
SetLipstickStyle / SetBlushStyle
SetBeautyParam (ChromaKey)
SetVirtualBackground
SetSkinOnlyBeauty
Filter Management
SetFilter
"" to clear.
SetFilterIntensity
[0.0, 1.0].
RegisterFilter
.fbd file path or memory buffer.
UnregisterFilter / UnregisterAllFilters
GetRegisteredFilters
Sticker Management
SetSticker
"" to clear.
RegisterSticker
.fbd file path or memory buffer.
UnregisterSticker / UnregisterAllStickers
GetRegisteredStickers
Callbacks
SetCallbacks
Image Processing
ProcessImage
nullptr on failure.
The engine tries to keep the output format consistent with the input format.
Deprecated APIs
Image
Format
Rotation
FrameType
Set viaframe->type. Controls how the engine processes each frame.
ImageFrame
Image frame class. Non-copyable. Thread safety:ImageFrame is not thread-safe. Do not call Rotate, Mirror, Convert, etc. on the same instance from multiple threads simultaneously.
Factory Methods
CreateWithFile
nullptr on failure.
Create (general)
For multi-plane YUV (I420/NV12/NV21), use the dedicated methods instead.
CreateWithRGBA
CreateWithBGRA
CreateWithRGB
CreateWithBGR
CreateWithI420
CreateWithNV12
CreateWithNV21
CreateWithTexture
CreateWithAndroid420
YUV_420_888 (primarily used on Android).
Instance Methods
Rotate
0 on success.
Mirror
mode values (case-insensitive): "horizontal", "vertical", "both".
SetMirror
ProcessImage without an extra format round-trip. Pass "" to clear.
Convert
ImageFrame. If the target format matches the current format, the returned frame shares the underlying buffer. Returns nullptr if conversion is not possible.
ToFile
quality is the JPEG compression quality (1–100); ignored for PNG. Returns 0 on success.
Data Accessors
Public Field
Callbacks and Events
EngineEventCode
EngineCallbacks
Data Structures
Point2d
Rect
FaceDetectionResult
Single face detection result.Beauty Param Enumerations
BeautyType
beauty_params::Basic
beauty_params::Reshape
beauty_params::Makeup
beauty_params::ChromaKey
beauty_params::BackgroundMode
beauty_params::VirtualBackgroundOptions
Notes
Thread safety:BeautyEffectEngine and ImageFrame are not thread-safe. Add external locking for multi-threaded use.
Memory management: All factory methods return std::shared_ptr. Memory is managed automatically.
Read-only data: Pointers returned by Data() etc. are const. Do not write to them; create a new ImageFrame if you need to modify pixel data.
SetRenderView not available: This method exists only on iOS and macOS. Do not call it on Windows or Linux.
