예제 #1
0
 /** 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);
 }