Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

ImageFilterView

public class ImageFilterView
extends AppCompatImageView

java.lang.Object
   ↳ android.support.v7.widget.AppCompatImageView
     ↳ android.support.constraint.utils.ImageFilterView


Added in 2.0

Subclass of ImageView to handle various common filtering operations

Summary

Public constructors

ImageFilterView(Context context)
ImageFilterView(Context context, AttributeSet attrs)
ImageFilterView(Context context, AttributeSet attrs, int defStyleAttr)

Public methods

float getContrast()

Returns the currently applied contrast

float getCrossfade()

Returns the currently applied crossfade.

float getSaturation()

Returns the currently applied saturation

float getWarmth()

Returns the currently applied warmth

void setContrast(float contrast)

This sets the contrast.

void setCrossfade(float crossfade)

Set the current mix between the two images that can be set on this view.

void setSaturation(float saturation)

sets the saturation of the image; 0 = grayscale, 1 = original, 2 = hyper saturated

void setWarmth(float warmth)

This makes the apparent color temperature of the image warmer or colder.

Inherited methods

Public constructors

ImageFilterView

public ImageFilterView (Context context)

Parameters
context Context

ImageFilterView

public ImageFilterView (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

ImageFilterView

public ImageFilterView (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

Public methods

getContrast

public float getContrast ()

Returns the currently applied contrast

Returns
float 1 = unchanged, 0 = gray, 2 = high contrast

getCrossfade

public float getCrossfade ()

Returns the currently applied crossfade.

Returns
float a number from 0 to 1

getSaturation

public float getSaturation ()

Returns the currently applied saturation

Returns
float 0 = grayscale, 1 = original, 2 = hyper saturated

getWarmth

public float getWarmth ()

Returns the currently applied warmth

Returns
float warmth 1 is neutral, 2 is warm, .5 is cold

setContrast

public void setContrast (float contrast)

This sets the contrast. 1 = unchanged, 0 = gray, 2 = high contrast

setCrossfade

public void setCrossfade (float crossfade)

Set the current mix between the two images that can be set on this view.

Parameters
crossfade float: a number from 0 to 1

setSaturation

public void setSaturation (float saturation)

sets the saturation of the image; 0 = grayscale, 1 = original, 2 = hyper saturated

setWarmth

public void setWarmth (float warmth)

This makes the apparent color temperature of the image warmer or colder.

Parameters
warmth float: 1 is neutral, 2 is warm, .5 is cold