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

Method getLut

ij/src/main/java/ij/macro/Functions.java:2112–2136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2110 }
2111
2112 void getLut() {
2113 Variable reds = getFirstArrayVariable();
2114 Variable greens = getNextArrayVariable();
2115 Variable blues = getLastArrayVariable();
2116 ImagePlus imp = getImage();
2117 IndexColorModel cm = null;
2118 if (imp.isComposite())
2119 cm = ((CompositeImage)imp).getChannelLut();
2120 else {
2121 ImageProcessor ip = imp.getProcessor();
2122 if (ip instanceof ColorProcessor)
2123 interp.error("Non-RGB image expected");
2124 cm = (IndexColorModel)ip.getColorModel();
2125 }
2126 int mapSize = cm.getMapSize();
2127 byte[] rLUT = new byte[mapSize];
2128 byte[] gLUT = new byte[mapSize];
2129 byte[] bLUT = new byte[mapSize];
2130 cm.getReds(rLUT);
2131 cm.getGreens(gLUT);
2132 cm.getBlues(bLUT);
2133 reds.setArray(new Variable(rLUT).getArray());
2134 greens.setArray(new Variable(gLUT).getArray());
2135 blues.setArray(new Variable(bLUT).getArray());
2136 }
2137
2138 void setLut() {
2139 double[] reds = getFirstArray();

Callers 2

doFunctionMethod · 0.95
doColorMethod · 0.95

Calls 15

getFirstArrayVariableMethod · 0.95
getNextArrayVariableMethod · 0.95
getLastArrayVariableMethod · 0.95
getImageMethod · 0.95
isCompositeMethod · 0.95
getProcessorMethod · 0.95
getColorModelMethod · 0.95
setArrayMethod · 0.95
getChannelLutMethod · 0.80
errorMethod · 0.45
getMapSizeMethod · 0.45
getRedsMethod · 0.45

Tested by

no test coverage detected