delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/20/11:30:44

From: Eric Vannier <vannier AT email DOT enst DOT fr>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Proposal: Gif / Jpeg / or whatever decoder with callback
Date: Fri, 20 Feb 1998 17:25:48 +0100
Organization: ENST, France
Lines: 42
Message-ID: <34EDAE8C.71C8@email.enst.fr>
References: <34e6164f DOT 747913 AT news DOT clear DOT net DOT nz>
NNTP-Posting-Host: brouilly.enst.fr
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Not a bad idea ...
But I preferr the way it is implemented in Allegro :
The data of the bitmap is written to memory, than 
you use a blit function to do the device dependant 
blitting.

There is one advantage of this method : 
With your method, you have to call the putpixel 
function many times which is very slow compared
to a huge blit of the whole image.
It is faster to write to memory, then blit to 
video memory.

Of course you can use the same kind of functions you
intend to write with a pointer to a blit function
instead of a putpixel function. If you don't think
that is a good idea to use so much memory to uncompress
an image, you can pass a blit function which could be
used line by line, or something like that.

But I don't think that the memory problem is really
relevant :
 - most PCs are equiped with a lot of memory these 
days ... and usually a lot more main memory than
video memory. So, even if your image is huge, and cannot
fit in central memory, it is not very likely to fit in the
video memory

 - most algorithms used in bitmap compression and decompression
require a bunch of memory which is usually more important than
the size of the image itself. This is very true with JPEG


If you did not know about Allegro try this :
http://www.talula.demon.co.uk/allegro

BTW, you 'll find some packages which do exactly what you want
(GIF, JPEG)

Best regards,

Eric Vannier

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019