Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xuzhiyong017
Copy link

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

xuzhiyong added 2 commits July 22, 2021 15:25
…und color in GPUImageView by setBackgroundColor. It need be modified in GPUImageFilterGroup

(cherry picked from commit 0702785)
@longdt57
Copy link

This fix is great. It saves lots of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants