summaryrefslogtreecommitdiff
path: root/FitCurves.hs
blob: 8c73cfbf84486999828f1bcdcd2739da133151c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{-# LANGUAGE RecordWildCards, DataKinds, DeriveDataTypeable #-}
module FitCurves where

import Control.Monad
import Data.Data
import Data.Int
import Data.IORef
import qualified Data.Vector.Storable.Mutable as MV
import Foreign.Ptr
import Foreign.Storable
import GHC.Exts (RealWorld)
import Numeric.LinearAlgebra as Math hiding ((<>))

import Bezier
import Camera
import qualified GPURing as GPU
import LambdaCube.GL.Input.Type
import MaskableStream
import RingBuffer
import qualified VectorRing as Vector
         ;import VectorRing (Point)
import LambdaCube.GL.HMatrix ()


data RingPoint = RingPoint
    { rpPosition :: AttributeKey (GLVector 3 Float)
    , rpColor :: AttributeKey (GLVector 3 Float)
    }
    deriving Data


white,red,yellow,blue :: Vector Float
white  = fromList [1,1,1]
yellow = fromList [1,1,0]
blue   = fromList [0,0,1]
red    = fromList [1,0,0]

fitCurve1 :: Camera
             -> Maybe Plane
             -> (Int32 -> [(Int32, Int32)])
             -> Int
             -> TargetBuffer (GPU.Update RingPoint)
             -> MV.MVector RealWorld Vector.Point
             -> IO (Maybe Int)
fitCurve1 cam plane mask max_curve_pts buf dta = do
    return Nothing -- TODO