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

Class DisplayList

src/__init__.py:2771–2814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2769
2770
2771class DisplayList:
2772 def __del__(self):
2773 if not type(self) is DisplayList: return
2774 self.thisown = False
2775
2776 def __init__(self, *args):
2777 if len(args) == 1 and isinstance(args[0], mupdf.FzRect):
2778 self.this = mupdf.FzDisplayList(args[0])
2779 elif len(args) == 1 and isinstance(args[0], mupdf.FzDisplayList):
2780 self.this = args[0]
2781 else:
2782 assert 0, f'Unrecognised {args=}'
2783
2784 def get_pixmap(self, matrix=None, colorspace=None, alpha=0, clip=None):
2785 if isinstance(colorspace, Colorspace):
2786 colorspace = colorspace.this
2787 else:
2788 colorspace = mupdf.FzColorspace(mupdf.FzColorspace.Fixed_RGB)
2789 val = JM_pixmap_from_display_list(self.this, matrix, colorspace, alpha, clip, None)
2790 val.thisown = True
2791 return val
2792
2793 def get_textpage(self, flags=3):
2794 """Make a TextPage from a DisplayList."""
2795 stext_options = mupdf.FzStextOptions()
2796 stext_options.flags = flags
2797 val = mupdf.FzStextPage(self.this, stext_options)
2798 val.thisown = True
2799 return val
2800
2801 @property
2802 def rect(self):
2803 val = JM_py_from_rect(mupdf.fz_bound_display_list(self.this))
2804 val = Rect(val)
2805 return val
2806
2807 def run(self, dw, m, area):
2808 mupdf.fz_run_display_list(
2809 self.this,
2810 dw.device,
2811 JM_matrix_from_py(m),
2812 JM_rect_from_py(area),
2813 mupdf.FzCookie(),
2814 )
2815
2816if g_use_extra:
2817 extra_FzDocument_insert_pdf = extra.FzDocument_insert_pdf

Callers 1

get_displaylistMethod · 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…