Return an |_SofMarker| instance for the SOFn marker at `offset` in stream.
(cls, stream, marker_code, offset)
| 401 | |
| 402 | @classmethod |
| 403 | def from_stream(cls, stream, marker_code, offset): |
| 404 | """Return an |_SofMarker| instance for the SOFn marker at `offset` in stream.""" |
| 405 | # field off type notes |
| 406 | # ------------------ --- ----- ---------------------------- |
| 407 | # segment length 0 short |
| 408 | # Data precision 2 byte |
| 409 | # Vertical lines 3 short px_height |
| 410 | # Horizontal lines 5 short px_width |
| 411 | # ------------------ --- ----- ---------------------------- |
| 412 | segment_length = stream.read_short(offset) |
| 413 | px_height = stream.read_short(offset, 3) |
| 414 | px_width = stream.read_short(offset, 5) |
| 415 | return cls(marker_code, offset, segment_length, px_width, px_height) |
| 416 | |
| 417 | @property |
| 418 | def px_height(self): |
nothing calls this directly
no test coverage detected