tencent cloud

Tencent Real-Time Communication

소식 및 공지 사항
제품 업데이트
Tencent Cloud 오디오/비디오 단말 SDK 재생 업그레이드 및 권한 부여 인증 추가
TRTC 월간 구독 패키지 출시 관련 안내
제품 소개
제품 개요
기본 개념
제품 기능
제품 장점
응용 시나리오
성능 데이터
구매 가이드
Billing Overview
무료 시간 안내
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
과금 FAQ
Refund Instructions
신규 사용자 가이드
Demo 체험
Call
개요(TUICallKit)
Activate the Service
Run Demo
빠른 통합(TUICallKit)
오프라인 푸시
Conversational Chat
온클라우드 녹화(TUICallKit)
AI Noise Reduction
UI 사용자 정의
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
릴리스 노트
FAQs
라이브 스트리밍
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Demo 실행
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDK 다운로드
API 코드 예시
Usage Guidelines
API 클라이언트 API
고급 기능
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
콘솔 가이드
애플리케이션 관리
사용량 통계
모니터링 대시보드
개발 보조
Solution
Real-Time Chorus
FAQs
과금 개요
기능 관련
UserSig 관련
방화벽 제한 처리
설치 패키지 용량 축소 관련 질문
Andriod 및 iOS 관련
Web 관련
Flutter 관련
Electron 관련
TRTCCalling Web 관련
멀티미디어 품질 관련
기타 질문
Protocols and Policies
컴플라이언스 인증
보안 백서
정보 보안에 관한 참고 사항
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약
용어집

Beauty Effects (Flutter)

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-02-06 15:33:55
BaseBeautyStore is the module in AtomicXCore for management of basic beauty effects for portraits. Through it, you can easily add natural beauty effects to your live stream or call applications.

Core Features

Skin smoothing adjustment: Set the skin smoothing strength (0-9).
Brightening effect adjustment: Set the brightening strength (0-9).
Rosy effect adjustment: Set the rosy strength (0-9).
Effect reset: One-click restore all beauty parameters to default value.
Listen for status: Get currently effective beauty parameters in real time.

Core Concepts

Before starting integration, we first learn about the core concepts related to BaseBeautyStore in the following table:
Core Concepts
Type
Core Responsibilities and Description
class
Represents the current status of the beauty module. It includes the intensity values of currently effective skin smoothing (smoothLevel), whitening (whitenessLevel), and rosy (ruddyLevel). All attributes are ValueListenable<double> data type and support subscription listening.
class
This is the core management class for interacting with the basic beauty filter feature. It is a Global Singleton (shared), responsible for ALL basic beauty parameter settings, reset and state synchronization.

Implementation Steps

Step 1: Integrate the Component

Refer to Quick Connection for seamless integration with AtomicXCore and access completed.

Step 2: Obtain the Instance and Listen to the State

Get the Global Singleton of BaseBeautyStore and set a listener to get the current beauty effect parameter status in real time.
1. Get the singleton: Directly use BaseBeautyStore.shared to get the globally unique BaseBeautyStore instance.
2. Subscription status: Listen for changes in the baseBeautyState properties via addListener to get beauty parameter updates in real time.

Sample Code

import 'package:flutter/material.dart';
import 'package:atomic_x_core/atomicxcore.dart';

class BeautyManager {
// 1. Get a singleton
final _baseBeautyStore = BaseBeautyStore.shared;
late final VoidCallback _smoothLevelChangedListener = _onSmoothLevelChanged;
late final VoidCallback _whitenessLevelChangedListener = _onWhitenessLevelChanged;
late final VoidCallback _ruddyLevelChangedListener = _onRuddyLevelChanged;

// 2. Subscription status
void subscribeToBeautyState() {
_baseBeautyStore.baseBeautyState.smoothLevel.addListener(_smoothLevelChangedListener);
_baseBeautyStore.baseBeautyState.whitenessLevel.addListener(_whitenessLevelChangedListener);
_baseBeautyStore.baseBeautyState.ruddyLevel.addListener(_ruddyLevelChangedListener);
}

void _onSmoothLevelChanged() {
final level = _baseBeautyStore.baseBeautyState.smoothLevel.value;
debugPrint('Skin smoothing strength adjustment: $level');
}

void _onWhitenessLevelChanged() {
final level = _baseBeautyStore.baseBeautyState.whitenessLevel.value;
debugPrint('Whitening strength adjustment: $level');
}

void _onRuddyLevelChanged() {
final level = _baseBeautyStore.baseBeautyState.ruddyLevel.value;
debugPrint('Rosy strength adjustment: $level');
}

// Execute dispose before logging out of the App
void dispose() {
_baseBeautyStore.baseBeautyState.smoothLevel.removeListener(_smoothLevelChangedListener);
_baseBeautyStore.baseBeautyState.whitenessLevel.removeListener(_whitenessLevelChangedListener);
_baseBeautyStore.baseBeautyState.ruddyLevel.removeListener(_ruddyLevelChangedListener);
}
}

