srecord noeq Hi15ImageStreaks(Hi15Image inputImage) { // x values of streak ends new IntBuffer streakData; int[] lineStarts; run { int w = inputImage.w(), h = inputImage.h(); lineStarts = new int[h]; short[] pixels = inputImage.pixels; int iPixel = 0; for y to h: { lineStarts[y] = streakData.size(); int lineEnd = iPixel+w; while (iPixel < lineEnd) { short color = pixels[iPixel]; do ++iPixel; while (iPixel < lineEnd && pixels[iPixel] == color); streakData.add(iPixel); } } } selfType runAndReturn() { run(); this; } }