package com.whlib.alib.graphics;

import android.graphics.Bitmap;

/**
 * Created by wanghui5-s on 2015/11/12.
 */
public class BitmapHelper {

    public static int[] getBitmapPixels(Bitmap bitmap, int x, int y, int width, int height) {
        int[] pixels = new int[bitmap.getWidth() * bitmap.getHeight()];
        bitmap.getPixels(pixels, 0, bitmap.getWidth(), x, y,
                width, height);
        final int[] subsetPixels = new int[width * height];
        for (int row = 0; row < height; row++) {
            System.arraycopy(pixels, (row * bitmap.getWidth()),
                    subsetPixels, row * width, width);
        }
        return subsetPixels;
    }
}

@@ -58,16 +58,59 @@
 .Bitmap;
+%0Aimport android.support.annotation.NonNull;
 %0A%0A/**%0A *
@@ -220,16 +220,25 @@
 pPixels(
+@NonNull 
 Bitmap b

add nonnull annotation