Author: Yotam Gingold <yotam (strudel) yotamgingold.com>
License: Public Domain. (I, Yotam Gingold, the author, release this code into the public domain.)
Homepage: http://yotamgingold.com/code/
GitHub: https://github.com/yig/yimg
YImage:
A simple pixel buffer class that can
- save and load itself as a PNG (preserving alpha channel)
- set color-plane layout (compile-time)
- resize/flip/mirror/greyscale
showpng:
An example GLUT application using YImage that takes a PNG file as
argument and displays it over a horrible green background.
If no argument given loads included "sakura.png" file.
Clicking inside the window displays a menu of commands.
Keys are:
- f: flip()
- m: mirror()
- g: greyscale()
- s: save( "output.png" ).
- c: captures current window backbuffer into "screen-capture.png"
- q: quit
transparent.html:
A basic web page to test the transparency of a PNG named "output.png".
Try with the "output.png" generated by pressing 's' in showpng.
Version History:
- 2006-04-08:
initial release
- 2007-11-13:
Option to save PNG with less compression, but faster.
Added methods (same() and same_rgb()) to test if two images are the same.
- 2012-01-09:
No longer generate warnings about non-string literals being used in fprintf.
No longer generate warning about unused return value.
Now includes <cstdio> for platforms that need it.
Switched OS X libpng include/library paths from fink to macports.