This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String args[]){ | |
222 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PixelateUtil { | |
/** | |
* 普通图像->像素图,zoneWidth为像素图的大像素的宽度 | |
*/ | |
public static Bitmap pixelate(Bitmap bitmap, int zoneWidth) { | |
return pixelate(bitmap, zoneWidth, 0, 0, bitmap.getWidth(), bitmap.getHeight()); | |
} | |
/** | |
* 普通图->像素图,left、top、right、bottom可指定打马赛克区域 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GussianBlur { | |
private static final GussianBlur INSTANCE = new GussianBlur(); | |
private int sigma = 15; //通过调节该参数设置高斯模糊的模糊程度,越大越模糊 | |
private int radius = 3 * sigma; | |
private double[] kernel = new double[radius + 1]; //kernel[i]表示离中心点距离为i的权重 | |
private GussianBlur() {} | |
/** | |
* 初始化卷积核 |