repa-v4l2 0.1.0.0 → 0.2.0.0
raw patch · 2 files changed
+8/−11 lines, 2 filesdep ~repa
Dependency ranges changed: repa
Files
repa-v4l2.cabal view
@@ -7,7 +7,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.1.0.0+Version: 0.2.0.0 -- A short (one-line) description of the package. Synopsis: Provides high-level access to webcams.@@ -18,9 +18,6 @@ image processing functions and other input devices may be added. If anyone wants to help, please contact me! - It has been pointed out on haskell-cafe that the v4l2 package that- is needed by this package is not (yet?) on hackage. Therefore- this library is not building on hackage. -- The license under which the package is released. License: LGPL@@ -66,11 +63,11 @@ -- Modules exported by the library. Exposed-modules: Graphics.Webcam.Linux Other-modules: Graphics.Webcam.Linux.Internal- ghc-options: -fllvm + ghc-options: -Odph -fno-liberate-case -funfolding-use-threshold1000 -funfolding-keeness-factor1000 -fllvm -optlo-O3 -- Packages needed in order to build this package. Build-depends: base == 4.*,- repa >= 3.0,+ repa >= 3.2.1.1, --repa-devil >= 0.1.2, transformers >= 0.2.2, containers >= 0.2,@@ -87,7 +84,7 @@ Executable example main-is: example.hs- ghc-options: -fllvm -threaded+ ghc-options: -threaded -rtsopts -Odph -fno-liberate-case -funfolding-use-threshold1000 -funfolding-keeness-factor1000 -fllvm -optlo-O3 build-depends: gloss >= 1.7.2.1, repa-v4l2 >= 0.1, base == 4.*,
src/Graphics/Webcam/Linux/Internal.hs view
@@ -134,7 +134,7 @@ {-| Save the given 'Image' as BMP in the file with the given name. This function currently takes a detour via lists when converting the image to a 'ByteString', and is therefore probably slower than necessary (FIXME). -}-saveBmp :: (MonadIO m, Repr r Word8) => FilePath -> Image r Word8 -> V4lCamT m ()+saveBmp :: (MonadIO m, Source r Word8) => FilePath -> Image r Word8 -> V4lCamT m () saveBmp name i = do -- This does not compile; why not? Fill instances missing in Repa? -- a <- liftIO $ ((copyP i :: IO (Image B Word8)) >>=@@ -326,12 +326,12 @@ {-| Flips the Y axis of a given image. -}-flipY :: Repr r a => Image r a -> Image D a+flipY :: Source r a => Image r a -> Image D a flipY i = backpermute sh (\(Z :. y :. x :. j) -> Z :. h - 1 - y :. x :. j) i where sh@(Z :. h :. w :. k) = extent i -rgbaToAbgr :: Repr r a => Image r a -> Image D a+rgbaToAbgr :: Source r a => Image r a -> Image D a rgbaToAbgr i = backpermute sh (\(Z :. y :. x :. j) -> Z :. y :. x :. (k - 1 - j)) i where sh@(Z :. h :. w :. k) = extent i {-# INLINE rgbaToAbgr #-}@@ -339,7 +339,7 @@ {- FIXME: To make things faster, put swapping RGBA directly in here. -} {-| Converts a RGB image from the camera to an RGBA image that can e.g. be stored as BMP with 'saveBMP'. -}-rgbToRgba :: Num a => Repr r a => Image r a -> Image D a+rgbToRgba :: Num a => Source r a => Image r a -> Image D a rgbToRgba src | k == 3 = flipY $ traverse src shf f | k == 4 = delay src | otherwise = error "Could not convert image to rgba"