Package 

Class GrainFilter

  • All Implemented Interfaces:
    com.otaliastudios.cameraview.filter.Filter , com.otaliastudios.cameraview.filter.OneParameterFilter

    
    public class GrainFilter
    extends BaseFilter implements OneParameterFilter
                        

    Applies film grain effect to the frames.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private float strength
    • Constructor Summary

      Constructors 
      Constructor Description
      GrainFilter()
    • Method Summary

      Modifier and Type Method Description
      float getStrength() Returns the current strength.
      void setStrength(float strength) Sets the current distortion strength.0.0: no distortion.1.0: maximum distortion.
      void setSize(int width, int height) Called anytime the output size changes.
      void setParameter1(float value) Sets the parameter.The value should always be between 0 and 1.
      float getParameter1() Returns the parameter.The returned value should always be between 0 and 1.
      String getFragmentShader() Returns a String containing the fragment shader.
      void onCreate(int programHandle) The filter program was just created.
      void onDestroy() The filter program is about to be destroyed.
      • Methods inherited from class com.otaliastudios.cameraview.filter.BaseFilter

        copy, draw, getVertexShader
      • 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
    • Constructor Detail

      • GrainFilter

        GrainFilter()
    • Method Detail

      • getStrength

         float getStrength()

        Returns the current strength.

      • setStrength

         void setStrength(float strength)

        Sets the current distortion strength.0.0: no distortion.1.0: maximum distortion.

        Parameters:
        strength - strength
      • setSize

         void setSize(int width, int height)

        Called anytime the output size changes.

        Parameters:
        width - width
        height - height
      • 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.

      • 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.