in reply to Re: I've muddled my bit and byte formats.
in thread I've muddled my bit and byte formats.
Thank you!
The "ord" function was, as you stated, the key to making this work. My immediate need is resolved.
Clearly there's a subtlety to substr of which I am unaware. $binimage[$thisrow] is just a sequence of storage locations containing bits representing pixels. I, the human being, don't care what they represent; I simply want to know whether the bit I'm looking at contains 1 or 0 and the only way I know how to address that is to grab the byte containing the bit and then try to look inside that.
You appear to be saying that substr will return the ASCII value represented by the number contained in the selected byte(s) rather than just a sequence of 8 bits I, the computer program, can manipulate how I choose.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: I've muddled my bit and byte formats.
by tybalt89 (Monsignor) on Oct 09, 2018 at 23:04 UTC | |
by AnomalousMonk (Archbishop) on Oct 10, 2018 at 04:41 UTC | |
by ikegami (Patriarch) on Oct 10, 2018 at 04:34 UTC | |
|
Re^3: I've muddled my bit and byte formats.
by ikegami (Patriarch) on Oct 10, 2018 at 04:27 UTC | |
by murrayn (Sexton) on Oct 17, 2018 at 05:25 UTC | |
by tybalt89 (Monsignor) on Oct 17, 2018 at 14:47 UTC | |
by murrayn (Sexton) on Oct 18, 2018 at 06:30 UTC | |
by ikegami (Patriarch) on Oct 17, 2018 at 14:47 UTC | |
|
Re^3: I've muddled my bit and byte formats.
by soonix (Chancellor) on Oct 10, 2018 at 07:42 UTC |