Step 3: Set Beauty Parameters

When the user drags the beauty effect slider or clicks the preset button, call the appropriate API to set the intensity of beauty effects.
1. Get intensity value: Obtain the intensity value set by the user from the UI control (such as Slider). The parameter range accepted by the SDK API is 0-9, where 0 means disabling the effect and 9 indicates the most obvious effect. You need to map the value of the UI control (for example, 0.0 - 1.0 of the Slider) to the range of 0 - 9.
2. API call: Call setSmoothLevel(), setWhitenessLevel(), and setRuddyLevel() to set the intensity of skin smoothing, whitening, and rosy effect.

Sample Code

extension BeautyManagerExtension on BeautyManager {
/// Set the skin smoothing strength (input range 0.0 ~ 1.0, internal conversion to 0 ~ 9)
void updateSmoothLevel(double uiLevel) {
// Map the UI's 0.0 ~ 1.0 to the SDK's 0 ~ 9
final sdkLevel = uiLevel * 9.0;
_baseBeautyStore.setSmoothLevel(sdkLevel);
}

/// Set the whitening strength (input range 0.0 ~ 1.0, internal conversion to 0 ~ 9)
void updateWhitenessLevel(double uiLevel) {
final sdkLevel = uiLevel * 9.0;
_baseBeautyStore.setWhitenessLevel(sdkLevel);
}

/// Set the ruddy level (input range 0.0 ~ 1.0, internal conversion to 0 ~ 9)
void updateRuddyLevel(double uiLevel) {
final sdkLevel = uiLevel * 9.0;
_baseBeautyStore.setRuddyLevel(sdkLevel);
}
}

Step 4: Reset Beauty Effects

When the user clicks the "Reset" or "Disable Beauty Effects" button, call the baseBeautyStore.reset() method to restore all beauty parameters to the default value (usually 0).

Sample Code

extension BeautyManagerReset on BeautyManager {
/// Reset ALL basic beauty effects
void resetBeautyEffects() {
_baseBeautyStore.reset();
}
}

Build a Beauty Effect UI

Flutter recommends using ValueListenableBuilder to build responsive UI, which auto-updates the interface when beauty effect parameters change:
class BeautySliderWidget extends StatelessWidget {
final beautyStore = BaseBeautyStore.shared;

@override
Widget build(BuildContext context) {
return Column(
children: [
// Skin smoothing slider
ValueListenableBuilder<double>(
valueListenable: beautyStore.baseBeautyState.smoothLevel,
builder: (context, smoothLevel, child) {
return Row(
children: [
Text('Skin smoothing')
Expanded(
child: Slider(
value: smoothLevel,
min: 0,
max: 9,
divisions: 9,
onChanged: (value) {
beautyStore.setSmoothLevel(value);
},
),
),
Text('${smoothLevel.toInt()}'),
],
);
},
),
// Whitening slider
ValueListenableBuilder<double>(
valueListenable: beautyStore.baseBeautyState.whitenessLevel,
builder: (context, whitenessLevel, child) {
return Row(
children: [
Text('Whitening')
Expanded(
child: Slider(
value: whitenessLevel,
min: 0,
max: 9,
divisions: 9,
onChanged: (value) {
beautyStore.setWhitenessLevel(value);
},
),
),
Text('${whitenessLevel.toInt()}'),
],
);
},
),
// rosy slider
ValueListenableBuilder<double>(
valueListenable: beautyStore.baseBeautyState.ruddyLevel,
builder: (context, ruddyLevel, child) {
return Row(
children: [
Text('Rosy')
Expanded(
child: Slider(
value: ruddyLevel,
min: 0,
max: 9,
divisions: 9,
onChanged: (value) {
beautyStore.setRuddyLevel(value);
},
),
),
Text('${ruddyLevel.toInt()}'),
],
);
},
),
],
);
}
}

