AffineTransform imageToUser)
AffineTransform imageToUser, Color bgcolor)
  private boolean drawRaster (ColorModel cm, Raster r,                               AffineTransform imageToUser)  {    if (r == null)      return false;    SampleModel sm = r.getSampleModel ();    DataBuffer db = r.getDataBuffer ();    if (db == null || sm == null)      return false;    if (cm == null)      cm = ColorModel.getRGBdefault ();    double[] i2u = new double[6];    if (imageToUser != null)      imageToUser.getMatrix(i2u);    else      {        i2u[0] = 1; i2u[1] = 0;        i2u[2] = 0; i2u[3] = 1;        i2u[4] = 0; i2u[5] = 0;      }    int pixels[] = null;    if (sm.getDataType () == DataBuffer.TYPE_INT &&        db instanceof DataBufferInt &&        db.getNumBanks () == 1)      {        // single bank, ARGB-ints buffer in sRGB space        DataBufferInt dbi = (DataBufferInt)db;        pixels = dbi.getData ();      }    else      pixels = r.getPixels (0, 0, r.getWidth (), r.getHeight (), pixels);        ColorSpace cs = cm.getColorSpace ();    if (cs != null &&         cs.getType () != ColorSpace.CS_sRGB)      {        int pixels2[] = new int[pixels.length];                for (int i = 0; i < pixels2.length; i++)          pixels2[i] = cm.getRGB (pixels[i]);                pixels = pixels2;      }        stateSave ();    translate (x, y);    drawPixels (pixels, r.getWidth (), r.getHeight (), r.getWidth (), i2u);    stateRestore ();            if (isBufferedImageGraphics ())       updateBufferedImage();       return true;  }