use of jp.co.cyberagent.lansongsdk.gpuimage.GPUImageSwirlFilter 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;
}
}
}
use of jp.co.cyberagent.lansongsdk.gpuimage.GPUImageSwirlFilter in project LanSoEditor_advance by LanSoSdk.
the class VideoLayerTransformActivity method showFourLayer.
private void showFourLayer() {
if (videoLayer2 != null) {
if (rectFactor > 120) {
mDrawPad.removeLayer(videoLayer2);
videoLayer2 = null;
rectFactor = 0;
addCanvasLayer();
} else {
// 增加滤镜
if (mplayer2 != null) {
// 画面暂停.
mplayer2.pause();
}
// 因为java的小数点不是很精确, 这里用整数表示
float rect = (float) rectFactor;
// 转换为0--1.0
rect /= 100f;
if (swirlFilter == null) {
swirlFilter = new GPUImageSwirlFilter();
videoLayer2.switchFilterTo(swirlFilter);
}
swirlFilter.setAngle(rect);
// 设置半径是整个纹理.
swirlFilter.setRadius(1.0f);
rectFactor = rectFactor + 5;
}
}
}
use of jp.co.cyberagent.lansongsdk.gpuimage.GPUImageSwirlFilter in project LanSoEditor_advance by LanSoSdk.
the class ExecuteAllDrawpadActivity method showFourLayer.
private void showFourLayer() {
if (videoLayer2 != null) {
if (rectFactor > 120) {
mDrawPad.removeLayer(videoLayer2);
videoLayer2 = null;
rectFactor = 0;
addCanvasLayer();
} else {
// 增加滤镜动画
// 因为java的小数点不是很精确, 这里用整数表示
float rect = (float) rectFactor;
// 转换为0--1.0
rect /= 100f;
if (swirlFilter == null) {
swirlFilter = new GPUImageSwirlFilter();
videoLayer2.switchFilterTo(swirlFilter);
}
swirlFilter.setAngle(rect);
// 设置半径是整个纹理.
swirlFilter.setRadius(1.0f);
rectFactor = rectFactor + 5;
}
}
}
Aggregations