MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / recover_quad

Function recover_quad

src_classic/utils.py:5028–5041  ·  view source on GitHub ↗

Recover the quadrilateral of a text span. Args: line_dir: (tuple) 'line["dir"]' of the owning line. span: the span. Returns: The quadrilateral enveloping the span's text.

(line_dir: tuple, span: dict)

Source from the content-addressed store, hash-verified

5026
5027
5028def recover_quad(line_dir: tuple, span: dict) -> Quad:
5029 """Recover the quadrilateral of a text span.
5030
5031 Args:
5032 line_dir: (tuple) 'line["dir"]' of the owning line.
5033 span: the span.
5034 Returns:
5035 The quadrilateral enveloping the span's text.
5036 """
5037 if type(line_dir) is not tuple or len(line_dir) != 2:
5038 raise ValueError("bad line dir argument")
5039 if type(span) is not dict:
5040 raise ValueError("bad span argument")
5041 return recover_bbox_quad(line_dir, span, span["bbox"])
5042
5043
5044def recover_line_quad(line: dict, spans: list = None) -> Quad:

Callers 2

recover_line_quadFunction · 0.70
recover_span_quadFunction · 0.70

Calls 1

recover_bbox_quadFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…