diff options
author | Sven Gothel <[email protected]> | 2012-04-07 15:28:37 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-04-07 15:28:37 +0200 |
commit | 40830196070013432bc5f453eb31cfe4c64e0510 (patch) | |
tree | ca31a1e1e27adf9996963176c4f92b84e25623e9 /make/lib/pngj/about.html | |
parent | 865c0588de57c9a020a435bc3f08be0f3f6ba162 (diff) |
Merge PNGJ 0.85 into namespace
PNGJ Version 0.85 (1 April 2012)
Apache 2.0 License
http://code.google.com/p/pngj/
Merged code:
- Changed namespace ar.com.hjg.pngj -> jogamp.opengl.util.pngj
to avoid collision when using a different version of PNGJ.
- Removed test and lossy packages and helper classes
to reduce footprint.
License information is added in main LICENSE.txt file.
Diffstat (limited to 'make/lib/pngj/about.html')
-rw-r--r-- | make/lib/pngj/about.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/make/lib/pngj/about.html b/make/lib/pngj/about.html new file mode 100644 index 000000000..23df5e0b8 --- /dev/null +++ b/make/lib/pngj/about.html @@ -0,0 +1,47 @@ +<body>
+<p>
+<b>PNGJ: A simple library for reading/writing PNG images.</b>
+</p>
+
+
+<p>
+ Focused on high resolution images,
+both huge in size (and hence not appropiate to be loaded in memory, eg. as a BufferedImage)
+and quality (the library is dedicated to truecolor images, with 8 and 16 bits per sample,
+with or without alpha). It provides basic line-oriented reading and writing capabilities.
+</p>
+<p>
+
+A quick example: this code reads a PNG image file (true colour, 8-16 bpp, RGB-RGBA) and
+rewrites it cutting the red channel by two.
+</p>
+
+<pre>
+
+ public static void decreaseRed(String origFilename, String destFilename) {
+ PngReader pngr = new PngReader(origFilename);
+ PngWriter pngw = new PngWriter(destFilename, pngr.imgInfo);
+ pngw.setOverrideFile(true); // allows to override writen file if it already exits
+ System.out.println(pngr.toString());
+ pngw.prepare(pngr); // not necesary; but this can copy some informational chunks from original
+ int channels = pngr.imgInfo.channels;
+ if(channels<3) throw new RuntimeException("Only for truecolour images");
+ for (int row = 0; row < pngr.imgInfo.rows; row++) {
+ ImageLine l1 = pngr.readRow(row);
+ for(int j=0;j<pngr.imgInfo.cols;j++)
+ l1.scanline[j*channels]/=2;
+ pngw.writeRow(l1);
+ }
+ pngr.end();
+ pngw.end();
+ }
+ </pre>
+<p>
+See the docs and source of the samples for more.
+</p>
+
+http://code.google.com/p/pngj/<br>
+<a href="http://code.google.com/p/pngj/">PNGJ</a>
+
+</body>
+</html>
|