Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FB PUT structure
#1
I'm making a .bmp to PUT loader and need to know the internal structure of the PUT format...
How does the header look like, and how does the data look like...

Thanks for help.
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply
#2
well... since youre doing it in fb you can do this ya know...


Code:
dim as integer put_thing (bmpwidth * bmpheight)

bload "mybmp.bmp", @put_thing(0)


but, if youre intent on doing it yourself, the first two bytes are the width multiplied by 8 and the next 2 bytes are the height. the data then follows, n bytes per pixel, top left to bottom right. n being colordepth / 8


anyone add anything i missed...


edit: correct, it is always multiplied by 8... i only ever use 8 bit ;P and no, there is no 1, 2, 4 for depth, you could do it yourself but its not standard
Reply
#3
isn't it x*8 no matter what? and then you add 1,2, or 4 depending on the color depth?
[Image: freebasic.png]
Reply
#4
I noticed, that the width would be 164 for a 20*20 image. Thats 20*8 + 4...hmmm
It's the difference between asking someone how much flour goes into pancakes, and handing them a sorry mix of oozing green goo and asking them to fix it." - Deleter

-Founder & President of the No More Religion Threads movement-
Reply
#5
Code:
Screen 14, 32

Dim As Integer r ( 6000 * 6000)


Bload "test02.bmp", @r(0) '' a 24-bit bmp



Put(0,0), r

Dim As uShort Ptr y

y = @r(0)

? y[0]
? y[1]

Sleep


i just used code. came out to width * 8, even for a 24-bit bmp
Reply
#6
its probably because the first 3 bits are used to keep track of the number of bytes for the bit depth. (4 bytes = 32/24 bitdepth, 2=16/15 bitdepth 1=8,4,2,1 bitdepth)
so you have Y shl 16 + X shl 3 + NumOfBytes
[Image: freebasic.png]
Reply
#7
yeah, but that would show up in y[0] as a number, which it doesnt...

run that code with any bmp, and instead of y[0], print y[0] mod 8. youll get 0 every time
Reply
#8
what is y[0]?
[Image: freebasic.png]
Reply
#9
y[0] in the context of that code, is the first 16 bitsof the put array.

edit: whoops, put 16 bytes meant 2 bytes; 16 bits
Reply
#10
Well I don't know about bmp, but he asked about the put format...and thats how it works in my experience.
[Image: freebasic.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)