code: static void blur(byte[] srcPixels, byte[] dstPixels, int width, int height, float[] kernel, int radius) {
          float p;
          int   cp;
  
          for (int y = 0; y < height; y++) {
              int index  = y;
              int offset = y * width;
  
              for (int x = 0; x < width; x++) {
                  p = 0.0f;
  
                  for (int i = -radius; i <= radius; i++) {
                      int subOffset = x + i;
  
                      // if (subOffset < 0) subOffset = 0;
                      // if (subOffset >= width) subOffset = width-1;
                      if (subOffset < 0 || subOffset >= width) {
                          subOffset = (x + width) % width;
                      }
  
                      int   pixel      = srcPixels[offset + subOffset] & 0xFF;
                      float blurFactor = kernel[radius + i];
  
                      p += blurFactor * pixel;
                  }
  
                  cp               =  (int) (p + 0.5f);
                  dstPixels[index] =  (byte) (cp > 255 ? 255 : cp);
                  index            += height;
              }
          }
      }
docs: <p>Blurs the source pixels into the destination pixels. The force of the
  blur is specified by the radius which must be greater than 0.</p>
  
  <p>The source and destination pixels arrays are expected to be in the
  BYTE_GREY format.</p>
  
  <p>After this method is executed, dstPixels contains a transposed and
  filtered copy of srcPixels.</p>
  
  @param srcPixels the source pixels
  @param dstPixels the destination pixels
  @param width     the width of the source picture
  @param height    the height of the source picture
  @param kernel    the kernel of the blur effect
  @param radius    the radius of the blur effect