MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / draw_image

Method draw_image

lib/matplotlib/backends/backend_cairo.py:205–216  ·  view source on GitHub ↗
(self, gc, x, y, im)

Source from the content-addressed store, hash-verified

203 ctx, rgbFace, gc.get_alpha(), gc.get_forced_alpha())
204
205 def draw_image(self, gc, x, y, im):
206 im = cbook._unmultiplied_rgba8888_to_premultiplied_argb32(im[::-1])
207 surface = cairo.ImageSurface.create_for_data(
208 im.ravel().data, cairo.FORMAT_ARGB32,
209 im.shape[1], im.shape[0], im.shape[1] * 4)
210 ctx = gc.ctx
211 y = self.height - y - im.shape[0]
212
213 ctx.save()
214 ctx.set_source_surface(surface, float(x), float(y))
215 ctx.paint()
216 ctx.restore()
217
218 def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
219 # docstring inherited

Callers

nothing calls this directly

Calls 3

saveMethod · 0.80
paintMethod · 0.45
restoreMethod · 0.45

Tested by

no test coverage detected