mirror of
https://github.com/wasabeef/glide-transformations.git
synced 2025-10-04 18:03:21 +08:00
add Kuwahara
This commit is contained in:
@@ -37,6 +37,7 @@ public class MainActivity extends ActionBarActivity {
|
||||
dataSet.add(Type.Sketch);
|
||||
dataSet.add(Type.Swirl);
|
||||
dataSet.add(Type.Brightness);
|
||||
dataSet.add(Type.Kuawahara);
|
||||
|
||||
recyclerView.setAdapter(new MainAdapter(this, dataSet));
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.BrightnessFilterTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.ContrastFilterTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.InvertFilterTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.KuwaharaFilterTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.PixelationFilterTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.SepiaFilterTransformation;
|
||||
import jp.wasabeef.glide.transformations.gpu.SketchFilterTransformation;
|
||||
@@ -57,7 +58,8 @@ public class MainAdapter extends RecyclerView.Adapter<MainAdapter.ViewHolder> {
|
||||
Pixel,
|
||||
Sketch,
|
||||
Swirl,
|
||||
Brightness
|
||||
Brightness,
|
||||
Kuawahara
|
||||
}
|
||||
|
||||
public MainAdapter(Context context, List<Type> dataSet) {
|
||||
@@ -123,6 +125,9 @@ public class MainAdapter extends RecyclerView.Adapter<MainAdapter.ViewHolder> {
|
||||
case Brightness:
|
||||
transformation = new BrightnessFilterTransformation(mContext, mPool, 0.5f);
|
||||
break;
|
||||
case Kuawahara:
|
||||
transformation = new KuwaharaFilterTransformation(mContext, mPool, 25);
|
||||
break;
|
||||
}
|
||||
|
||||
Glide.with(mContext).load(R.drawable.demo)
|
||||
|
Reference in New Issue
Block a user