def paint_mmap(self, img_data, x, y, width, height, rowstride, options, callbacks): """ must be called from UI thread see _mmap_send() in server.py for details """ assert self.mmap_enabled data = mmap_read(self.mmap, *img_data) rgb_format = options.strget(b"rgb_format", b"RGB") #Note: BGR(A) is only handled by gl_window_backing self.do_paint_rgb(rgb_format, data, x, y, width, height, rowstride, options, callbacks)
def paint_mmap(self, img_data, x, y, width, height, rowstride, options, callbacks): """ must be called from UI thread see _mmap_send() in server.py for details """ assert self.mmap_enabled data = mmap_read(self.mmap, img_data) rgb_format = options.strget("rgb_format", "RGB") # Note: BGR(A) is only handled by gl_window_backing self.do_paint_rgb(rgb_format, data, x, y, width, height, rowstride, options, callbacks)
def paint_mmap(self, img_data, x, y, width, height, rowstride, options, callbacks): """ must be called from UI thread """ #we could run just paint_rgb24 from the UI thread, #but this would not make much of a difference #and would complicate the code (add a callback to free mmap area) """ see _mmap_send() in server.py for details """ assert self.mmap_enabled data = mmap_read(self.mmap, img_data) rgb_format = options.get("rgb_format", "rgb24") if rgb_format=="RGB": self.do_paint_rgb24(data, x, y, width, height, rowstride, options, callbacks) elif rgb_format=="RGBA": self.do_paint_rgb32(data, x, y, width, height, rowstride, options, callbacks) else: raise Exception("invalid rgb format: %s" % rgb_format) return False
def paint_mmap(self, img_data, x, y, width, height, rowstride, options, callbacks): """ must be called from UI thread """ #we could run just paint_rgb24 from the UI thread, #but this would not make much of a difference #and would complicate the code (add a callback to free mmap area) """ see _mmap_send() in server.py for details """ assert self.mmap_enabled data = mmap_read(self.mmap, img_data) rgb_format = options.strget("rgb_format", "RGB") #Note: BGR(A) is only handled by gl_window_backing if rgb_format in ("RGB", "BGR"): self.do_paint_rgb24(data, x, y, width, height, rowstride, options, callbacks) elif rgb_format in ("RGBA", "BGRA", "BGRX", "RGBX"): self.do_paint_rgb32(data, x, y, width, height, rowstride, options, callbacks) else: raise Exception("invalid rgb format: %s" % rgb_format) return False