Package 

Class DuotoneFilter

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

    
    public class DuotoneFilter
    extends BaseFilter implements TwoParameterFilter
                        

    Representation of input frames using only two color tones.

    • Constructor Summary

      Constructors 
      Constructor Description
      DuotoneFilter()
    • Method Summary

      Modifier and Type Method Description
      void setColors(@ColorInt() int firstColor, @ColorInt() int secondColor) Sets the two duotone ARGB colors.
      void setFirstColor(@ColorInt() int color) Sets the first of the duotone ARGB colors.
      void setSecondColor(@ColorInt() int color) Sets the second of the duotone ARGB colors.
      int getFirstColor() Returns the first color.
      int getSecondColor() Returns the second color.
      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.
      void setParameter2(float value) Sets the second parameter.The value should always be between 0 and 1.
      float getParameter2() Returns the second 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, 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
    • Constructor Detail

      • DuotoneFilter

        DuotoneFilter()
    • Method Detail

      • setColors

         void setColors(@ColorInt() int firstColor, @ColorInt() int secondColor)

        Sets the two duotone ARGB colors.

        Parameters:
        firstColor - first
        secondColor - second
      • setFirstColor

         void setFirstColor(@ColorInt() int color)

        Sets the first of the duotone ARGB colors.Defaults to MAGENTA.

        Parameters:
        color - first color
      • setSecondColor

         void setSecondColor(@ColorInt() int color)

        Sets the second of the duotone ARGB colors.Defaults to YELLOW.

        Parameters:
        color - second color
      • 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.

      • setParameter2

         void setParameter2(float value)

        Sets the second parameter.The value should always be between 0 and 1.

        Parameters:
        value - parameter
      • getParameter2

         float getParameter2()

        Returns the second 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.