patch-image-llvm

Safe HaskellNone
LanguageHaskell98

Main

Synopsis

Documentation

type YUV a = (a, a, a) Source

shape2 :: Integral i => i -> i -> Dim2 Source

vectorStorableFrom :: (C sh, Storable a) => (ForeignPtr c -> ForeignPtr a) -> Array sh c -> Vector a Source

fromInt :: (NativeInteger i ir, NativeFloating a ar) => Exp i -> Exp a Source

imageFloatFromByte :: (C array, C sh, NativeFloating a ar, PseudoRing a, Real a, RationalConstant a) => array sh Word8 -> array sh a Source

imageByteFromFloat :: (C array, C sh, NativeFloating a ar, Field a, Real a, RationalConstant a) => array sh a -> array sh Word8 Source

colorImageFloatFromByte :: (C array, C sh, NativeFloating a ar, PseudoRing a, Real a, RationalConstant a) => array sh (YUV Word8) -> array sh (YUV a) Source

colorImageByteFromFloat :: (C array, C sh, NativeFloating a ar, Field a, Real a, RationalConstant a) => array sh (YUV a) -> array sh (YUV Word8) Source

dim2 :: Exp i -> Exp i -> Exp (Shape2 i) Source

ix2 :: Exp i -> Exp i -> Exp (Index2 i) Source

limitIndices :: (C array, C sh) => Exp Dim2 -> array sh Ix2 -> array sh Ix2 Source

shiftIndicesHoriz :: (C array, C sh) => Exp Size -> array sh Ix2 -> array sh Ix2 Source

shiftIndicesVert :: (C array, C sh) => Exp Size -> array sh Ix2 -> array sh Ix2 Source

type VecExp a v = Vec (Exp a) (Exp v) Source

rotateStretchMoveCoords :: (Storable a, C a, Real a, Field a, RationalConstant a, NativeFloating a ar) => Exp (a, a) -> Exp (a, a) -> Exp Dim2 -> SymbPlane (a, a) Source

inRange :: Comparison a => Exp a -> Exp a -> Exp Bool Source

inBox :: Comparison a => (Exp a, Exp a) -> (Exp a, Exp a) -> Exp Bool Source

rotateStretchMove :: (Storable a, C a, Real a, Field a, RationalConstant a, NativeFloating a ar, C v) => VecExp a v -> Exp (a, a) -> Exp (a, a) -> Exp Dim2 -> SymbPlane v -> SymbPlane (MaskBool, v) Source

rotateStretchMove rot mov first rotate and stretches the image according to rot and then moves the picture.

rotate :: (Storable a, C a, Real a, Field a, RationalConstant a, NativeFloating a ar, C v) => VecExp a v -> Exp (a, a) -> SymbPlane v -> SymbPlane v Source

brightnessPlane :: (C array, C size) => array size (YUV a) -> array size a Source

rowHistogram :: (C array, Additive a) => array Dim2 (YUV a) -> array Dim1 a Source

tailArr :: C array => array Dim1 a -> array Dim1 a Source

differentiate :: (C array, Additive a) => array Dim1 a -> array Dim1 a Source

the :: Array () a -> Exp a Source

fold1All :: (C sh, C a) => (Exp a -> Exp a -> Exp a) -> Array sh a -> Exp a Source

nestM :: Monad m => Int -> (a -> m a) -> a -> m a Source

pad :: C a => Exp a -> Exp Dim2 -> SymbPlane a -> SymbPlane a Source

padCArray :: Storable a => a -> (Int, Int) -> CArray (Int, Int) a -> CArray (Int, Int) a Source

clipCArray :: Storable a => (Int, Int) -> CArray (Int, Int) a -> CArray (Int, Int) a Source

mapPairInt :: (Integral i, Integral j) => (i, i) -> (j, j) Source

correlatePaddedCArray :: FFTWReal a => (Int, Int) -> CArray (Int, Int) a -> CArray (Int, Int) a -> CArray (Int, Int) a Source

