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

Method setupLuts

ij/src/main/java/ij/CompositeImage.java:150–178  ·  view source on GitHub ↗
(int channels)

Source from the content-addressed store, hash-verified

148 }
149
150 void setupLuts(int channels) {
151 if (ip==null)
152 return;
153 if (lut==null || lut.length<channels) {
154 if (displayRanges!=null && channels!=displayRanges.length/2)
155 displayRanges = null;
156 if (displayRanges==null&&ip.getMin()==0.0&&ip.getMax()==0.0)
157 ip.resetMinAndMax();
158 lut = new LUT[channels];
159 LUT lut2 = channels>MAX_CHANNELS?createLutFromColor(Color.white):null;
160 for (int i=0; i<channels; ++i) {
161 if (channelLuts!=null && i<channelLuts.length) {
162 lut[i] = createLutFromBytes(channelLuts[i]);
163 customLuts = true;
164 } else if (i<MAX_CHANNELS)
165 lut[i] = createLutFromColor(colors[i]);
166 else
167 lut[i] = (LUT)lut2.clone();
168 if (displayRanges!=null) {
169 lut[i].min = displayRanges[i*2];
170 lut[i].max = displayRanges[i*2+1];
171 } else {
172 lut[i].min = ip.getMin();
173 lut[i].max = ip.getMax();
174 }
175 }
176 displayRanges = null;
177 }
178 }
179
180 public void resetDisplayRanges() {
181 int channels = getNChannels();

Callers 10

setupMethod · 0.95
resetDisplayRangesMethod · 0.95
updateImageMethod · 0.95
getChannelLutMethod · 0.95
getLutsMethod · 0.95
setLutsMethod · 0.95
getChannelIndexMethod · 0.95
setChannelLutMethod · 0.95
getDisplayRangeMinMethod · 0.95
getDisplayRangeMaxMethod · 0.95

Calls 6

createLutFromColorMethod · 0.95
createLutFromBytesMethod · 0.95
cloneMethod · 0.95
getMinMethod · 0.45
getMaxMethod · 0.45
resetMinAndMaxMethod · 0.45

Tested by

no test coverage detected