Re:A Sketch of the Biggest Idea in Software Architecture (2022)
by nottorp on Monday April 22, 2024 @09:22AM
(#40114101)
Except in that case you're converting to and from an uncompressed buffer... that could be in ram and not use a file format at all?
[ Parent
| on HN ]
Re:A Sketch of the Biggest Idea in Software Architecture (2022)
by rwmj on Monday April 22, 2024 @10:03AM
(#40114497)
It's much more useful to have a real file format.
For example, you can generate images from your own code by doing this (with a bit more shell quoting and error checking in the real code):
fp = popen ("ppmtojpeg > output.jpg", "w");
fprintf (fp, "P3 1024 1024 255\n");
for (y = 0; y < 1024; ++y)
for (x = 0; x < 1024; ++x)
fprintf (fp, "%d %d %d\n", 255*r[y][x], 255*g[y][x], 255*b[y][x]);
fclose (fp);