works now and is fast

This commit is contained in:
nek0 2016-12-11 01:42:06 +01:00
parent af5526c650
commit 3757622475
2 changed files with 3 additions and 3 deletions

View file

@ -51,7 +51,7 @@ load _ = do
traceM "checkerboard"
over <- G.gegl_node_new_child root G.defaultOverOperation
traceM "over"
buffer <- G.gegl_buffer_new (G.GeglRectangle 0 0 20 20) =<<
buffer <- G.gegl_buffer_new (G.GeglRectangle 0 0 800 600) =<<
B.babl_format (B.PixelFormat B.RGBA B.CFfloat)
bufsrc <- G.gegl_node_new_child root $ G.bufferSourceOperation
[ G.Property "buffer" $ G.PropertyBuffer buffer

View file

@ -30,8 +30,8 @@ drawRect buf color (Fill) rect@G.GeglRectangle{..} =
drawRect buf color (Line size) rect@G.GeglRectangle{..} = do
drawRect buf color Fill (G.GeglRectangle rectangleX rectangleY rectangleWidth size)
drawRect buf color Fill (G.GeglRectangle rectangleX rectangleY size rectangleHeight)
drawRect buf color Fill (G.GeglRectangle (rectangleWidth - size) rectangleY size rectangleHeight)
drawRect buf color Fill (G.GeglRectangle rectangleX (rectangleHeight - size) rectangleWidth size)
drawRect buf color Fill (G.GeglRectangle (rectangleX + rectangleWidth - size) rectangleY size rectangleHeight)
drawRect buf color Fill (G.GeglRectangle rectangleX (rectangleY + rectangleHeight - size) rectangleWidth size)
-- | compute color for a single pixel
colorize