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

Method invert_irect

src/__init__.py:13637–13648  ·  view source on GitHub ↗

Invert the colors inside a bbox.

(self, bbox=None)

Source from the content-addressed store, hash-verified

13635 return mupdf.fz_pixmap_height(self.this)
13636
13637 def invert_irect(self, bbox=None):
13638 """Invert the colors inside a bbox."""
13639 pm = self.this
13640 if not mupdf.fz_pixmap_colorspace(pm).m_internal:
13641 message_warning("ignored for stencil pixmap")
13642 return False
13643 r = JM_irect_from_py(bbox)
13644 if mupdf.fz_is_infinite_irect(r):
13645 mupdf.fz_invert_pixmap(pm)
13646 return True
13647 mupdf.fz_invert_pixmap_rect(pm, r)
13648 return True
13649
13650 @property
13651 def irect(self):

Callers 1

test_3182Function · 0.95

Calls 2

message_warningFunction · 0.85
JM_irect_from_pyFunction · 0.85

Tested by 1

test_3182Function · 0.76