sclass G22CriticalPixelSearch is Steppable { // input settable IG22MasksHolder masksHolder; // internal int w, h; ItIt pixelIterator; // output Pt lastPixelLookedAt; Entry[] pixelEntries; float[] pixelScores; *() {} *(IG22MasksHolder *masksHolder) {} class Entry { // child mask holders for pixel dark or pixel bright IG22MasksHolder darkChild, brightChild; } public bool step() { if (w == 0) { meta-for w also as h { w = masksHolder.maskSize().w(); } pixelEntries = new Entry[w*h]; pixelScores = new float[w*h]; arrayfill(pixelScores, -1); pixelIterator = new WeightlessShuffledIterator(pixelsInImage(w, h)); } if (!pixelIterator.hasNext()) false; lastPixelLookedAt = pixelIterator.next(); true; } }