Archived

This topic is now archived and is closed to further replies.

vlovich

JPEG format

Recommended Posts

I''m not sure if this goes into this topic, but does anyone know how JPEG stores the image. How would I go about uncompressing it and displaying it on the screen.

Share this post


Link to post
Share on other sites
quote:
Original post by vlovich
I''m not sure if this goes into this topic, but does anyone know how JPEG stores the image. How would I go about uncompressing it and displaying it on the screen.


DirectX (the newer versions at least) can load jpgs directly (although maybe only from VB, I can''t remember if VC has a jpg loader function). Microsoft''s IPicture and GDI+ can also load jpgs, which you can blt onto DirectX surfaces or bitmaps, or load as a texture in OpenGL. Thus you don''t need to handle the format and uncompressing yourself.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Even if you need to load a jpg yourself, it''s not too hard... so long as you don''t try to do everything yourself.

Grab the JPEG group''s code for loading a jpg. You just open the file, fill in a structure, call their load code, and close the file. Their load code takes a structure of callbacks. One is a read function (which you can make do an fread, or whatever), one is a store function (outputs a line of uncompressed data which you''ll store somewhere). That''s about all you need.

Share this post


Link to post
Share on other sites
quote:
Original post by DirectXXX
onthis site in sweat snippts section.

a sample code uses IntelJPG lib to load jpg on direct draw surface.


Unfortunately, you can no longer download the IJL (Intel JPEG Library) and their replacement is completely different. Searching around online won''t give any results either (that I could find), since most people seem to just link directly to the Intel site. If you want to use the IJL, I have a copy of the static link library and some save/load code I wrote for it ... but that''s it. (No sample source, no documentation, no dynamic link library, or dll).

Share this post


Link to post
Share on other sites