@classmethod
def from_stream(cls, stream, marker_code, offset):
    """
        Return an |_SofMarker| instance for the SOFn marker at *offset* in
        stream.
        """
    segment_length = stream.read_short(offset)
    px_height = stream.read_short(offset, 3)
    px_width = stream.read_short(offset, 5)
    return cls(marker_code, offset, segment_length, px_width, px_height)
