android-gpuimage icon indicating copy to clipboard operation
android-gpuimage copied to clipboard

Use GPUImageFilterGroup when image is center_ Inside mode is invalid to change the background color in GPUImageView

Open xuzhiyong017 opened this issue 4 years ago • 1 comments

What does this change?

Added the method of setting the background color, and adjust the order of the filter drawing

What is the value of this and can you measure success?

It can change the background color when gpuimageview is invalid,for example the ImageActivity

Screenshots

微信图片_20210722143423

        gpuImage.setScaleType(GPUImage.ScaleType.CENTER_INSIDE)
        gpuImage.filter = GPUImageFilterGroup(listOf(GPUImageBrightnessFilter(),
            GPUImageSaturationFilter(),
            GPUImageWhiteBalanceFilter(),
            GPUImageSharpenFilter())).apply {
            setBackgroundColor(0.27f, 0.27f, 0.27f)
        }
        gpuImage.setBackgroundColor(1f,1f,1f)
        gpuImage.setImage(Uri.parse("file:///android_asset/image.png"))

xuzhiyong017 avatar Jul 22 '21 07:07 xuzhiyong017

This fix is great. It saves lots of time.

longdt57 avatar Apr 25 '23 02:04 longdt57