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

Function JM_matrix_from_py

src/__init__.py:20759–20771  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

20757
20758
20759def JM_matrix_from_py(m):
20760 a = [0, 0, 0, 0, 0, 0]
20761 if isinstance(m, mupdf.FzMatrix):
20762 return m
20763 if isinstance(m, Matrix):
20764 return mupdf.FzMatrix(m.a, m.b, m.c, m.d, m.e, m.f)
20765 if not m or not PySequence_Check(m) or PySequence_Size(m) != 6:
20766 return mupdf.FzMatrix()
20767 for i in range(6):
20768 a[i] = JM_FLOAT_ITEM(m, i)
20769 if a[i] is None:
20770 return mupdf.FzRect()
20771 return mupdf.FzMatrix(a[0], a[1], a[2], a[3], a[4], a[5])
20772
20773
20774def JM_mediabox(page_obj):

Callers 15

get_pixmapMethod · 0.85
set_apn_matrixMethod · 0.85
runMethod · 0.85
_get_textpageMethod · 0.85
_show_pdf_pageMethod · 0.85
extend_textpageMethod · 0.85
get_svg_imageMethod · 0.85
runMethod · 0.85
drawMethod · 0.85
JM_pixmap_from_pageFunction · 0.85
util_transform_rectFunction · 0.85

Calls 3

PySequence_CheckFunction · 0.85
PySequence_SizeFunction · 0.85
JM_FLOAT_ITEMFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…