LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading bits from file

In an attempt to read single lines from a 1-bit deep SUN rasterbitmap,
I found that the standard read function with bytestreamtype of a boolean
value
doesn't do the trick, because the position offset to read in the next line
can only address
bytes within the file.
The width of my bitmaps usually are not a multiple of 8 bits wide so to
address at byte-boundaries
will not work.
One option is ofcourse to read the whole image into a 2D boolean array and
to convert the bool. data
afterwards , but because of the large bitmaps I have to handle that would
require a large amount of memory
in my PC which I haven't.
Any know of a way to actually read the file in a linewise order ??

René Ramekers
the Netherlands
0 Kudos
Message 1 of 2
(2,365 Views)
Hello Rene,

write your own SUN rasterbitmap reader...

The problem with boolean (arrays) is the internal representation in LabView. Booleans are represented by bytes and not by bits. So you need your own conversion from the read file to a boolean array. If you have done this it's only a small step to a complete bitmap reader/filter...

Best regards,
GerdW

P.S.: Can you publish a description of that file format? Then you will probably get a filter for that in some hours...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 2
(2,365 Views)