MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / openTextLut

Method openTextLut

ij/src/main/java/ij/plugin/LutLoader.java:399–419  ·  view source on GitHub ↗
(FileInfo fi)

Source from the content-addressed store, hash-verified

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);

Callers 1

openLutMethod · 0.95

Calls 8

hideErrorMessagesMethod · 0.95
openMethod · 0.95
getWidthMethod · 0.95
getHeightMethod · 0.95
setRoiMethod · 0.95
cropMethod · 0.95
getPixelValueMethod · 0.95
getFilePathMethod · 0.45

Tested by

no test coverage detected