Page 78      All Pages  All Books
"F;64BF". 64-bit big endian floating point. "F;64NF". 64-bit native floating point.
The Bit Decoder
If the raw decoder cannot handle your format, PIL also provides a special "bit" decoder which can be used to read various packed formats into a floating point image memory.
To use the bit decoder with the fromstring function, use the following syntax:
image = fromstring(
mode, size, data, "bit",
bits, pad, fill, sign, orientation
)
When used in a tile descriptor, the parameter field should look like:
(bits, pad, fill, sign, orientation)
The fields are used as follows:
bits. Number of bits per pixel (2-32). No default.
pad. Padding between lines, in bits. This is either 0 if there is no padding, or 8 if lines are padded to full bytes. If omitted, the pad value defaults to 8.
fill. Controls how data are added to, and stored from, the decoder bit buffer.
fill=0. Add bytes to the msb end of the decoder buffer; store pixels from the msb end.
fill=1. Add bytes to the lsb end of the decoder buffer; store pixels from the msb end.
fill=2. Add bytes to the msb end of the decoder buffer; store pixels from the lsb end.
fill=3. Add bytes to the lsb end of the decoder buffer; store pixels from the lsb end.
If omitted, the fill order defaults to 0.
sign. If non-zero, bit fields are sign extended. If zero or omitted, bit fields are unsigned.
orientation. Whether the first line in the image is the top line on the screen (1), or the bottom line (-1). If omitted, the orientation defaults to 1.

Page 78      All Pages  All Books