{-# LANGUAGE BangPatterns #-}
module Vision.Primitive (
module Vision.Primitive.Shape
, Point, Size, Rect (..), RPoint (..)
) where
import Data.RatioInt (RatioInt)
import Vision.Primitive.Shape
type Point = DIM2
type Size = DIM2
data Rect = Rect {
Rect -> Int
rX :: {-# UNPACK #-} !Int, Rect -> Int
rY :: {-# UNPACK #-} !Int
, Rect -> Int
rWidth :: {-# UNPACK #-} !Int, Rect -> Int
rHeight :: {-# UNPACK #-} !Int
} deriving (Int -> Rect -> ShowS
[Rect] -> ShowS
Rect -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Rect] -> ShowS
$cshowList :: [Rect] -> ShowS
show :: Rect -> String
$cshow :: Rect -> String
showsPrec :: Int -> Rect -> ShowS
$cshowsPrec :: Int -> Rect -> ShowS
Show, ReadPrec [Rect]
ReadPrec Rect
Int -> ReadS Rect
ReadS [Rect]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Rect]
$creadListPrec :: ReadPrec [Rect]
readPrec :: ReadPrec Rect
$creadPrec :: ReadPrec Rect
readList :: ReadS [Rect]
$creadList :: ReadS [Rect]
readsPrec :: Int -> ReadS Rect
$creadsPrec :: Int -> ReadS Rect
Read, Rect -> Rect -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Rect -> Rect -> Bool
$c/= :: Rect -> Rect -> Bool
== :: Rect -> Rect -> Bool
$c== :: Rect -> Rect -> Bool
Eq, Eq Rect
Rect -> Rect -> Bool
Rect -> Rect -> Ordering
Rect -> Rect -> Rect
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Rect -> Rect -> Rect
$cmin :: Rect -> Rect -> Rect
max :: Rect -> Rect -> Rect
$cmax :: Rect -> Rect -> Rect
>= :: Rect -> Rect -> Bool
$c>= :: Rect -> Rect -> Bool
> :: Rect -> Rect -> Bool
$c> :: Rect -> Rect -> Bool
<= :: Rect -> Rect -> Bool
$c<= :: Rect -> Rect -> Bool
< :: Rect -> Rect -> Bool
$c< :: Rect -> Rect -> Bool
compare :: Rect -> Rect -> Ordering
$ccompare :: Rect -> Rect -> Ordering
Ord)
data RPoint = RPoint {
RPoint -> RatioInt
rpX :: {-# UNPACK #-} !RatioInt, RPoint -> RatioInt
rpY :: {-# UNPACK #-} !RatioInt
} deriving (Int -> RPoint -> ShowS
[RPoint] -> ShowS
RPoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RPoint] -> ShowS
$cshowList :: [RPoint] -> ShowS
show :: RPoint -> String
$cshow :: RPoint -> String
showsPrec :: Int -> RPoint -> ShowS
$cshowsPrec :: Int -> RPoint -> ShowS
Show, ReadPrec [RPoint]
ReadPrec RPoint
Int -> ReadS RPoint
ReadS [RPoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RPoint]
$creadListPrec :: ReadPrec [RPoint]
readPrec :: ReadPrec RPoint
$creadPrec :: ReadPrec RPoint
readList :: ReadS [RPoint]
$creadList :: ReadS [RPoint]
readsPrec :: Int -> ReadS RPoint
$creadsPrec :: Int -> ReadS RPoint
Read, RPoint -> RPoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RPoint -> RPoint -> Bool
$c/= :: RPoint -> RPoint -> Bool
== :: RPoint -> RPoint -> Bool
$c== :: RPoint -> RPoint -> Bool
Eq, Eq RPoint
RPoint -> RPoint -> Bool
RPoint -> RPoint -> Ordering
RPoint -> RPoint -> RPoint
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: RPoint -> RPoint -> RPoint
$cmin :: RPoint -> RPoint -> RPoint
max :: RPoint -> RPoint -> RPoint
$cmax :: RPoint -> RPoint -> RPoint
>= :: RPoint -> RPoint -> Bool
$c>= :: RPoint -> RPoint -> Bool
> :: RPoint -> RPoint -> Bool
$c> :: RPoint -> RPoint -> Bool
<= :: RPoint -> RPoint -> Bool
$c<= :: RPoint -> RPoint -> Bool
< :: RPoint -> RPoint -> Bool
$c< :: RPoint -> RPoint -> Bool
compare :: RPoint -> RPoint -> Ordering
$ccompare :: RPoint -> RPoint -> Ordering
Ord)