Should be yet a little bit more efficient than correlatePaddedComplexCArray since it uses a real back transform.

liftCArray2 :: Storable a => (CArray (Int, Int) a -> CArray (Int, Int) a -> CArray (Int, Int) a) -> Plane a -> Plane a -> IO (Plane a) Source

type Id a = a -> a Source

minimumOverlapScores :: (Select a, PseudoRing a, IntegerConstant a, Real a) => ((Exp Size, Exp Size) -> Exp a -> Exp a) -> Exp Size -> (Exp Size, Exp Size) -> (Exp Size, Exp Size) -> SymbPlane (a, (Size, Size)) -> SymbPlane (a, (Size, Size)) Source

Set all scores to zero within a certain border. Otherwise the matching algorithm will try to match strong bars at the borders that are actually digitalization artifacts.

argmax :: (Comparison a, Select a, Select b) => Exp (a, b) -> Exp (a, b) -> Exp (a, b) Source

argmaximum :: (C sh, Comparison a, Select a, Select b) => Array sh (a, b) -> Exp (a, b) Source

clip :: C a => (Exp Size, Exp Size) -> (Exp Size, Exp Size) -> SymbPlane a -> SymbPlane a Source

overlappingArea :: (Ord a, Num a) => Shape2 a -> Shape2 a -> (a, a) -> ((a, a), (a, a), (a, a)) Source

diffAbs :: Real a => Exp a -> Exp a -> Exp a Source

maybePlus :: C a => (Exp a -> Exp a -> Exp a) -> Exp (Bool, a) -> Exp (Bool, a) -> Exp (Bool, a) Source

maskedMinimum :: (C sh, C array, Real a) => array (sh, SmallSize) (Bool, a) -> array sh (Bool, a) Source

generate :: C sh => Exp sh -> (Exp (Index sh) -> Exp b) -> Array sh b Source

distanceMapBox :: (Field a, NativeFloating a ar, Real a, RationalConstant a) => Exp Dim2 -> Exp (Geometry a) -> SymbPlane (Bool, (((a, (a, a)), (a, (a, a))), ((a, (a, a)), (a, (a, a))))) Source

outerProduct :: (C sha, C shb, C array) => (Exp a -> Exp b -> Exp c) -> array sha a -> array shb b -> array (sha, shb) c Source

separateDistanceMap :: (C array, C sh, C a) => array sh (bool, ((a, a), (a, a))) -> array (sh, SmallSize) (bool, a) Source

containedAnywhere :: (C array, C sh, Field a, NativeFloating a ar, Real a, RationalConstant a) => array SmallSize (Geometry a) -> array sh (a, a) -> array sh Bool Source

distanceMapPoints :: (C sh, C array, Real a, Algebraic a, IntegerConstant a) => array sh (a, a) -> array SmallSize (a, a) -> array sh a Source

distanceMap :: (Algebraic a, Real a, RationalConstant a, NativeFloating a ar) => Exp Dim2 -> Exp (Geometry a) -> Array SmallSize (Geometry a) -> Array SmallSize (a, a) -> SymbPlane a Source

For every pixel it computes the distance to the closest point on the image part boundary which lies in any other image. The rationale is that we want to fade an image out, wherever is another image that can take over. Such a closest point can either be a perpendicular point at one of the image edges, or it can be an image corner or an intersection between this image border and another image border. The first kind of points is computed by distanceMapContained and the second kind by distanceMapPoints. We simply compute the distances to all special points and chose the minimal distance.

pow :: (Repr Value a ~ Value ar, IsFloating ar, TranscendentalConstant ar) => Exp a -> Exp a -> Exp a Source

addToWeightedCanvas :: (PseudoRing a, NativeFloating a ar) => VecExp a v -> SymbPlane (a, v) -> SymbPlane (a, v) -> SymbPlane (a, v) Source

main :: IO () Source