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