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

Class DeviceWrapper

src/__init__.py:2748–2768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2746
2747
2748class DeviceWrapper:
2749 def __init__(self, *args):
2750 if args_match( args, mupdf.FzDevice):
2751 device, = args
2752 self.this = device
2753 elif args_match( args, Pixmap, None):
2754 pm, clip = args
2755 bbox = JM_irect_from_py( clip)
2756 if mupdf.fz_is_infinite_irect( bbox):
2757 self.this = mupdf.fz_new_draw_device( mupdf.FzMatrix(), pm)
2758 else:
2759 self.this = mupdf.fz_new_draw_device_with_bbox( mupdf.FzMatrix(), pm, bbox)
2760 elif args_match( args, mupdf.FzDisplayList):
2761 dl, = args
2762 self.this = mupdf.fz_new_list_device( dl)
2763 elif args_match( args, mupdf.FzStextPage, None):
2764 tp, flags = args
2765 opts = mupdf.FzStextOptions( flags)
2766 self.this = mupdf.fz_new_stext_device( tp, opts)
2767 else:
2768 raise Exception( f'Unrecognised args for DeviceWrapper: {args!r}')
2769
2770
2771class DisplayList:

Callers 1

begin_pageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…