美发功能基于高精度头发分割模型,并添加纯色、渐变色等图像绘制技术,实现一键换发色特效,并开放接口支持用户自定义妆容色值。
SDK在6.6及以上的需要加美发AI驱动(ai_hairseg.bundle),通过FURenderKit.mFUAIController.loadAIProcessor方法添加
Module | 类名 | 说明 |
core | HairBeautyNormal | 单色美发功能业务模型 |
core | HairBeautyGradient | 渐变色美发功能业务模型 |
单色美发道具
属性 | 说明 | 默认值 | 备注 |
enable | 美发开关 | true | true表示开启,false表示关闭 |
hairIndex | 发色索引 | 0 | 范围[0-7],此道具预设8种发色 |
hairIntensity | 发色强度 | 1.0 | 范围[0.0-1.0] |
hairShine | 头发光泽度 | 0.0 | 范围[0.0-3.0],0.0为无光泽,3.0为最大光泽度 |
hairColorLABData | 自定义更改发色 | null | FUColorLABData类型数据,对应LAB颜色空间数值,L:[0-100] A:[-128-127] B:[-128-127] |
按照参数设置的先后关系,如果先设置了hairIndex,再设置hairColorLABData,hairShine, 则按照hairColorLABData,hairShine颜色显示。如先设置了hairColorLABData,hairShine,再设置hairIndex,则按默认hairIndex颜色效果来。
class HairBeautyNormal(val controlBundle: FUBundleData)
controlBundle:通过美发ControlBundle文件构造的文件数据模型
HairBeautyNormal normalHair = new HairBeautyNormal(new FUBundleData(DemoConfig.BUNDLE_HAIR_NORMAL));
渐变色美发道具
属性 | 说明 | 默认值 | 备注 |
enable | 美发开关 | true | true表示开启,false表示关闭 |
hairIndex | 发色索引 | 0 | 范围[0-4],此道具预设5种渐变色 |
hairIntensity | 发色强度 | 1.0 | 范围[0.0-1.0] |
hairShine | 头发光泽度 | 0.0 | 范围[0.0-3.0],0.0为无光泽,3.0为最大光泽度 |
hairShine2 | 头发光泽度 | 0.0 | 范围[0.0-3.0],0.0为无光泽,3.0为最大光泽度 |
hairColorLABData | 自定义更改发色 | null | FUColorLABData类型数据,对应LAB颜色空间数值,L:[0-100] A:[-128-127] B:[-128-127] |
hairColorLABData2 | 自定义更改发色 | null | FUColorLABData类型数据,对应LAB颜色空间数值,L:[0-100] A:[-128-127] B:[-128-127] |
按照参数设置的先后关系,如果先设置了hairIndex,再设置hairColorLABData,hairShine, 则按照hairColorLABData,hairShine颜色显示。如先设置了hairColorLABData,hairShine,再设置hairIndex,则按默认hairIndex颜色效果来。
class HairBeautyGradient(val controlBundle: FUBundleData)
controlBundle:通过美发ControlBundle文件构造的文件数据模型
HairBeautyGradient gradientHair = new HairBeautyGradient(new FUBundleData(DemoConfig.BUNDLE_HAIR_GRADIENT));