I thought maybe that this should be a forum topic, instead of just a 1-1 thing?pifactorial wrote: I can't figure out how to implement libpng in C++. The official libpng documentation is a little lax (IMO).
It looks to me like my source will fit very nicely with the png format, running much faster and using much less memory (and, of course, producing smaller images). I was wondering if you could just give me a quick tutorial in:using libpng? I assume you have some experience with it...
- Reading images
- Using image data
- Writing images
Thanks,
PiFactorial
libpng
-
- Bounty Hunter
- Posts: 170
- Joined: Mon Feb 21, 2005 7:04 am
- Location: Pomona College
- Contact:
libpng
I wrote this message to hellcatv:
-
- Lead Network Developer
- Posts: 2560
- Joined: Sun Jan 12, 2003 9:13 am
- Location: Palo Alto CA
- Contact:
This is open source software. The code for png reading is in the CVS repository:
vsimage.cpp
vsimage.cpp
-
- Bounty Hunter
- Posts: 170
- Joined: Mon Feb 21, 2005 7:04 am
- Location: Pomona College
- Contact:
I love you! Thanks!
EDIT: Even better, I could just use VSImage's instead of going to the trouble of reading/writing myself. Man I'm lazy!
EDIT: Even better, I could just use VSImage's instead of going to the trouble of reading/writing myself. Man I'm lazy!
Last edited by pifactorial on Sun Feb 27, 2005 4:09 am, edited 1 time in total.
-
- Lead Network Developer
- Posts: 2560
- Joined: Sun Jan 12, 2003 9:13 am
- Location: Palo Alto CA
- Contact:
I also have a image rotating program that I know reads and writes BMP, Jpeg and PNG files. I wrote it as a test program, so it is not friendly.
I am attaching a tar.gz file.
compile with
g++ -o image_rotate image_rotate.cpp texture.cpp -lpng -ljpeg
The argument list is:
./image_rotate -<proc> imagefile1 imagefile2 ...
<proc> is one of:
0
90
180
270
flipv
fliph
flip90
flip270
I am attaching a tar.gz file.
compile with
g++ -o image_rotate image_rotate.cpp texture.cpp -lpng -ljpeg
The argument list is:
./image_rotate -<proc> imagefile1 imagefile2 ...
<proc> is one of:
0
90
180
270
flipv
fliph
flip90
flip270
You do not have the required permissions to view the files attached to this post.