Complete Sample Code

import 'package:flutter/material.dart';
import 'package:atomic_x_core/atomicxcore.dart';

class BeautySettingsPage extends StatelessWidget {
final beautyStore = BaseBeautyStore.shared;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Beauty settings')),
body: Padding(
padding: EdgeInsets.all(16),
child: Column(
children: [
// Skin smoothing
_buildBeautySlider(
title: 'Skin smoothing'
valueListenable: beautyStore.baseBeautyState.smoothLevel,
onChanged: (value) => beautyStore.setSmoothLevel(value),
),
SizedBox(height: 20),
// Whitening
_buildBeautySlider(
title: 'Whitening',
valueListenable: beautyStore.baseBeautyState.whitenessLevel,
onChanged: (value) => beautyStore.setWhitenessLevel(value),
),
SizedBox(height: 20),
// Rosy
_buildBeautySlider(
title: 'Rosy'
valueListenable: beautyStore.baseBeautyState.ruddyLevel,
onChanged: (value) => beautyStore.setRuddyLevel(value),
),
SizedBox(height: 40),
// reset button
ElevatedButton(
onPressed: () {
beautyStore.reset();
},
child: Text('Reset beauty effect'),
),
],
),
),
);
}

Widget _buildBeautySlider({
required String title,
required ValueListenable<double> valueListenable,
required ValueChanged<double> onChanged,
}) {
return ValueListenableBuilder<double>(
valueListenable: valueListenable,
builder: (context, value, child) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(title, style: TextStyle(fontSize: 16)),
Text('${value.toInt()}', style: TextStyle(fontSize: 16)),
],
),
Slider(
value: value,
min: 0,
max: 9,
divisions: 9,
onChanged: onChanged,
),
],
);
},
);
}
}

Advanced Features

Basic Beauty Filter Vs Advanced Beauty Effect

AtomicXCore also provides advanced beauty features for more demanding scenarios:
Comparison Item
Basic Beauty (BaseBeautyStore)
Advanced Beauty (TencentEffect, requires additional integration)
Core Features
Skin smoothing, whitening, rosy
All basic beauty features, plus V-shaped face, eye distance, nose slimming, 3D stickers, filters, makeup, and more
Pricing
Free (included with AtomicXCore license)
Paid (requires separate TencentEffect SDK license)
Integration Method
Built-in by default, use BaseBeautyStore.shared directly
Requires additional integration of the TencentEffect component and authentication
Recommended Scenarios
Use for simple beauty requirements or when you need to quickly enable basic beauty features
Use for advanced beauty requirements, including shaping, stickers, filters, and other enhanced effects

Integrate Advanced Beauty

If you need to use the advanced beauty function, refer to the Advanced Beauty document for integration. After successful integration and authentication of TencentEffect, you can control ALL beauty effects through the API provided by TencentEffect.

API Reference

BaseBeautyStore

Property/Method
Type
Description
shared
BaseBeautyStore
Singleton instance
baseBeautyState
BaseBeautyState
Beauty effect status
setSmoothLevel
void
Set the skin smoothing strength (0-9).
setWhitenessLevel
void
Set the brightening strength (0-9).
setRuddyLevel
void
Set the rosy strength (0-9).
reset
void
Reset all beauty parameters to default value (0).

BaseBeautyState

Attribute
Type
Description
smoothLevel
ValueListenable<double>
Skin smoothing strength (0-9).
whitenessLevel
ValueListenable<double>
Brightening strength (0-9).
ruddyLevel
ValueListenable<double>
Rosy strength (0-9).

FAQs

Beauty parameters have no effect after being set

If you do not see any beauty effect after setting the parameters, check the following:
1. Camera enabled: Make sure the camera is open (for example, using DeviceStore.shared.openLocalCamera()). Beauty effects are only applied to the video stream when the camera is active.
2. Advanced beauty integration: If you have integrated TencentEffect (advanced beauty), ensure you are using the APIs provided by TencentEffect to adjust beauty settings.
3. Parameter range: For basic beauty, verify that the intensity values you provide are within the valid range (0 to 9, as a double).

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백