code: public static void boxBlurBitmapInPlace(
        final Bitmap bitmap, final int iterations, final int radius) {
      Preconditions.checkNotNull(bitmap);
      Preconditions.checkArgument(bitmap.isMutable());
      Preconditions.checkArgument(bitmap.getHeight() <= BitmapUtil.MAX_BITMAP_SIZE);
      Preconditions.checkArgument(bitmap.getWidth() <= BitmapUtil.MAX_BITMAP_SIZE);
      Preconditions.checkArgument(radius > 0 && radius <= RenderScriptBlurFilter.BLUR_MAX_RADIUS);
      Preconditions.checkArgument(iterations > 0);
      try {
        fastBoxBlur(bitmap, iterations, radius);
      } catch (OutOfMemoryError oom) {
        FLog.e(
            TAG,
            String.format(
                (Locale) null,
                "OOM: %d iterations on %dx%d with %d radius",
                iterations,
                bitmap.getWidth(),
                bitmap.getHeight(),
                radius));
        throw oom;
      }
    }
docs: An in-place iterative box blur algorithm that runs faster than a traditional box blur.
  
  <p>The individual box blurs are split up in vertical and horizontal direction. That allows us
  to use a moving average implementation for blurring individual rows and columns.
  
  <p>The runtime is: O(iterations * width * height) and therefore linear in the number of pixels
  
  <p>The required memory is: 2 * radius * 256 * 4 Bytes + max(width, height) * 4 Bytes + width *
  height * 4 Bytes (+constant)
  
  @param bitmap The {@link Bitmap} containing the image. The bitmap dimension need to be smaller
  than {@link BitmapUtil#MAX_BITMAP_SIZE}
  @param iterations The number of iterations of the blurring algorithm > 0.
  @param radius The radius of the blur with a supported range 0 < radius <= {@link
  RenderScriptBlurFilter#BLUR_MAX_RADIUS}