+ pixelCol = pixelEnd;
+ // store last update value
+ if (showProgress)
+ {
+ lastUpdate = sendProgressUpdate(
+ pixelEnd * (endRow - 1 - pixelRow),
+ totalPixels, lastRowUpdate, lastUpdate);
+ }
+ }
+
+ }
+ if (pixelRow < endRow)
+ {
+ pixelRow = endRow;
+ // store row offset and last update value
+ if (showProgress)
+ {
+ // BH 2019.07.29 was (old) endRow + 1 (now endRow), but should be
+ // pixelRow + 1, surely
+ lastRowUpdate = sendProgressUpdate(endRow, alignmentHeight, 0,
+ lastUpdate);
+ lastUpdate = lastRowUpdate;
+ }
+ }
+ }
+
+ /**
+ * The next column is either the next set bit (when there are multiple pixels
+ * per column) or the next set bit for the column that aligns with the next
+ * pixel (when there are more columns than pixels).
+ *
+ * @param icol
+ * @param pixel
+ * @return
+ */
+ private int getNextCol(int icol, int pixel)
+ {
+ return bscol.nextSetBit(
+ pixelsPerCol >= 1 ? icol + 1 : (int) (pixel * colsPerPixel));
+ }
+
+ private int getNextPixel(int icol, int pixel)
+ {
+ return Math.min(
+ pixelsPerCol >= 1 || pixel == 0
+ ? Math.round(icol * pixelsPerCol)
+ : pixel,
+ w);
+ }
+
+ private ActionListener listener = new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ mainLoop();
+ }
+
+ };
+
+ private boolean loop()
+ {
+ if (delay <= 0)
+ {
+ return false;
+ }
+ if (timer == null)
+ {
+ timer = new Timer(delay, listener);
+ timer.setRepeats(false);
+ timer.start();
+ }
+ else
+ {
+ timer.restart();
+ }
+ return true;
+ }
+
+ private void done()
+ {
+ if (!redraw)
+ {
+ Platform.timeCheck(
+ "overviewrender " + ndone + " pixels row:" + row + " redraw:"
+ + redraw,
+ Platform.TIME_MARK);
+ }