Skip to main content

Log Levels

Log level enumeration for controlling log output levels.

Log Configuration Class

Log configuration class for configuring log output methods and levels. Field Descriptions:
  • consoleEnabled: Whether to enable console output
  • fileEnabled: Whether to enable file output
  • level: Log level
  • fileName: Log file path (only effective when fileEnabled is YES)

Process Mode

Image processing mode enumeration.
  • FBProcessModeImage: Image mode, suitable for single image processing
  • FBProcessModeVideo: Video mode, suitable for video streams and live streaming scenarios, better performance

Engine Configuration

Engine configuration class for initializing the beauty engine. Field Descriptions:
  • appId: Application ID (optional, not required if licenseJson is provided)
  • appKey: Application key (optional, not required if licenseJson is provided)
  • licenseJson: License data JSON string (optional, if provided, takes priority and appId and appKey are not required)
  • externalContext: Whether to use external OpenGL context (default NO)
    • YES: Use the caller-provided GL context, SDK will not create/manage internal context
    • NO: Use internal default context
Verification Priority:
  • If licenseJson is not empty, use license data verification (supports online response and offline license)
  • Otherwise, use appId and appKey for automatic online verification

Engine Interface

Main beauty effect engine class providing entry point for beauty functionality. Static Methods:
  • setLogConfig:: Set log configuration
Instance Methods:

Parameter Settings

  • setBasicParam:floatValue:: Set basic beauty parameters (range 0.0 - 1.0)
  • setReshapeParam:floatValue:: Set face reshape parameters (range 0.0 - 1.0)
  • setMakeupParam:floatValue:: Set makeup parameters (range 0.0 - 1.0)
  • setLipstickStyle:: Set lipstick style (Rouge / Coral / Pink)
  • setBlushStyle:: Set blush style (Classic / Peach / Rose)
  • setSkinOnlyBeauty:: Set whether beauty is applied only to skin regions
    • Parameter: enabled - YES to enable skin-only beauty, NO to apply to entire image
  • setVirtualBackground:: Set virtual background
    • Parameter: FBVirtualBackgroundOptions object containing background mode and background image

Filters & Stickers Management

  • setFilter:: Set filter
    • Parameter: filterId unique filter identifier
  • setFilterIntensity:: Set filter intensity
    • Parameter: intensity intensity value (range 0.0 - 1.0)
  • setSticker:: Set sticker
    • Parameter: stickerId unique sticker identifier, pass @"" to clear the sticker
  • registerFilter:fbdFilePath:: Register filter from file
  • registerFilter:fbdData:: Register filter from memory
  • registerSticker:fbdFilePath:: Register sticker from file
  • registerSticker:fbdData:: Register sticker from memory
  • unregisterFilter:: Unload filter
  • unregisterAllFilters: Unload all filters
  • unregisterSticker:: Unload sticker
  • unregisterAllStickers: Unload all stickers
  • getRegisteredFilters: Get list of registered filters
  • getRegisteredStickers: Get list of registered stickers

Image Processing

  • processImage:: Process image frame
    • Frame type is obtained from imageFrame.type property (FBFrameTypeImage or FBFrameTypeVideo)
    • The processed image frame will maintain the same frame type
Return Value Descriptions:
  • Methods return int type: 0 indicates success, other values indicate error codes
  • processImage:processMode: returns FBImageFrame: Processed image frame, returns nil on failure

Beauty Parameters

Beauty parameter enumeration classes containing all beauty-related parameter type definitions.

Beauty Types

Define available beauty functionality types.

Basic Beauty Parameters

Basic beauty effect parameter types, all parameter value ranges are 0.0 - 1.0.

Face Reshape Parameters

Face reshape effect parameter types, all parameter value ranges are 0.0 - 1.0.

Makeup Parameters

Makeup effect parameter types, all parameter value ranges are 0.0 - 1.0.

Virtual Background Options

Virtual background effect configuration options.

FBImageFrame

Image frame class for encapsulating image data and processing. Creation Methods:
  • createWithFile:: Create from file (supports PNG, JPG)
  • createWithRGBA:width:height:stride:: Create from RGBA data
  • createWithBGRA:width:height:stride:: Create from BGRA data
  • createWithRGB:width:height:stride:: Create from RGB data
  • createWithBGR:width:height:stride:: Create from BGR data
  • createWithI420:...: Create from I420 YUV data
  • createWithNV12:...: Create from NV12 YUV data
  • createWithNV21:...: Create from NV21 YUV data
  • createWithTexture:width:height:stride:: Create from GPU texture (external texture input)
  • createWithUIImage:: Create from UIImage (iOS only)
Image Operations:
  • rotate:: Rotate image (returns 0 for success)
  • mirror:: Mirror image (returns 0 for success)
    • Parameter: mode mirror mode, can be “horizontal”, “vertical”, or “both” (case insensitive)
  • setMirror:: Set mirror mode for engine processing (avoids extra format conversion)
    • Parameter: mode mirror mode, can be “horizontal”, “vertical”, or “both” (case insensitive)
    • Note: This only sets the mirror flag, actual mirroring happens during engine processing
Format Conversion:
  • convert:: Format conversion method, returns converted FBImageFrame
  • toFile:quality:: Save image to file (specify quality 0-100)
  • toFile:: Save image to file (use default quality 90)

Enum Types

Supported Image Formats:
  • FBImageFormatI420: YUV 4:2:0 (3 planes, Y, U, V)
  • FBImageFormatNV12: YUV 4:2:0 (2 planes, Y + UV)
  • FBImageFormatNV21: YUV 4:2:0 (2 planes, Y + VU)
  • FBImageFormatRGBA, FBImageFormatBGRA: 32-bit RGBA/BGRA
  • FBImageFormatRGB, FBImageFormatBGR: 24-bit RGB/BGR
  • FBImageFormatTexture: Texture format
Image Rotation Angles:
  • FBImageRotation0: 0 degrees
  • FBImageRotation90: Clockwise 90 degrees
  • FBImageRotation180: Clockwise 180 degrees
  • FBImageRotation270: Clockwise 270 degrees
Property Access:
  • width, height: Get image width and height
  • size: Get image data size (in bytes)
  • stride: Get image stride
Data Access:
  • data: Get raw image data pointer
  • YUV format specific: dataY, dataU, dataV, dataUV
  • YUV format strides: strideY, strideU, strideV, strideUV

Deprecated APIs

DeprecatedThe following APIs are deprecated.

Beauty Type Control

  • setBeautyTypeEnabled:enabled:
    • Description: [Deprecated] Enable or disable beauty type (No effect in parameter-driven mode)
    • Return Value: 0 indicates success
  • isBeautyTypeEnabled:
    • Description: [Deprecated] Check if beauty type is enabled (Always returns NO)
    • Return Value: NO
  • disableAllBeautyTypes
    • Description: [Deprecated] Disable all beauty types (Please reset effects by zeroing parameters)
    • Return Value: 0 indicates success