Add new files

This commit is contained in:
2021-08-13 12:28:17 +02:00
parent 53555865f6
commit 5829c66527
21 changed files with 377 additions and 318 deletions
+1 -27
View File
@@ -1,22 +1,9 @@
{-# LANGUAGE TemplateHaskell #-}
--{-# LANGUAGE Strict #-}
module Picture.Data
where
import Geometry.Data
import Control.Lens
--import GHC.Generics (Generic)
--import Control.DeepSeq
--import Data.Foldable
--import qualified Data.List as L
--import Data.Monoid
--import Data.Traversable
--import qualified Data.Foldable as F
--import qualified Data.Sequence as Se
--import qualified Data.DList as DL
--import qualified Data.Vector as V
--import Control.Monad
data Verx = Verx
{ _vxPos :: !Point3
, _vxCol :: !Point4
@@ -24,16 +11,7 @@ data Verx = Verx
, _vxLayer :: !Int
, _vxShadNum :: !ShadNum
}
data VertexType
= PolyV
| PolyzV !Float
| BezV !Point4
| TextV !Point2
| ArcV !Point3
| EllV
newtype ShadNum = ShadNum { _unShadNum :: Int }
polyNum, polyzNum, bezNum, textNum, arcNum, ellNum :: ShadNum
polyNum = ShadNum 0
polyzNum = ShadNum 1
@@ -41,10 +19,9 @@ bezNum = ShadNum 2
textNum = ShadNum 3
arcNum = ShadNum 4
ellNum = ShadNum 5
type Picture = [Verx]
type RGBA = Point4
type Color = Point4
flat2 :: V2 a -> [a]
flat2 (V2 x y) = [x,y]
flat3 :: V3 a -> [a]
@@ -63,7 +40,4 @@ tflat4 (x,y,z,w) = [x,y,z,w]
{-# INLINE tflat2 #-}
{-# INLINE tflat3 #-}
{-# INLINE tflat4 #-}
type Picture = [Verx]
makeLenses ''Verx