Beispiel #1
0
    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
Beispiel #2
0
 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
Beispiel #3
0
    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
Beispiel #4
0
 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",
         )
Beispiel #5
0
    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
Beispiel #6
0
def font_metrics_provider():
    from kiva.fonttools import Font
    gc = GraphicsContext((1, 1))
    gc.set_font(Font())
    return gc
Beispiel #7
0
def font_metrics_provider():
    from kiva.fonttools import Font
    gc = GraphicsContext((1, 1))
    gc.set_font(Font())
    return gc
Beispiel #8
0
 def test_draw_celiagg(self):
     gc = GraphicsContext((200, 200))
     self.do_draw_with_brush(gc)
Beispiel #9
0
 def create_graphics_context(self, width=600, height=600, pixel_scale=2.0):
     return GraphicsContext((width, height), base_pixel_scale=pixel_scale)