()
| 210 | * LUTs or the display mode. |
| 211 | */ |
| 212 | @Override |
| 213 | public synchronized void updateImage() { |
| 214 | int imageSize = width*height; |
| 215 | int nChannels = getNChannels(); |
| 216 | int redValue, greenValue, blueValue; |
| 217 | int ch = getChannel(); |
| 218 | |
| 219 | //IJ.log("updateImage: "+ch+"/"+nChannels+" "+currentSlice+" "+currentFrame); |
| 220 | if (ch>nChannels) ch = nChannels; |
| 221 | boolean newChannel = false; |
| 222 | if (ch-1!=currentChannel) { |
| 223 | previousChannel = currentChannel; |
| 224 | currentChannel = ch-1; |
| 225 | newChannel = true; |
| 226 | } |
| 227 | |
| 228 | ImageProcessor ip = getProcessor(); |
| 229 | if (mode!=COMPOSITE) { |
| 230 | if (newChannel) { |
| 231 | setupLuts(nChannels); |
| 232 | LUT cm = lut[currentChannel]; |
| 233 | if (ip!=null && !(ip instanceof ColorProcessor)) { |
| 234 | if (mode==COLOR) |
| 235 | ip.setLut(cm); |
| 236 | if (!(cm.min==0.0&&cm.max==0.0)) |
| 237 | ip.setMinAndMax(cm.min, cm.max); |
| 238 | } |
| 239 | if (!IJ.isMacro()) ContrastAdjuster.update(); |
| 240 | for (int i=0; i<MAX_CHANNELS; i++) |
| 241 | active[i] = i==currentChannel?true:false; |
| 242 | Channels.updateChannels(); |
| 243 | } |
| 244 | if (ip!=null) |
| 245 | img = ip.createImage(); |
| 246 | return; |
| 247 | } |
| 248 | |
| 249 | if (nChannels==1) { |
| 250 | cip = null; |
| 251 | rgbPixels = null; |
| 252 | awtImage = null; |
| 253 | if (ip!=null) |
| 254 | img = ip.createImage(); |
| 255 | return; |
| 256 | } |
| 257 | |
| 258 | if (cip==null||cip[0].getWidth()!=width||cip[0].getHeight()!=height||getBitDepth()!=bitDepth) { |
| 259 | setup(nChannels, getImageStack()); |
| 260 | rgbPixels = null; |
| 261 | rgbSampleModel = null; |
| 262 | if (currentChannel>=nChannels) { |
| 263 | setSlice(1); |
| 264 | currentChannel = 0; |
| 265 | newChannel = true; |
| 266 | } |
| 267 | bitDepth = getBitDepth(); |
| 268 | } |
| 269 |
no test coverage detected