Search in sources :

Example 1 with IFNashvilleFilter

use of jp.co.cyberagent.lansongsdk.gpuimage.IFNashvilleFilter in project LanSoEditor_advance by LanSoSdk.

the class ExecuteFilterDemoActivity method drawPadProgress.

/**
 * DrawPad容器的进度监听, 走到什么位置后,设置对应的内容.
 *
 * @param v
 * @param currentTimeUs
 */
private void drawPadProgress(DrawPad v, long currentTimeUs) {
    tvProgressHint.setText(String.valueOf(currentTimeUs));
    /**
     * 演示在中间切换滤镜
     * 在3秒的时候, 切换一个滤镜.
     * 在6秒的时候, 再次切换一个滤镜
     */
    if (currentTimeUs > 6 * 1000 * 1000) {
        if (mainVideoLayer != null && isNashvilleFilter == false) {
            mainVideoLayer.switchFilterTo(new IFNashvilleFilter(getApplicationContext()));
            isNashvilleFilter = true;
        }
    } else if (currentTimeUs > 3 * 1000 * 1000) {
        if (mainVideoLayer != null && isSwirlFilter == false) {
            mainVideoLayer.switchFilterTo(new GPUImageSwirlFilter());
            isSwirlFilter = true;
        }
    }
}
Also used : GPUImageSwirlFilter(jp.co.cyberagent.lansongsdk.gpuimage.GPUImageSwirlFilter) IFNashvilleFilter(jp.co.cyberagent.lansongsdk.gpuimage.IFNashvilleFilter)

Example 2 with IFNashvilleFilter

use of jp.co.cyberagent.lansongsdk.gpuimage.IFNashvilleFilter 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线程失败.");
    }
}
Also used : IFAmaroFilter(jp.co.cyberagent.lansongsdk.gpuimage.IFAmaroFilter) SubLayer(com.lansosdk.box.SubLayer) IFEarlybirdFilter(jp.co.cyberagent.lansongsdk.gpuimage.IFEarlybirdFilter) IF1977Filter(jp.co.cyberagent.lansongsdk.gpuimage.IF1977Filter) IFNashvilleFilter(jp.co.cyberagent.lansongsdk.gpuimage.IFNashvilleFilter)

Aggregations

IFNashvilleFilter (jp.co.cyberagent.lansongsdk.gpuimage.IFNashvilleFilter)2 SubLayer (com.lansosdk.box.SubLayer)1 GPUImageSwirlFilter (jp.co.cyberagent.lansongsdk.gpuimage.GPUImageSwirlFilter)1 IF1977Filter (jp.co.cyberagent.lansongsdk.gpuimage.IF1977Filter)1 IFAmaroFilter (jp.co.cyberagent.lansongsdk.gpuimage.IFAmaroFilter)1 IFEarlybirdFilter (jp.co.cyberagent.lansongsdk.gpuimage.IFEarlybirdFilter)1