Skip to main content
SDK 2.0.0. Namespace facebetter. Headers: facebetter/beauty_effect_engine.h, beauty_params.h, image_frame.h, type_defines.h. Style / color / reshape enums: Parameter enums. Auth: Auth & License.

Logging

LogLevel

LogConfig


Engine

EngineConfig

Auth priority: if license_token is non-empty, validate that token locally and skip app_id + app_key network auth. Otherwise use app_id + app_key against /facebetter/v2/auth.

BeautyEffectEngine

Non-copyable. Create with Create; destroy by releasing the shared_ptr.

SetLogConfig (static)

Call before Create. Returns 0 on success.

Create (static)

Returns nullptr on failure.

Skin

Intensities [0.0, 1.0] unless noted. 0 is off. Returns 0 on success.
SetBeautySkinOnly(true) applies smoothing / whitening / etc. only on detected skin. Style enums: Parameter enums.

Reshape

intensity is [-1.0, 1.0]. 0 is off. Positive / negative are opposite directions. Full list: Parameter enums.

Body reshape

intensity is [0.0, 1.0]. 0 is off. Requires resource_body.fbd (sibling of resource.fbd, or AddResourcePack). Full list: Parameter enums. Packs: Optional resource packs.

Makeup

Each effect has intensity plus Style (mask) and/or Color (tint). Lipstick: Color only. Pupil: Color only. Contour: Style only.
Values: Parameter enums.

Chroma key

Mask for virtual background. Fill is still SetVirtualBackgroundBlur / SetVirtualBackground. With no fill, the keyed region is transparent. ClearChromaKey() restores portrait segmentation.
ChromaKeyColor: Green = 0, Blue, Red.

Virtual background

PNG / JPEG. Path must be non-empty. Bytes overload is encoded image data.

Filter (LUT .fbd)

GPU LUT is created on the next ProcessImage. No register / ID API.

Sticker (.fbd)

Load optional packs first (resource_3d.fbd before 3D stickers, resource_body.fbd before body reshape). See Optional resource packs.

Stats, callbacks, process

Set image_frame->type to FrameType::Image or FrameType::Video (default). Output format tracks input when possible. Returns nullptr on failure.

EngineStats

Callbacks and events

on_face_landmarks may run every processed frame (empty if no face).

Image

Format

Rotation

FrameType

Set on ImageFrame::type.

ImageFrame

Not copyable. Not thread-safe. Factories
Prefer dedicated YUV factories over Create for multi-plane formats. Operations
Accessors: Width(), Height(), Stride(), Size(), GetFormat(), Data(), DataY/U/V(), StrideY/U/V(), DataUV(), StrideUV(), Texture(), Buffer(), MirrorHorizontal(), MirrorVertical(). Public field: FrameType type = FrameType::Video.

Detection types


Error codes

Typical int returns:

Notes

  • Thread safety: serialize ProcessImage and mutating calls on one thread (or the GL thread if external_context).
  • Lifetime: factory methods return std::shared_ptr.
  • Pixel pointers from Data() are const — do not write through them.
  • SetRenderView is iOS / macOS only.
  • Windows binary: link facebetter.lib, load facebetter.dll at runtime.