Open Pauan opened 1 month ago
Could you provide an example where this would be actually useful? What do you need this functionality for?
I'm creating a custom CAM program for CNC machines. The program loads an image, and then iterates over the pixels of the image to generate the GCode.
But it needs to iterate in a specific order to generate optimal GCode. The default order (left-to-right, top-to-bottom) creates suboptimal GCode, which slows down the CNC machine by ~50%.
With DoubleEndedIterator
it can iterate in the perfect order.
I see! Yes, an implementation of DoubleEndedIterator would be nice to have, and shouldn't be difficult. A PR for it would be welcome.
The
EnumeratePixels
andEnumerateRows
iterators should implementDoubleEndedIterator
.This will make it possible to iterate in reverse order (for example right-to-left instead of left-to-right).
The
Pixels
andRows
iterators already implementDoubleEndedIterator
.