case 6:
// Fall-through to depth 8
case 8:
+ if (cm != null && cm instanceof IndexColorModel)
+ break;
int rmask = pf.redMax << pf.redShift;
int gmask = pf.greenMax << pf.greenShift;
int bmask = pf.blueMax << pf.blueShift;
- if (pf.trueColour)
- cm = new DirectColorModel(8, rmask, gmask, bmask);
- else
- cm = new IndexColorModel(8, 256, new byte[256], new byte[256], new byte[256]);
+ cm = new DirectColorModel(8, rmask, gmask, bmask);
break;
case 16:
cm = new DirectColorModel(32, 0xF800, 0x07C0, 0x003E, (0xff << 24));
}
public void updateColourMap() {
- cm = new IndexColorModel(8, nColours, reds, greens, blues);
+ super.updateColourMap();
createImage(width_, height_);
}