public int[] getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scanlineStride)
public int getRGB(int x, int y)
  public int[] getRGB(int startX, int startY, int w, int h,		      int[] rgbArray,		      int offset, int scanlineStride)  {    if (rgbArray == null)    {      /*	000000000000000000	00000[#######-----   [ = start	-----########-----   ] = end	-----#######]00000	000000000000000000  */      int size = (h-1)*scanlineStride + w;      rgbArray = new int[size];    }	    int endX = startX + w;    int endY = startY + h;        /* *TODO*:       Opportunity for optimization by examining color models...              Perhaps wrap the rgbArray up in a WritableRaster with packed       sRGB color model and perform optimized rendering into the       array. */    Object rgbElem = null;    for (int y=startY; y<endY; y++)      {	int xoffset = offset;	for (int x=startX; x<endX; x++)	  {	    int rgb;	    rgbElem = raster.getDataElements(x, y, rgbElem);	    rgb = colorModel.getRGB(rgbElem);	    rgbArray[xoffset++] = rgb;	  }	offset += scanlineStride;      }    return rgbArray;  }