module Graphics.PS.Transform (Transformable
,translate, scale, rotate) where
import Data.CG.Minus
import qualified Graphics.PS.Path as P
import qualified Graphics.PS.Image as I
class Transformable a where
transform :: Matrix Double -> a -> a
translate :: (Transformable a) => Double -> Double -> a -> a
translate x = transform . mx_translation x
scale :: (Transformable a) => Double -> Double -> a -> a
scale x = transform . mx_scaling x
rotate :: (Transformable a) => Double -> a -> a
rotate = transform . mx_rotation
instance Transformable I.Image where
transform = I.ITransform
instance Transformable P.Path where
transform = P.PTransform
instance Transformable (Pt Double) where
transform = pt_transform