module GEGL.Operation
( Operation(..)
, Property(..)
, PropertyValue(..)
, loadOperation
, cropOperation
, defaultCropOperation
, textOperation
, defaultTextOperation
, pngSaveOperation
, defaultPNGSaveOperation
, checkerboardOperation
, defaultCheckerboardOperation
, overOperation
, defaultOverOperation
, bufferSourceOperation
, translateOperation
, FractalType(..)
, FractalMode(..)
) where
import Foreign.C.Types
import Foreign.C.String
import Foreign.Storable(Storable(..))
import Foreign.Ptr (Ptr)
import GEGL.FFI.Color (GeglColor(..))
import GEGL.FFI.Buffer (GeglBuffer(..))
import GEGL.Color (Color(..))
import BABL.Format (PixelFormat)
data Property = Property
{ propertyName :: String
, propertyValue :: PropertyValue
}
data PropertyValue
= PropertyInt Int
| PropertyString String
| PropertyDouble Double
| PropertyColor Color
| PropertyFormat PixelFormat
| PropertyBuffer GeglBuffer
| PropertyPointer (Ptr ())
data Operation = Operation
{ operationName :: String
, operationParams :: [Property]
}
loadOperation :: [Property] -> Operation
loadOperation = Operation "gegl:load"
cropOperation :: [Property] -> Operation
cropOperation = Operation "gegl:crop"
defaultCropOperation :: Operation
defaultCropOperation = cropOperation []
pngSaveOperation :: [Property] -> Operation
pngSaveOperation = Operation "gegl:png-save"
defaultPNGSaveOperation :: Operation
defaultPNGSaveOperation = pngSaveOperation []
textOperation :: [Property] -> Operation
textOperation = Operation "gegl:text"
defaultTextOperation :: Operation
defaultTextOperation = textOperation []
overOperation :: [Property] -> Operation
overOperation = Operation "gegl:over"
defaultOverOperation :: Operation
defaultOverOperation = overOperation []
checkerboardOperation :: [Property] -> Operation
checkerboardOperation = Operation "gegl:checkerboard"
defaultCheckerboardOperation :: Operation
defaultCheckerboardOperation = checkerboardOperation []
bufferSourceOperation :: [Property] -> Operation
bufferSourceOperation = Operation "gegl:buffer-source"
translateOperation :: [Property] -> Operation
translateOperation = Operation "gegl:translate"
data FractalType
= Mandelbrot
| Julia
| Barnsley1
| Barnsley2
| Barnsley3
| Spider
| ManOWar
| Lambda
| Sierpinsky
data FractalMode
= Sine
| Cosine
| None