def render_img(self, buf, addr, mouse_offs): colors = [] self._update_key(buf) for c in buf: c = (ord(c) ^ self.key) & 0xFF colors.append(qRgb(c, 0, c)) return colors