MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / getbuffer

Method getbuffer

resources/waveshare_epd/max7219.py:77–81  ·  view source on GitHub ↗

Convert a PIL Image (mode '1' or 'L') to a display buffer (the image itself).

(self, image)

Source from the content-addressed store, hash-verified

75 self._device.contrast(self._brightness * 17)
76
77 def getbuffer(self, image):
78 """Convert a PIL Image (mode '1' or 'L') to a display buffer (the image itself)."""
79 if image.size != (self.width, self.height):
80 image = image.resize((self.width, self.height))
81 return image.convert("1")
82
83 def display(self, buf):
84 """Push a PIL Image (or getbuffer result) to the MAX7219 panels."""

Callers

nothing calls this directly

Calls 1

resizeMethod · 0.80

Tested by

no test coverage detected