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

@curve with @adjust not working

Open imandaliya opened this issue 6 years ago • 7 comments

@wysaid hi, i just modified some BasicImageDemoActivity.java filter and add @curve filter t at 0 index then run program, i fond that @curve filter is not working with @adjust.

` protected static final String BASIC_FILTER_CONFIG = "@curve R(0, 0)(117, 95)(155, 171)(179, 225)(255, 255)G(0, 0)(94, 66)(155, 176)(255, 255)B(0, 0)(48, 59)(141, 130)(255, 224) @adjust brightness 0 @adjust contrast 1 @adjust saturation 1 @adjust sharpen 0"; protected static final String[] BASIC_FILTER_NAMES = { "curve", "brightness", "contrast", "saturation", "sharpen" };

AdjustConfig[] mAdjustConfigs = { new AdjustConfig(0, 0.0f, 0.0f, 1.0f), //curve new AdjustConfig(1, -1.0f, 0.0f, 1.0f), //brightness new AdjustConfig(2, 0.1f, 1.0f, 3.0f), //contrast new AdjustConfig(3, 0.0f, 1.0f, 3.0f), //saturation new AdjustConfig(4, -1.0f, 0.0f, 10.0f) //sharpen }; `

imandaliya avatar Feb 10 '20 10:02 imandaliya

Some filters' intensity just can not be changed by now. You can implement their setIntensity function. I will solve this later.

wysaid avatar Feb 11 '20 01:02 wysaid

thanks @wysaid. Issue solved by implementing setIntensity in CGEMoreCurveTexFilter with changing fragment shader.

imandaliya avatar Feb 12 '20 07:02 imandaliya

Now, The new problem arrives with multiple filter. Step 1 : First assume above filter list, then apply that filter Now if i want to change particular filter, let example

filter at index 0 = @curve R(0, 0)(117, 95)(155, 171)(179, 225)(255, 255)G(0, 0)(94, 66)(155, 176)(255, 255)B(0, 0)(48, 59)(141, 130)(255, 224) to @curve R(0, 4)(255, 244)G(0, 0)(255, 255)B(0, 84)(255, 194) then i have to apply whole filter using setFilterWithConfig method, can i change particular filter in filter list and apply direct without affecting already passed filter ?

imandaliya avatar Feb 12 '20 07:02 imandaliya

thanks @wysaid. Issue solved by implementing setIntensity in CGEMoreCurveTexFilter with changing fragment shader.

👍

wysaid avatar Feb 12 '20 07:02 wysaid

Now, The new problem arrives with multiple filter. Step 1 : First assume above filter list, then apply that filter Now if i want to change particular filter, let example

filter at index 0 = @curve R(0, 0)(117, 95)(155, 171)(179, 225)(255, 255)G(0, 0)(94, 66)(155, 176)(255, 255)B(0, 0)(48, 59)(141, 130)(255, 224) to @curve R(0, 4)(255, 244)G(0, 0)(255, 255)B(0, 84)(255, 194) then i have to apply whole filter using setFilterWithConfig method, can i change particular filter in filter list and apply direct without affecting already passed filter ?

Sure, you should write some function to manage your filter in CGEImageHandler. Plz have a try.

wysaid avatar Feb 12 '20 08:02 wysaid

Yah, but where i can replace already added curve filter string to new curve filter string.

imandaliya avatar Feb 12 '20 13:02 imandaliya

@wysaid i tried but no result, do you have some reference where i can replace new filter with the already applied filters( in multiple filter list )

imandaliya avatar Feb 20 '20 11:02 imandaliya