摘要:
1、算法r = r*128/(g+b +1);g = g*128/(r+b +1);b = b*128/(g+r +1);2、代码实现public Bitmap render(Bitmap bitmap) { if(bitmap == null)return null; int width = bitmap.getWidth(); int height = bitmap.getHeight(); int[] pixels = new int[width * height]; bitmap.getPixels(pixels ,0 , width , 0 , 0 ,... 阅读全文
posted @ 2012-09-21 14:44
lipeil
阅读(306)
评论(0)
推荐(0)
摘要:
1、算法r = Math.sqrt((r- rightr)^2 + (r-bottomr)^2)*2g = Math.sqrt((g- rightg)^2 + (g-bottomg)^2)*2b = Math.sqrt((b- rightb)^2 + (b-bottomb)^2)*22、代码实现 public Bitmap render(Bitmap bitmap) { if(bitmap == null)return null; int width = bitmap.getWidth(); int height = bitmap.getHeight(); int[]... 阅读全文
posted @ 2012-09-21 11:48
lipeil
阅读(601)
评论(0)
推荐(0)
摘要:
1、算法R = |g – b + g + r| * r / 256G = |b – g + b + r| * r / 256;B = |b – g + b + r| * g / 256;然后灰化。2、代码实现 public Bitmap render(Bitmap bitmap) { if(bitmap == null)return null; int width = bitmap.getWidth(); int height = bitmap.getHeight(); int[] pixels = new int[width * height]; bitmap... 阅读全文
posted @ 2012-09-21 11:14
lipeil
阅读(487)
评论(0)
推荐(0)
摘要:
float mSize = 0.5f; public Bitmap render(Bitmap bitmap) { if(bitmap == null)return null; final int SIZE = 32768; int width = bitmap.getWidth(); int height = bitmap.getHeight(); int ratio = width >height ? height * SIZE /width : width * SIZE/height;//这里有额外*2^15 用于放大比率;之后的比率使用时需要右移15位... 阅读全文
posted @ 2012-09-21 10:43
lipeil
阅读(6769)
评论(0)
推荐(0)

浙公网安备 33010602011771号