chickadee » macaw » rgb8-array-for-each

rgb8-array-for-each proc rgb8-array ...procedure

Calls proc once for each color in the given rgb8-array(s). If the arrays are different sizes, it iterates over the overlapping area (i.e. the smallest width and smallest height).

The iteration proceeds in row-major order. proc is called with the x coordinate, y coordinate, and the corresponding rgb8 color from each given array. Modifying the color(s) will modify the array data. The color's parent will be automatically set to the array, so that the array will not be garbage collected while the color is using its memory.

(rgb8-array-for-each
  (lambda (x y rgb8_1 rgb8_2)
    (rgb8-lerp! rgb8_1 rgb8_2 (/ x 100.0)))
  rgb8-array_1 rgb8-array_2)