cats-oss / android-gpuimage

Android filters based on OpenGL (idea from GPUImage for iOS)
8.98k stars 2.26k forks source link

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

Closed xuzhiyong017 closed 3 years ago

xuzhiyong017 commented 3 years ago

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

`

   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"))

` GPUImageFilterGroup set color

CLAassistant commented 3 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: xuzhiyong017
:x: xuzhiyong


xuzhiyong seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.