3 ms·
You could view it as a list of numbers, yes. Alternatively, we all know that the file representing the image is nothing more than a collection of bytes. Bytes
by jsolson 17y ago
You could view it as a list of numbers, yes.
Alternatively, we all know that the file representing the image is nothing more than a collection of bytes. Bytes are nothing more than 8-element bit vectors. What if instead of treating the file as a collection of $n$ 8-element bit vectors we instead treated it as a single $n*8$-element bit vector. What we now have is a single (potentially VERY large) binary number.
To make any sense out of this number we'd have to pull out individual collections of bits, but this is no more complicated than doing a bitwise AND and bit shift.
Put another way: you can think of an IP-address as 4 sets of numbers between 0 and 255. For example, 192.168.1.1. You can view that same IP-address as the hexidecimal number 0xC0A80101. The hex representation is convenient, as it makes elements in the dotted quad apparent. 0xc0 = 192, 0xa8 = 168, 0x01 = 1, 0x01 = 1.
Hope that helps.
- Rod 17y agoThat's not what I meant at all. Of course you can transform a list of bytes into a number. But can you transform a number into a list of bytes? That is the problem. If you know the "encoding" algorithm, then you can. If you do not, then you simply can't. The point I was trying to make is that a number, itself, is nothing unless there's knowledge of the encoding algorithm. A CD-reader can make sense of the bits stored on the disk because it knows the encoding algorithm. If the CD-burner and CD-reader did not "talk the same language", it would be impossible to make sense of all those bits stored on the disk. Without knowing what interleaving and channel code was used, the CD-reader can't do its job.