-- | Basic definitions for stencil handling.moduleData.Array.Repa.Stencil.Base(Boundary(..),Stencil(..),makeStencil,makeStencil2)whereimportData.Array.Repa.Internals.EltimportData.Array.Repa.Index-- | How to handle the case when the stencil lies partly outside the array.dataBoundarya-- | Treat points outside as having a constant value.=BoundConsta-- | Clamp points outside to the same value as the edge pixel.|BoundClampderiving(Show)-- | Represents a convolution stencil that we can apply to array. Only statically known stencils-- are supported right now.dataStencilsha-- | Static stencils are used when the coefficients are fixed,-- and known at compile time.=StencilStatic{stencilExtent::!sh,stencilZero::!a,stencilAcc::!(sh->a->a->a)}-- | Make a stencil from a function yielding coefficients at each index.makeStencil::(Elta,Numa)=>sh-- ^ Extent of stencil.->(sh->Maybea)-- ^ Get the coefficient at this index.->Stencilsha{-# INLINE makeStencil #-}makeStencilexgetCoeff=StencilStaticex0$\ixvalacc->casegetCoeffixofNothing->accJustcoeff->acc+val*coeff-- | Wrapper for `makeStencil` that requires a DIM2 stencil.makeStencil2::(Elta,Numa)=>Int->Int-- ^ extent of stencil->(DIM2->Maybea)-- ^ Get the coefficient at this index.->StencilDIM2a{-# INLINE makeStencil2 #-}makeStencil2heightwidthgetCoeff=makeStencil(Z:.height:.width)getCoeff