绿幕bundle主要是用来作绿幕抠图使用的,用绿色或蓝色背景,抠图效果会更佳。
Module | 类名 | 说明 |
core | BgSegGreen | 绿幕抠像功能业务模型 |
绿幕抠像功能模型
属性 | 说明 | 默认值 | 备注 |
enable | 绿幕抠像开关 | true | true表示开启,false表示关闭 |
isBGRA | BGRA类型 | false | 背景图片的颜色是否是BGRA类型 |
colorRGB | 锚点颜色 | FUColorRGBData(0.0, 255.0, 0.0) | 选取的颜色RGB |
similarity | 相似度 | 0.518 | 取值范围0.0-1.0,相似度:色度最大容差,色度最大容差值越大,更多幕景被抠除 |
smoothness | 平滑度 | 0.22 | 取值范围0.0-1.0,平滑:色度最小限差,值越大,更多幕景被扣除 |
transparency | 透明度 | 0.0 | 取值范围0.0-1.0,透明度:图像前后景透明度过度,值越大,两者边缘处透明过度更平滑 |
centerPoint | 中心坐标 | FUCoordinate2DData(0.5, 0.5) | 取值范围0.0-1.0, [0.5,0.5]表示中心点坐标 |
zoom | 缩放程度 | 1.0 | 取值范围0.25-4.0 |
fun createBgSegment(rgba: ByteArray, width: Int, height: Int)
rgba:图象Buffer width:图象宽 height:图象高
bgSegGreen.createBgSegment(bytes, width, height);
fun removeBgSegment()
bgSegGreen.removeBgSegment();
createSafeAreaSegment(rgba: ByteArray, width: Int, height: Int)
rgba:图象Buffer width:图象宽 height:图象高
bgSegGreen.createSafeAreaSegment(bytes, width, height);
fun removeSafeAreaSegment()
bgSegGreen.removeSafeAreaSegment();
class BgSegGreen(val bundle: FUBundleData)
bundle:通过绿幕抠像Bundle文件构造的文件数据模型
BgSegGreen bgSegGreen = new BgSegGreen(new FUBundleData(DemoConfig.BUNDLE_BG_SEG_GREEN));