Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type PixelAttr = (Char, Attr)
- mergeAttr :: Map (Int, Int) (Float, PixelAttr) -> Map (Int, Int) (Float, PixelAttr) -> Map (Int, Int) (Float, PixelAttr)
- toCanvasPixels :: Map (Int, Int) (Char, Attr) -> [((Int, Int), Char, Attr)]
- rasterizeMany :: (Foldable t, Functor t) => (Int, Int) -> t DCPrimitive -> [((Int, Int), Char, Attr)]
- rasterize :: (Int, Int) -> DCPrimitive -> Map (Int, Int) (Float, PixelAttr)
- rasterizeLine :: SCVertex -> SCVertex -> Vector SCVertex
- fillTriangle :: SCVertex -> SCVertex -> SCVertex -> Vector SCVertex
- isInsideOfTri :: SCPosition -> (SCPosition, SCPosition, SCPosition) -> Bool
Documentation
mergeAttr :: Map (Int, Int) (Float, PixelAttr) -> Map (Int, Int) (Float, PixelAttr) -> Map (Int, Int) (Float, PixelAttr) Source #
Merge two Map
of Pixels into one by comparing zBuffer
toCanvasPixels :: Map (Int, Int) (Char, Attr) -> [((Int, Int), Char, Attr)] Source #
Convert Map
to list so that canvasSetMany
can treat
rasterizeMany :: (Foldable t, Functor t) => (Int, Int) -> t DCPrimitive -> [((Int, Int), Char, Attr)] Source #
Rasterize many of DCPrimitive
s
rasterize :: (Int, Int) -> DCPrimitive -> Map (Int, Int) (Float, PixelAttr) Source #
Rasterize one DCPrimitive
isInsideOfTri :: SCPosition -> (SCPosition, SCPosition, SCPosition) -> Bool Source #
True
if given coordinate is within given Triangle
It doesn't care if the triangle is formed well. (e.g. one vertex is on the line made of other two vertex, two of them are the same.) This is because projection could
JP: この関数は「三角形がきちんと三角形であるか」を考慮しません。 (例えば: 頂点が一直線上に並んでしまっている, 複数の頂点が同じ位置にあるなど)