void makeCustomLut() {
   IndexColorModel cm = (IndexColorModel) LookUpTable.createGrayscaleColorModel(false);
   byte[] reds = new byte[256];
   byte[] greens = new byte[256];
   byte[] blues = new byte[256];
   cm.getReds(reds);
   cm.getGreens(greens);
   cm.getBlues(blues);
   reds[1] = (byte) 255;
   greens[1] = (byte) 0;
   blues[1] = (byte) 0;
   customLut = new IndexColorModel(8, 256, reds, greens, blues);
 }
Exemplo n.º 2
0
 /** Returns an IndexColorModel for the image specified by this FileInfo. */
 public ColorModel createColorModel(FileInfo fi) {
   if (fi.fileType == FileInfo.COLOR8 && fi.lutSize > 0)
     return new IndexColorModel(8, fi.lutSize, fi.reds, fi.greens, fi.blues);
   else return LookUpTable.createGrayscaleColorModel(fi.whiteIsZero);
 }