components = cm.getComponents(pixel[i], components, 0); components[0] = (int) (components[0] * lastAlpha); pixel[i] = cm.getDataElement(components, 0);
pixel = paintRaster.getDataElements(x - x0, 0, pixel); comps = cm.getComponents(pixel, comps, 0); if (cm.hasAlpha() && ! cm.isAlphaPremultiplied()) comps[comps.length - 1] *= lastAlpha; else { int max; if (cm.hasAlpha()) max = comps.length - 2; else max = comps.length - 1; for (int j = 0; j < max; j++) comps[j] *= lastAlpha; } pixel = cm.getDataElements(comps, 0, pixel); aaRaster.setDataElements(x - x0, 0, pixel);
  private void fillScanlineAA(int[] alpha, int x0, int y, int numScanlinePixels,                              PaintContext pCtx)  {    // FIXME: This doesn't work. Fixit.    CompositeContext cCtx = composite.createContext(pCtx.getColorModel(),                                                    getColorModel(),                                                    renderingHints);    Raster paintRaster = pCtx.getRaster(x0, y, numScanlinePixels, 1);    System.err.println("paintColorModel: " + pCtx.getColorModel());    WritableRaster aaRaster = paintRaster.createCompatibleWritableRaster();    int numBands = paintRaster.getNumBands();    int[] pixels = new int[numScanlinePixels + paintRaster.getNumBands()];    pixels = paintRaster.getPixels(x0, y, numScanlinePixels, 1, pixels);    ColorModel cm = pCtx.getColorModel();        double lastAlpha = 0.;    int lastAlphaInt = 0;    int[] components = new int[4];        for (int i = 0; i < pixels.length; i++)      {        if (alpha[i] != 0)  {            lastAlphaInt += alpha[i];            lastAlpha = lastAlphaInt / AA_SAMPLING;          }        components = cm.getComponents(pixel[i], components, 0);        components[0] = (int) (components[0] * lastAlpha);        pixel[i] = cm.getDataElement(components, 0);      }    aaRaster.setPixels(0, 0, numScanlinePixels, 1, pixels);    cCtx.compose(aaRaster, destinationRaster, destinationRaster);    updateRaster(destinationRaster, x0, y, numScanlinePixels, 1);    cCtx.dispose();  }