BlitzMax Pixmap Bits Per Pixel

Sage
Posts: 1,066
Joined: 2004.07
Post: #1
Is there a way to get the bits per pixel of a pixmap? I'm trying to write a nice little OpenGL texture loader, but I can't find this part.

On a related topic, what, in lamen's terms, is the pitch? I know it's the bytes between the rows of pixels, but what does that really mean? Anything useful? I guess I'm not sure of the use of knowing something like that.
Quote this message in a reply
Moderator
Posts: 529
Joined: 2003.03
Post: #2
Quote:Get pixmap format
returns: The format of the pixels stored in @pixmap

The returned value will be one of:
Format Description
PF_RGB888 24 bit big endian RGB
PF_BGR888 24 bit little endian RGB
PF_RGBA8888 32 bit big endian RGB with alpha
PF_BGRA8888 32 bit big endian RGB with alpha

Function PixmapFormat( pixmap:TPixmap )
Return pixmap.format
End Function

I think it will always load pictures with 8 bits per pixel

In any event, there are a many undocumented functions and methods in \mod\brl.mod\pixmap.mod

"Yes, well, that's the sort of blinkered, Philistine pig-ignorance I've come to expect from you non-creative garbage."
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #3
Nick Wrote:On a related topic, what, in lamen's terms, is the pitch? I know it's the bytes between the rows of pixels, but what does that really mean? Anything useful? I guess I'm not sure of the use of knowing something like that.
Pitch is to do with the presumed physical size of the pixels, in the real world, on a monitor or something. Obviously this varies according to your output device, but it's only supposed to be a general indication. It's expressed in dots per inch (DPI), the same as printing resolution.

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #4
Actually, I think that in this case pitch is describing the length of one of the image rows in bytes or words. The idea is that you might be using a pixel format that doesn't fit nicely into an int. (ie a 3 byte RGB image) Padding may be added to the end of each row so that it is rounded up to the next power of four. That makes it easy to copy the pixels into the destination without having to shift things or copy byte by byte. At least that's the general gist of it.
Quote this message in a reply
Moderator
Posts: 365
Joined: 2002.04
Post: #5
Good point, didn't see 'BlitzMax' in the subject. Wink

Neil Carter
Nether - Mac games and comic art
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  BlitzMax tutorial? dogone 4 6,007 Oct 3, 2008 09:15 PM
Last Post: stevejohnson
  blitzmax vs flash hertzcastle 1 3,530 Apr 3, 2008 04:38 PM
Last Post: OneSadCookie
  does blitzmax still support lua? rward 5 3,898 Apr 29, 2006 09:29 AM
Last Post: Leisure Suit Lurie
  drawtext in blitzmax Najdorf 2 3,715 Sep 21, 2005 06:06 AM
Last Post: unknown
  Fonts in Blitzmax? Yoda 3 3,739 Aug 1, 2005 11:45 AM
Last Post: Leisure Suit Lurie