>>388
画像フォーマットがてきとーなのとデバッグをきちんとしてないけどこんな感じ。
void foo(unsigned char* data, int width, int height) {
  int x, y, i;
  for (y = 0; y < height; y++) {
    for (x = 0; x < width; x++) {
      if (y * width > (width - x) * height) {
        cout << y << " " << x << endl;
        for (i = 0; i < 3; i++) {
          data[(y * width + x) * 3 + i] = 128;
        }
      }
    }
  }
}