code: public Pixel[] pixels(int x, int y, int w, int h) {
          Pixel[] pixels = new Pixel[w * h];
          int k = 0;
          for (int y1 = y; y1 < y + h; y1++) {
              for (int x1 = x; x1 < x + w; x1++) {
                  pixels[k++] = pixel(x1, y1);
              }
          }
          return pixels;
      }
docs: Returns a rectangular region within the given boundaries as a single
  dimensional array of integers.
  <p>
  Eg, pixels(10, 10, 30, 20) would result in an array of size 600 with
  the first row of the region in indexes 0,..,29, second row 30,..,59 etc.
  
  @param x the start x coordinate
  @param y the start y coordinate
  @param w the width of the region
  @param h the height of the region
  @return an Array of pixels for the region