Bitmap/Write a PPM file: Difference between revisions

(→‎{{header|C++}}: put method)
(→‎{{header|C++}}: operator <<)
Line 267:
 
for (auto j = 0u; j < dimy; ++j)
for (auto i = 0u; i < dimx; ++i) {
ofs.put << (char) (i % 256) << (char) (j % 256) << (char) ((i * j) % 256); // red, green, blue
ofs.put(j % 256); // green
ofs.put((i * j) % 256); // blue
}
 
ofs.close();
Anonymous user