From f9e67a84373cf8432093a0e7919de554bb9d0d05 Mon Sep 17 00:00:00 2001 From: Joshua Moerman Date: Sat, 15 Sep 2012 13:33:17 +0200 Subject: [PATCH] added description --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..ecfa652 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +ImageStreams +============ + +Motivation +---------- +Some time ago I had a project where I rendered something to a high quality buffer, which I wanted to export as a png. I used libpng++ for that, the downside was that this library allocated the image again (in a different format). But the only thing I wanted to do is convert my format to another format (pixel by pixel), so this allocation seemed redundant. That's why I wanted a image stream library. + +Features +-------- +* Output streams for bmp and png image files +* Grayscale and color +* Low memory usage (because it streams) +* Easy to use + +Uasge +----- +```C++ +png::gray_ostream image(1024, 768, "test.png"); +for(int y = 0; y < 768; ++y){ + for(int x = 0; x < 1024; ++x){ + image << png::gray_ostream::pixel(some_generation(x,y)); + } +} +// done, image is automatically saved (wtih RAII) +``` + +There are more examples in the main.cpp file. \ No newline at end of file