/** Draws a pixel in the current UV plane at specified UV coordinates. */ public void drawPixel(final long u, final long v) { if (u < 0) return; if (v < 0) return; if (u > maxU) return; if (v > maxV) return; accessor.setPosition(u, uAxis); accessor.setPosition(v, vAxis); // draw in single channel mode if (preferredChannel >= 0) { final double value = intensity * channels.getChannelValue(preferredChannel); if (channelAxis != -1) accessor.setPosition(preferredChannel, channelAxis); accessor.get().setReal(value); } else { // draw across all channels long numChannels = 1; if (channelAxis != -1) numChannels = dataset.dimension(channelAxis); for (long c = 0; c < numChannels; c++) { final double value = intensity * channels.getChannelValue(c); if (channelAxis != -1) accessor.setPosition(c, channelAxis); accessor.get().setReal(value); } } dataset.setDirty(true); }
public static void main(String[] args) { ChannelCollection listeChannel = new ChannelCollectionImpl(); listeChannel.addChannel(new Channel("M6 Kids", ChannelTypeEnum.KIDS)); listeChannel.addChannel(new Channel("M6 Music", ChannelTypeEnum.MUSIC)); listeChannel.addChannel(new Channel("M6 Pipo", ChannelTypeEnum.NEWS)); listeChannel.addChannel(new Channel("M6", ChannelTypeEnum.GENERAL)); ChannelIterator it = listeChannel.iterator(ChannelTypeEnum.GENERAL); while (it.hasNext()) { Channel c = it.next(); System.out.println(c.toString()); } System.out.println("****"); it = listeChannel.iterator(ChannelTypeEnum.KIDS); while (it.hasNext()) { Channel c = it.next(); System.out.println(c.toString()); } }