private float[][] getQuad(int x, int y, int size) {
        float[][] quad = new float[size][size];

        float element;
        for (int i = 0; i < size; i++) {
            for (int j = 0; j < size; j++) {
                if ((y + i) >= height || (x + j) >= width) {
                    element = 0;
                } else {
                    element = data[y + i][x + j];
                }
                quad[i][j] = element;
            }
        }

        return quad;
    }