use of jp.co.cyberagent.lansongsdk.gpuimage.IFAmaroFilter in project LanSoEditor_advance by LanSoSdk.
the class CameraSubLayerDemo1Activity method startDrawPad.
/**
* Step2: 开始运行 Drawpad线程.
*/
private void startDrawPad() {
if (mDrawPadCamera.setupDrawpad()) {
mCamLayer = mDrawPadCamera.getCameraLayer();
// 容器开始预览
mDrawPadCamera.startPreview();
// 增加一个子图层;
SubLayer layer1 = mCamLayer.addSubLayer();
SubLayer layer2 = mCamLayer.addSubLayer();
SubLayer layer3 = mCamLayer.addSubLayer();
SubLayer layer4 = mCamLayer.addSubLayer();
// 左上角为0,0;, 设置每个子图层中心点的位置
int x1 = layer1.getPadWidth() / 4;
int y1 = layer1.getPadHeight() / 4;
int x2 = layer2.getPadWidth() / 4;
int y2 = layer2.getPadHeight() * 3 / 4;
int x3 = layer3.getPadWidth() * 3 / 4;
int y3 = layer3.getPadHeight() / 4;
int x4 = layer4.getPadWidth() * 3 / 4;
int y4 = layer4.getPadHeight() * 3 / 4;
layer1.setPosition(x1, y1);
layer2.setPosition(x2, y2);
layer3.setPosition(x3, y3);
layer4.setPosition(x4, y4);
// 第一个增加一个边框
// layer1.setVisibleRect(0.02f,0.98f,0.02f,0.98f); //这里0.02和0.98, 是为了上下左右边框留出0.02的边框;
// layer1.setVisibleRectBorder(0.02f, 1.0f, 0.0f, 0.0f, 1.0f); //设置边框;
// 增加不同的滤镜来显示效果
layer1.switchFilterTo(new IF1977Filter(mContext));
layer2.switchFilterTo(new IFAmaroFilter(mContext));
layer3.switchFilterTo(new IFEarlybirdFilter(mContext));
layer4.switchFilterTo(new IFNashvilleFilter(mContext));
// 增加滤镜, 应该从当前图层就可以增加滤镜!!!!
} else {
Log.i(TAG, "建立drawpad线程失败.");
}
}
Aggregations