Addons/graphics/bmp

From J Wiki
Jump to navigation Jump to search

These are .bmp files in DIB format.

readbmp and writebmp use RGB values (single numbers).

writebmp also accepts RGB triples

main functions:

  readbmp      read bitmap file, returning RGB data
  writebmp     write bitmap file from RGB data
  readbmphdr   read header from bitmap file

Name Type Description
readbmp verb read bitmap file, returning RGB data
readbmpall verb read bitmap data
readbmphdr verb read header from bitmap file
writebmp verb write bmp file from RGB data

readbmpall

read bitmap data

y is bitmap file, or bitmap data
returns:  bitsize, rows, columns, offset, sheader, data

readbmphdr

read header from bitmap file
returns:  bitsize, rows, columns

writebmp

write bmp file from RGB data

Form:  data writebmp filename [;minimum bitsize]

picks appropriate bit size of 4 8 or 24, subject
to optional minimum bit size.