-- | Module for handling node processing
module GEGL.FFI.Process
  ( c_gegl_node_process
  , c_gegl_node_blit
  ) where

import Foreign
import Foreign.Ptr
import Foreign.C.Types (CDouble(..), CInt(..))

import GEGL.FFI.Rectangle (GeglRectangle)

import BABL.FFI.Format (BablFormatDummy)

-- | Interface to the function @gegl_node_process@ in C.
foreign import ccall unsafe "gegl.h gegl_node_process"
  c_gegl_node_process
    :: Ptr () -- ^ A GEGL node representation
    -> IO ()

-- | Interface to the function @gegl_node_blit@ in C.
foreign import ccall unsafe "gegl.h gegl_node_blit"
  c_gegl_node_blit
    :: Ptr ()       -- ^ A GEGL node representation
    -> CDouble             -- ^ Scale
    -> Ptr GeglRectangle   -- ^ Area of interest
    -> BablFormatDummy     -- ^ Pixel format
    -> Ptr a               -- ^ Pointer to destination buffer
    -> CInt                -- ^ Row stride in bytes
    -> CInt                -- ^ OR'ed GEGL blit flags
    -> IO ()