Code example for Effect

Methods: apply, setParameter

0
    } 
 
    @Override 
    public void process(Photo src, Photo dst) {
        Effect effect = getEffect(EffectFactory.EFFECT_DUOTONE);
        effect.setParameter("first_color", firstColor);
        effect.setParameter("second_color", secondColor);
        effect.apply(src.texture(), src.width(), src.height(), dst.texture());
    } 
 
    @Override 
    protected void writeToParcel(Parcel out) {
        out.writeInt(firstColor);
        out.writeInt(secondColor);
    } 
 
    @Override 
    protected void readFromParcel(Parcel in) {
        firstColor = in.readInt();
        secondColor = in.readInt();
    } 
}