mirror of
https://github.com/wasabeef/glide-transformations.git
synced 2025-10-04 18:03:21 +08:00
add Vignette
This commit is contained in:
@@ -38,6 +38,7 @@ public class MainActivity extends ActionBarActivity {
|
||||
dataSet.add(Type.Swirl);
|
||||
dataSet.add(Type.Brightness);
|
||||
dataSet.add(Type.Kuawahara);
|
||||
dataSet.add(Type.Vignette);
|
||||
|
||||
recyclerView.setAdapter(new MainAdapter(this, dataSet));
|
||||
}
|
||||
|
@@ -33,6 +33,7 @@ import jp.wasabeef.glide.transformations.gpu.SepiaFilterTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.SketchFilterTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.SwirlFilterTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.ToonFilterTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.VignetteFilterTransformation;
|
||||
|
||||
/**
|
||||
* Created by Wasabeef on 2015/01/11.
|
||||
@@ -59,7 +60,8 @@ public class MainAdapter extends RecyclerView.Adapter<MainAdapter.ViewHolder> {
|
||||
Sketch,
|
||||
Swirl,
|
||||
Brightness,
|
||||
Kuawahara
|
||||
Kuawahara,
|
||||
Vignette
|
||||
}
|
||||
|
||||
public MainAdapter(Context context, List<Type> dataSet) {
|
||||
@@ -128,6 +130,10 @@ public class MainAdapter extends RecyclerView.Adapter<MainAdapter.ViewHolder> {
|
||||
case Kuawahara:
|
||||
transformation = new KuwaharaFilterTransformation(mContext, mPool, 25);
|
||||
break;
|
||||
case Vignette:
|
||||
transformation = new VignetteFilterTransformation(mContext, mPool,
|
||||
new PointF(0.5f, 0.5f), new float[]{0.0f, 0.0f, 0.0f}, 0f, 0.75f);
|
||||
break;
|
||||
}
|
||||
|
||||
Glide.with(mContext).load(R.drawable.demo)
|
||||
|
Reference in New Issue
Block a user