我正在使用 GPUImageView 对 GPUImageView 上显示的图像应用效果,我想将一种效果应用到另一种效果之上,假设我先应用了棕褐色效果,然后在此之上,我想应用对比度。我怎样才能做到这一点?
最佳答案
您需要创建 GPUImageFilterGroup
对象并使用 addFilter()
向其添加过滤器。之后,您可以将生成的过滤器应用于 GPUImageView
。例如:
GPUImageView mImageView;
private void applyFilters(float contrast, float brightness) {
GPUImageFilterGroup filterGroup = new GPUImageFilterGroup();
filterGroup.addFilter(new GPUImageContrastFilter(contrast));
filterGroup.addFilter(new GPUImageBrightnessFilter(brightness));
mImageView.setFilter(filterGroup);
}
关于android - 如何在 GPUImageView 中将一种效果应用到另一种效果之上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31464071/