This is the beta releas of PNGlib, a free library written in
assembly to read and display PNG images in your programs.
Includes and headers for use in MASM32 as well as (visual) C
are included.
Posted on 2003-12-15 06:37:05 by optimus
Seems like you've added an extra example to my library. I can include it in the official package at www.madwizard.org if you want..

Thomas
Posted on 2003-12-15 07:13:27 by Thomas
Just saw this good stuff on a Chinese web site. didn't expect its written by u :)
i just converted your MASM sample code into a RadASM project. and is there any JPEG lib?
Posted on 2003-12-15 08:08:08 by optimus
see lots of good stuff on your web site. i will suggest it in the forum of my college. :)
Posted on 2003-12-15 08:13:57 by optimus
Thanks :).. For loading JPEGs and GIFs you can use windows' functionality, see Ernie's website.

Thomas
Posted on 2003-12-15 08:55:38 by Thomas
However, a separate lib would also be handy to have... windows API's only go so far... ;)

Regards,
:NaN:
Posted on 2003-12-15 20:39:00 by NaN
I agree NaN,

There is a problem with the IPicture interface when you are going from a high color image to a lower color display, i.e. 24 bit JPG to 256 color screen. The color mapping sucks with IPicture, I am trying to write a fix right now and it is difficult I think that the only way is to find an alternative to IPicture. The problem is that it seems to just map the image to the default 256 color palette and if a color is not an exact match it replaces it with black, damn annoying. Edwin brought it up looking for a solution and as I use that interface in TBPaint I want to resolve the problem.
Posted on 2003-12-15 20:50:50 by donkey
humm, there's the intel jpeg lib and the libjpeg (or whatever the GNU project is called), but both have a rather large footprint. Promethee did a load-only library in assembly, which isn't too large - unfortunately, it has limited support and no source code, and promethee sorta disappeared.
Posted on 2003-12-15 21:20:21 by f0dder
I have heard the great revues of the jpeg library from Intel unfortunately it is now incorporated in the larger intel code library and the price is a bit much to add functionality for loading a jpg in a free package. I have never found a working link to the original, free jpeg library. Ofcourse GNU and GPL comes with it's own baggage in the license agreement that you must attach to your package in order to use it.
Posted on 2003-12-15 21:53:10 by donkey
damn, they made ijpg commercial now? Sad, I don't think I ever downloaded the free version :/
I don't remember which license the Independent JPEG Group uses, but I'm afraid it might be the infectious GPL :(.
Perhaps time to search SourceForge for something with a less strict license? Or RE promethee's work and improve on it? :)
Posted on 2003-12-15 22:00:14 by f0dder
Hi f0dder,

Yeah I guess I should search SourceForge. The problem is that you can almost instantly tell if the person who wrote the library is competant in assembler. If you look at Thomas's libraries they all have consistent simple syntax and the is a minimum of abstraction. When I see the libs of the C++ guys I quake in fear, classes, interfaces, and whatever-faces, massive amounts of types that make little or no sense. I have downloaded and installed Pelle C in order to try to learn a bit of it but I just can't get up enough interest to attack it properly. I usually just give up on HLL based libs with the exception of ZLib which was quite straight forward and NaN had posted examples of using.
Posted on 2003-12-15 22:11:34 by donkey
Hehe, I guess C++ can be a bit intimidating when you're used to assembly and DWORDs :) - it's not all that bad though, and for most code it shouldn't be too hard to write asm-callable C wrappers even if it's C++ code. If you find a library with a decent license and nice featureset, I probably wouldn't mind helping you with some wrappers.

Btw, Pelle C? Isn't that a compiler without C++ support? For a free compiler, you should go for mingw32, it the full GNU compiler with native win32 support, and without the crappyness of the cygwin port. There's even www.bloodshed.net which packages a semi-decent IDE with mingw32: dev-c++. www.digitalmars.com has another decent free C++ compiler, which unfortunately uses the OMF object format though.

It would be nice if we could find a decent free jpeg library, and do some work at optimizing especially the decode core - while still supporting more formats than promethee's beta code.
Posted on 2003-12-16 00:29:49 by f0dder
Hi f0dder,

That's right, Pelle is a compiler/IDE for C, but I figured it made sense to start there as it is a level closer to what I am used to. I have quite a bit of experience with translating and understanding the API example code and at least with C I get a little bit of a head start. The nice thing about Pelle is that I can use the obj files and the libs directly with either MASM or GoAsm, so I don't have to actually try to build a full program right off the start. I tried this with Toolbar Paint and the Bresenham line function was originally written in C and linked into the masm module. I figure when I get used to C it will be an easier jump to C++.
Posted on 2003-12-16 01:26:31 by donkey
See Ultrano's c++ wrapper for a quick splash in the kiddie pool.. it may be shallow, but there's still enough to get your feet wet :)
Posted on 2003-12-16 04:43:01 by Homer
donkey, you don't *have* to use C++ just because the compiler supports it :)
I think you should be able to use object files directly from the dev-c++/mingw32 stuff too, as it uses coff format - however, the libraries might be incompatible, and there's at least two versions of coff; the differences have to do with how certain relocation types are encoded. The GCC version in the DJGPP package is incompatible with microsoft tools, but I think they fixed that for mingw32 - not sure, though.
Posted on 2003-12-16 05:15:29 by f0dder
Thanks EvilHomer2K, I'll take a look.

Hi f0dder,

Yeah I know but I had tried a few and Pelle was the first that I ran into that was compatible in both obj and lib format with GoAsm and Masm so that is pretty much where I ended my search. As I said I have not taken to it and can't really get excited about it enough to learn it. Eventually I will get around to it because it's important enough but assembler pretty much fills my needs and it's a pretty big jump to make to any other language. Maybe over christmas I'll look into it a bit more, I just got my DVD/CDRW back from IBM (it was broken) so now I can download more C/C++ packages without worrying about disk space.
Posted on 2003-12-16 11:12:19 by donkey
Hi,

I looked for this kind of lib ! I saw the doc : easy to use. Good work.

I'll try this in a few day.

T.
Posted on 2004-03-09 09:37:15 by golemxiii
Hi,

Good, the lib work fine :)

T.
Posted on 2004-03-09 10:45:35 by golemxiii