static float[] rgbImageRowBrightnesses(RGBImage img) { int h = img.h(); float[] f = new float[h]; for y to h: f[y] = rgbAverageBrightness(rgbRow(img, y)); ret f; }