static float[] bwImageColumnBrightnesses_generic(virtual BWImage img) { int w = rcall_int getWidth(img), h = rcall_int getHeight(img); float[] f = new float[w]; for x to w: f[x] = toFloat(rcall averageBrightness(rcall clip(img, x, 0, 1, h))); ret f; }