-
- All Implemented Interfaces:
-
com.otaliastudios.cameraview.filter.Filter,com.otaliastudios.cameraview.filter.OneParameterFilter
public class SaturationFilter extends BaseFilter implements OneParameterFilter
Adjusts color saturation.
-
-
Constructor Summary
Constructors Constructor Description SaturationFilter()
-
Method Summary
Modifier and Type Method Description voidsetSaturation(float value)Sets the saturation correction value:-1.0: fully desaturated, grayscale.0.0: no change.+1.0: fully saturated. floatgetSaturation()Returns the current saturation. voidsetParameter1(float value)Sets the parameter.The value should always be between 0 and 1. floatgetParameter1()Returns the parameter.The returned value should always be between 0 and 1. StringgetFragmentShader()Returns a String containing the fragment shader. voidonCreate(int programHandle)The filter program was just created. voidonDestroy()The filter program is about to be destroyed. -
Methods inherited from class com.otaliastudios.cameraview.filter.BaseFilter
copy, draw, getVertexShader, setSize -
Methods inherited from class com.otaliastudios.cameraview.filter.Filter
copy -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setSaturation
void setSaturation(float value)
Sets the saturation correction value:-1.0: fully desaturated, grayscale.0.0: no change.+1.0: fully saturated.
- Parameters:
value- new value
-
getSaturation
float getSaturation()
Returns the current saturation.
-
setParameter1
void setParameter1(float value)
Sets the parameter.The value should always be between 0 and 1.
- Parameters:
value- parameter
-
getParameter1
float getParameter1()
Returns the parameter.The returned value should always be between 0 and 1.
-
getFragmentShader
@NonNull() String getFragmentShader()
Returns a String containing the fragment shader.Together with getVertexShader, this will be used tocreate the OpenGL program.
-
onCreate
void onCreate(int programHandle)
The filter program was just created. We pass in a handle to the OpenGLprogram that was created, so you can fetch pointers.
- Parameters:
programHandle- handle
-
onDestroy
void onDestroy()
The filter program is about to be destroyed.
-
-
-
-