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

Method isColorLut

ij/src/main/java/ij/Menus.java:1378–1397  ·  view source on GitHub ↗
(ImagePlus imp)

Source from the content-addressed store, hash-verified

1376 }
1377
1378 static boolean isColorLut(ImagePlus imp) {
1379 ImageProcessor ip = imp.getProcessor();
1380 IndexColorModel cm = (IndexColorModel)ip.getColorModel();
1381 if (cm==null) return false;
1382 int mapSize = cm.getMapSize();
1383 byte[] reds = new byte[mapSize];
1384 byte[] greens = new byte[mapSize];
1385 byte[] blues = new byte[mapSize];
1386 cm.getReds(reds);
1387 cm.getGreens(greens);
1388 cm.getBlues(blues);
1389 boolean isColor = false;
1390 for (int i=0; i<mapSize; i++) {
1391 if ((reds[i] != greens[i]) || (greens[i] != blues[i])) {
1392 isColor = true;
1393 break;
1394 }
1395 }
1396 return isColor;
1397 }
1398
1399
1400 /** Use Prefs.getImageJDir() to get the path to the ImageJ directory. */

Callers

nothing calls this directly

Calls 6

getColorModelMethod · 0.95
getProcessorMethod · 0.45
getMapSizeMethod · 0.45
getRedsMethod · 0.45
getGreensMethod · 0.45
getBluesMethod · 0.45

Tested by

no test coverage detected