Code example for Effect

Methods: apply, setParameter

0
    public void process(Photo src, Photo dst) {
        dst.changeDimension(Math.round(bounds.width() * src.width()),
                Math.round(bounds.height() * src.height()));
 
        Effect effect = getEffect(EffectFactory.EFFECT_CROP);
        effect.setParameter("xorigin", Math.round(bounds.left * src.width()));
        effect.setParameter("yorigin", Math.round(bounds.top * src.height()));
        effect.setParameter("width", dst.width());
        effect.setParameter("height", dst.height());
        effect.apply(src.texture(), src.width(), src.height(), dst.texture());
    } 
 
    @Override 
    protected void writeToParcel(Parcel out) {
        out.writeParcelable(bounds, 0);
    } 
 
    @Override 
    protected void readFromParcel(Parcel in) {
        bounds = in.readParcelable(null);
    } 
}