libpng

Need help testing contributed art or code or having trouble getting your newest additions into game compatible format? Confused by changes to data formats? Reading through source and wondering what the developers were thinking when they wrote something? Need "how-to" style guidance for messing with VS internals? This is probably the right forum.
Post Reply
pifactorial
Bounty Hunter
Bounty Hunter
Posts: 170
Joined: Mon Feb 21, 2005 7:04 am
Location: Pomona College
Contact:

libpng

Post by pifactorial »

I wrote this message to hellcatv:
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:
  • Reading images
  • Using image data
  • Writing images
using libpng? I assume you have some experience with it...

Thanks,
PiFactorial
I thought maybe that this should be a forum topic, instead of just a 1-1 thing?
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

This is open source software. The code for png reading is in the CVS repository:
vsimage.cpp
pifactorial
Bounty Hunter
Bounty Hunter
Posts: 170
Joined: Mon Feb 21, 2005 7:04 am
Location: Pomona College
Contact:

Post by pifactorial »

:lol: 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! :P
Last edited by pifactorial on Sun Feb 27, 2005 4:09 am, edited 1 time in total.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

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
You do not have the required permissions to view the files attached to this post.
Post Reply