36 lines
1.4 KiB
Haskell
36 lines
1.4 KiB
Haskell
module PDF.Content.Operator.Path (
|
|
Operator(..)
|
|
, signature
|
|
) where
|
|
|
|
import PDF.Content.Operator.Common (Signature)
|
|
|
|
data Operator =
|
|
M_ | L_ | C_ | V_ | Y_ | H_ | R_e -- path construction
|
|
| S | S_ | F_ | F | Fstar | B | Bstar | B_ | B_star | N_ -- path painting
|
|
| W | Wstar -- clipping path
|
|
deriving (Bounded, Enum, Show)
|
|
|
|
signature :: [Signature Operator]
|
|
signature = [
|
|
(M_, \l -> case l of [_, _] -> True ; _ -> False)
|
|
, (L_, \l -> case l of [_, _] -> True ; _ -> False)
|
|
, (C_, \l -> case l of [_, _, _, _, _, _] -> True ; _ -> False)
|
|
, (V_, \l -> case l of [_, _, _, _] -> True ; _ -> False)
|
|
, (Y_, \l -> case l of [_, _, _, _] -> True ; _ -> False)
|
|
, (H_, \l -> case l of [] -> True ; _ -> False)
|
|
, (R_e, \l -> case l of [_, _, _, _] -> True ; _ -> False)
|
|
, (S, \l -> case l of [] -> True ; _ -> False)
|
|
, (S_, \l -> case l of [] -> True ; _ -> False)
|
|
, (F_, \l -> case l of [] -> True ; _ -> False)
|
|
, (F, \l -> case l of [] -> True ; _ -> False)
|
|
, (Fstar, \l -> case l of [] -> True ; _ -> False)
|
|
, (B, \l -> case l of [] -> True ; _ -> False)
|
|
, (Bstar, \l -> case l of [] -> True ; _ -> False)
|
|
, (B_, \l -> case l of [] -> True ; _ -> False)
|
|
, (B_star, \l -> case l of [] -> True ; _ -> False)
|
|
, (N_, \l -> case l of [] -> True ; _ -> False)
|
|
, (W, \l -> case l of [] -> True ; _ -> False)
|
|
, (Wstar, \l -> case l of [] -> True ; _ -> False)
|
|
]
|