public LUT[] getLuts() { int channels = getNChannels(); if (lut==null) setupLuts(channels); LUT[] luts = new LUT[channels]; for (int i=0; i<channels; i++) luts[i] = (LUT)lut[i].clone(); return luts; }
public LUT[] getLuts() { int channels = getNChannels(); if (lut==null) setupLuts(channels); LUT[] luts = new LUT[channels]; for (int i=0; i<channels; i++) luts[i] = (LUT)lut[i].clone(); return luts; }
public synchronized void setChannelLut(LUT table, int channel) { int channels = getNChannels(); if (lut==null) setupLuts(channels); if (channel<1 || channel>lut.length) throw new IllegalArgumentException("Channel out of range"); lut[channel-1] = (LUT)table.clone(); if (getWindow()!=null && channel==getChannel()) getProcessor().setLut(lut[channel-1]); if (cip!=null && cip.length>=channel && cip[channel-1]!=null) cip[channel-1].setLut(lut[channel-1]); else cip = null; customLuts = true; }
public synchronized void setChannelLut(LUT table, int channel) { int channels = getNChannels(); if (lut==null) setupLuts(channels); if (channel<1 || channel>lut.length) throw new IllegalArgumentException("Channel out of range"); lut[channel-1] = (LUT)table.clone(); if (getWindow()!=null && channel==getChannel()) getProcessor().setLut(lut[channel-1]); if (cip!=null && cip.length>=channel && cip[channel-1]!=null) cip[channel-1].setLut(lut[channel-1]); else cip = null; customLuts = true; }
void setupLuts(int channels) { if (lut==null || lut.length<channels) { if (displayRanges!=null && channels!=displayRanges.length/2) displayRanges = null; if (displayRanges==null&&ip.getMin()==0.0&&ip.getMax()==0.0) ip.resetMinAndMax(); lut = new LUT[channels]; LUT lut2 = channels>MAX_CHANNELS?createLutFromColor(Color.white):null; for (int i=0; i<channels; ++i) { if (channelLuts!=null && i<channelLuts.length) { lut[i] = createLutFromBytes(channelLuts[i]); customLuts = true; } else if (i<MAX_CHANNELS) lut[i] = createLutFromColor(colors[i]); else lut[i] = (LUT)lut2.clone(); if (displayRanges!=null) { lut[i].min = displayRanges[i*2]; lut[i].max = displayRanges[i*2+1]; } else { lut[i].min = ip.getMin(); lut[i].max = ip.getMax(); } } displayRanges = null; } }
void setupLuts(int channels) { if (lut==null || lut.length<channels) { if (displayRanges!=null && channels!=displayRanges.length/2) displayRanges = null; if (displayRanges==null&&ip.getMin()==0.0&&ip.getMax()==0.0) ip.resetMinAndMax(); lut = new LUT[channels]; LUT lut2 = channels>MAX_CHANNELS?createLutFromColor(Color.white):null; for (int i=0; i<channels; ++i) { if (channelLuts!=null && i<channelLuts.length) { lut[i] = createLutFromBytes(channelLuts[i]); customLuts = true; } else if (i<MAX_CHANNELS) lut[i] = createLutFromColor(colors[i]); else lut[i] = (LUT)lut2.clone(); if (displayRanges!=null) { lut[i].min = displayRanges[i*2]; lut[i].max = displayRanges[i*2+1]; } else { lut[i].min = ip.getMin(); lut[i].max = ip.getMax(); } } displayRanges = null; } }