(FileInfo fi)
| 397 | } |
| 398 | |
| 399 | int openTextLut(FileInfo fi) throws IOException { |
| 400 | TextReader tr = new TextReader(); |
| 401 | tr.hideErrorMessages(); |
| 402 | ImageProcessor ip = tr.open(fi.getFilePath()); |
| 403 | if (ip==null) |
| 404 | return 0; |
| 405 | int width = ip.getWidth(); |
| 406 | int height = ip.getHeight(); |
| 407 | if (width<3||width>4||height<256||height>258) |
| 408 | return 0; |
| 409 | int x = width==4?1:0; |
| 410 | int y = height>256?1:0; |
| 411 | ip.setRoi(x, y, 3, 256); |
| 412 | ip = ip.crop(); |
| 413 | for (int i=0; i<256; i++) { |
| 414 | fi.reds[i] = (byte)ip.getPixelValue(0,i); |
| 415 | fi.greens[i] = (byte)ip.getPixelValue(1,i); |
| 416 | fi.blues[i] = (byte)ip.getPixelValue(2,i); |
| 417 | } |
| 418 | return 256; |
| 419 | } |
| 420 | |
| 421 | private void createImage(FileInfo fi, boolean show) { |
| 422 | IndexColorModel cm = new IndexColorModel(8, 256, fi.reds, fi.greens, fi.blues); |
no test coverage detected