Android Bitmap Blur blurred(Bitmap source)

Here you can find the source of blurred(Bitmap source)

Description

blurred

Declaration

public static Bitmap blurred(Bitmap source) 

Method Source Code

//package com.java2s;

import android.graphics.Bitmap;

public class Main {
    private static final int MIN_SIZE = 20;
    private static int[] scales = new int[] { 2, 2, 2, 2 };

    public static Bitmap blurred(Bitmap source) {
        int i = 0;
        for (i = 0; i < scales.length && source.getWidth() > MIN_SIZE
                && source.getHeight() > MIN_SIZE; i++)
            source = Bitmap.createScaledBitmap(source, source.getWidth()
                    / scales[i], source.getHeight() / scales[i], true);
        for (i--; i >= 0; i--)
            source = Bitmap.createScaledBitmap(source, source.getWidth()
                    * scales[i], source.getHeight() * scales[i], true);
        return source;
    }//from   w  ww .j  a v  a 2 s.co  m
}

Related

  1. fastBlurFromView(Context context, View v, int radius)
  2. fastBlur(Context context, Bitmap renderedBmp, int radius)
  3. blurFractional(int[] in, int[] out, int width, int height, float radius)
  4. blurFilter(Bitmap bmp)
  5. blur(int[] in, int[] out, int width, int height, float radius)
  6. fastblur(Context context, Bitmap sentBitmap, int radius)
  7. BoxBlurFilter(Bitmap bmp)
  8. blur(int[] in, int[] out, int width, int height, float radius)
  9. blurFractional(int[] in, int[] out, int width, int height, float radius)