def _create_gc(self, size, pix_format="rgba32"): gc = GraphicsContext((size[0]+1, size[1]+1), pix_format=pix_format) gc.translate_ctm(0.5, 0.5) self._shuffle_buffer = np.empty((size[1]+1, size[0]+1, 4,), dtype=np.uint8) return gc
def _create_gc(self, size, pix_format="rgba32"): gc = GraphicsContext( (size[0] + 1, size[1] + 1), pix_format=pix_format, base_pixel_scale=self.base_pixel_scale, ) gc.translate_ctm(0.5, 0.5) return gc
def _create_gc(self, size, pix_format="rgba32"): gc = GraphicsContext((size[0] + 1, size[1] + 1), pix_format=pix_format) gc.translate_ctm(0.5, 0.5) self._shuffle_buffer = np.empty(( size[1] + 1, size[0] + 1, 4, ), dtype=np.uint8) return gc
def test_default_draw_celiagg(self): gc = GraphicsContext((200, 200)) gradient = self.create_gradient() with gc: gc.linear_gradient( 125, 75, 75, 125, gradient.to_array(), "pad", )
def _create_gc(self, size, pix_format="bgra32"): gc = GraphicsContext( (size[0] + 1, size[1] + 1), pix_format=pix_format, base_pixel_scale=self.base_pixel_scale, ) gc.translate_ctm(0.5, 0.5) self._shuffle_buffer = np.empty( (size[1] + 1, size[0] + 1, 4), dtype=np.uint8 ) return gc
def font_metrics_provider(): from kiva.fonttools import Font gc = GraphicsContext((1, 1)) gc.set_font(Font()) return gc
def test_draw_celiagg(self): gc = GraphicsContext((200, 200)) self.do_draw_with_brush(gc)
def create_graphics_context(self, width=600, height=600, pixel_scale=2.0): return GraphicsContext((width, height), base_pixel_scale=pixel_scale)