}
Effect effect = getEffect(context, EffectFactory.EFFECT_BITMAPOVERLAY);
- effect.setParameter("doodle", bitmap);
+ effect.setParameter("bitmap", bitmap);
effect.apply(src.texture(), src.width(), src.height(), dst.texture());
}
}
@Override
public void process(EffectContext context, Photo src, Photo dst) {
Effect effect = getEffect(context, EffectFactory.EFFECT_FILLLIGHT);
- effect.setParameter("backlight", backlight);
+ effect.setParameter("strength", backlight);
effect.apply(src.texture(), src.width(), src.height(), dst.texture());
}
}
public abstract class Filter {
// TODO: This should be set in MFF instead.
- private static final int DEFAULT_TILE_SIZE = 640;
+ private static final int DEFAULT_TILE_SIZE = 40;
private boolean isValid;
private EffectContext context;
@Override
public void process(EffectContext context, Photo src, Photo dst) {
Effect effect = getEffect(context, EffectFactory.EFFECT_GRAIN);
- effect.setParameter("scale", scale);
+ effect.setParameter("strength", scale);
effect.apply(src.texture(), src.width(), src.height(), dst.texture());
}
}
dst.changeDimension(src.height(), src.width());
}
Effect effect = getEffect(context, EffectFactory.EFFECT_ROTATE);
- effect.setParameter("degree", degrees);
+ effect.setParameter("angle", (int) degrees);
effect.apply(src.texture(), src.width(), src.height(), dst.texture());
}
}
*/
public class VignetteFilter extends Filter {
- private float range;
+ private float scale;
/**
* Sets the vignette range scale.
* @param scale ranges from 0 to 1.
*/
public void setScale(float scale) {
- // The 'range' is between 1.3 to 0.6. When scale is zero then range is 1.3
- // which means no vignette at all because the luminousity difference is
- // less than 1/256 and will cause nothing.
- range = 1.30f - (float) Math.sqrt(scale) * 0.7f;
+ this.scale = scale;
validate();
}
@Override
public void process(EffectContext context, Photo src, Photo dst) {
Effect effect = getEffect(context, EffectFactory.EFFECT_VIGNETTE);
- effect.setParameter("range", range);
+ effect.setParameter("scale", scale);
effect.apply(src.texture(), src.width(), src.height(), dst.texture());
}
}