delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/10/21:16:47

Message-ID: <34B825B4.3079@compuserve.com>
Date: Sat, 10 Jan 1998 20:51:48 -0500
From: Laurent Turcotte <lturcott AT compuserve DOT com>
MIME-Version: 1.0
Subject: Re: Extracting a pixel from an Allegro BITMAP
References: <19980109085201 DOT DAA02949 AT ladder02 DOT news DOT aol DOT com>
Newsgroups: comp.os.msdos.djgpp
Lines: 34
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi

For a bitmap buffer

BITMAP  buffer;

pixel = buffer.line[y][x]
	
the line element of the BITMAP structure contain pointers
to start of lines (a lookup table)
So there are no multiplications involved .

Regards
Laurent Turcotte

> Hello everybody...
> 
>     in the past... my buffers have been char *
> 
>  I could simply do:
> 
>        a_pixel = double_buffer[(y<<8) + (y<<6) + (x>>2)];
> 
>      - or -
> 
>       double_buffer [(y<<8) + (y<<6) + (x>>2)] = a_pixel;
> 
>    - and even -
> 
>       a_pixel = image->buffer[(y<<8) + (y<<6) + (x>>2)];
> .. and the other way around....
> 
>    How can I do that with an Allegro BITMAP?
> ...

- Raw text -


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