convertToRGB();
}
if ((model == cmodel) &&
(biRaster instanceof IntegerComponentRaster)) {
IntegerComponentRaster iraster =
(IntegerComponentRaster) biRaster;
if (off == 0 && scansize == w) {
iraster.setDataElements(x, y, w, h, pix);
}
else {
// Need to pack the data
for (yoff=y; yoff < y+h; yoff++, lineOff+=scansize) {
System.arraycopy(pix, lineOff, storage, 0, w);
iraster.setDataElements(x, yoff, w, 1, storage);
}
}
}
else {
if (model.getTransparency() != model.OPAQUE &&
cmodel.getTransparency() == cmodel.OPAQUE) {
convertToRGB();
}
if (isDefaultBI) {
IntegerComponentRaster iraster =
(IntegerComponentRaster) biRaster;
int[] data = iraster.getDataStorage();
if (cmodel.equals(model)) {
int sstride = iraster.getScanlineStride();
int doff = y*sstride + x;
for (yoff=0; yoff < h; yoff++, lineOff += scansize) {
System.arraycopy(pix, lineOff, data, doff, w);
doff += sstride;
}
// Note: manual modification of pixels, mark the
// raster as changed
iraster.markDirty();
}
else {
for (yoff=y; yoff < y+h; yoff++, lineOff += scansize) {
poff = lineOff;
for (int i=0; i < w; i++) {
storage[i]=model.getRGB(pix[poff++]);
}
iraster.setDataElements(x, yoff, w, 1, storage);
}
}
availinfo |= ImageObserver.SOMEBITS;
}