Advertisement

whats Offset?????

Started by August 27, 2002 03:57 AM
6 comments, last by stealth 22 years, 4 months ago
I''m currently reading about the bitmap format and it mentions Offset and some numbers that look something like this: 0000h 0002h 0006h 000Ah and many similar I was wondering if anyone could explain what they meant???? are they byte positions in a file or something????? ( just a wild guess ) could some one plz help me out here? cheers Stealth
The values are supposed to be hexadecimal values.
The decimal equivalents are

0000h = 0
0002h = 2
0006h = 6
000Ah = 10

In hex digits can hold the values: 0 to 9 and A (decimal 10) to F (decimal 15).
So every digits can have 16 different states -> representing 4 bits of data (half byte).
So the above 4-digits-values are 2 Bytes long.

I don't know that context, but concerning graphics one could use 16 bit values to represent pixel color values in 16 bit color depth.



[edited by - perkele on August 27, 2002 8:29:26 AM]
Advertisement
If you are talking about Windows bitmap format, there is one value that is the offset to the sdata from the start of the file.

---
Make it work.
Make it fast.

"I’m happy to share what I can, because I’m in it for the love of programming. The Ferraris are just gravy, honest!" --John Carmack: Forward to Graphics Programming Black Book
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
quote: Original post by perkele
So every digits can have 16 different states -> representing 8 bits of data (half byte).

That should be every hex-digit (a.k.a. nibble) can have 16 different states -> representing 4 bits of data (half byte).
Arguing on the internet is like running in the Special Olympics: Even if you win, you're still retarded.[How To Ask Questions|STL Programmer's Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]
thanx & sorry - just a slip of the pen...
quote:
are they byte positions in a file or something?????


From the context I''d say that they are indeed byte positions in the file. What the others said about hex will show how to interpret the actual numbers, but they do represent positions from the start of the file:

Offset(hex)  Offset(decimal)   Length in bytes0000h             0                  20002h             2                  40006h             6                  4000Ah             10                 ?


Advertisement
ok thanks alot guys , but I was wondering , because I''m reading from a Bitmap file , if I KNEW the hex value of where the "pixel data" started would I be able to skip straight to it by ignoring all the bytes before it and then read the data in to load the bitmap?????
actually forget that last question

This topic is closed to new replies.

Advertisement