| delorie.com/archives/browse.cgi | search |
| 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? > ...
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |