raphaelj / repa-devil Goto Github PK
View Code? Open in Web Editor NEWImage library based on the DevIL open source image library for the repa array library.
License: BSD 3-Clause "New" or "Revised" License
Image library based on the DevIL open source image library for the repa array library.
License: BSD 3-Clause "New" or "Revised" License
Support for image reading and writing of Repa arrays using in-place FFI calls The repa-image library adds support for reading and writing images in many formats based on the DevIL open source image library. Image data is represented in Haskell as typed, multi-dimensional repa arrays. Developer's Image Library (DevIL) is a library to develop applications with very powerful image loading capabilities, yet with a relatively simple interface. DevIL can load, save, convert, manipulate, filter and display a wide variety of image formats, including: BMP, ICO, JPG, PNG, PNM, TGA, TIF, GIF, EXIF and many more. References: * <http://hackage.haskell.org/package/repa> * <http://openil.sourceforge.net/> * <http://www.haskell.org/haskellwiki/Numeric_Haskell:_A_Repa_Tutorial>
Subset of the output:
Unpacking to repa-devil-0.3.2.3/
Resolving dependencies...
Configuring repa-devil-0.3.2.3...
Building repa-devil-0.3.2.3...
Preprocessing library repa-devil-0.3.2.3...
[1 of 1] Compiling Data.Array.Repa.IO.DevIL ( dist/build/Data/Array/Repa/IO/DevIL.hs, dist/build/Data/Array/Repa/IO/DevIL.o )
Data/Array/Repa/IO/DevIL.hsc:92:40:
Not in scope: type constructor or class ‘Applicative’
Data/Array/Repa/IO/DevIL.hsc:180:24: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:212:31: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:217:17: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:220:18: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:223:17: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:226:18: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:229:18: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:232:18: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:247:27: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:261:15: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:266:15: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:271:15: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:276:15: Not in scope: ‘<$>’
Data/Array/Repa/IO/DevIL.hsc:281:15: Not in scope: ‘<$>’
I know this package is deprecated, but I have some old code that uses it that I want to keep working.
My code (and repa-devil
) compiles and works correctly with cabal new-install -w ghc-8.6.1 --allow-newer=transformers
, so I suspect the dependency bound can simply be lifted, suggest transformers >= 0.2 && < 0.6
It could be fixed by a metadata revision on Hackage (no need to upload a whole new version).
Hi! Would it be possible to read and save multichannel images using DevIL or ResIL (http://resil.sourceforge.net/) Haskell binding? I want to read .exr images, which has over a 100 of channels.
Thank you.
If I open a greyscale tga and then write it back out without doing anything, the image is not nearly then same. The pixels are interleaved in some odd way, and it doesn't look anything like the original
This is needed for GHC 7.10 support.
This question relates to the dimensions in the five constructors:
RGBA (Array F DIM3 Word8)
RGB (Array F DIM3 Word8)
BGRA (Array F DIM3 Word8)
BGR (Array F DIM3 Word8)
Grey (Array F DIM2 Word8)
Only the Grey
constructor has a two dimensional array type parameter DIM2
, the rest take a three dimensional array DIM3
. Here are the sources for repa-examples:
https://github.com/DDCSF/repa/tree/master/repa-examples
Many of the repa examples operate on two dimensional arrays, for example:
blur :: Monad m => Int -> Array U DIM2 Double -> m (Array U DIM2 Double)
gradientX_sep :: Array DIM2 Float -> Array DIM2 Float
blurSepX :: Array U DIM2 Float -> IO (Array U DIM2 Float)
solveLaplace
:: Monad m
=> Int -- ^ Number of iterations to use.
-> Array U DIM2 Double -- ^ Boundary value mask.
-> Array U DIM2 Double -- ^ Boundary values.
-> Array U DIM2 Double -- ^ Initial state.
-> m (Array U DIM2 Double)
And so on... Does this mean that all the repa examples can only operate on DIM2
greyscale images? Or does this imply a separation between the use of repa dimensions in devil-repa (colour images are DIM3
) and repa-examples (images are DIM2
).
When I tried to compile a Haskell package importing repa-devil on Windows it gave linking errors complaining about undefined references to IL functions such as:
Linking dist\build\test\test.exe ...
dist\build\shapes\test-tmp\Main.o:fake:(.text+0x71900): undefined reference to `ilInit'
dist\build\shapes\test-tmp\Main.o:fake:(.text+0x71910): undefined reference to `ilOriginFunc'
I was able to fix it by replacing all foreign import ccall calling conventions by stdcall, eg.
foreign import ccall unsafe "ilInit" ilInitC :: IO ()
by
foreign import stdcall unsafe "ilInit" ilInitC :: IO ()
After reinstalling such a modified repa-devil I can read and write PNG images etc.
This is my setup:
A small Haskell program which triggers the error:
module Main where
import Data.Array.Repa.IO.DevIL
main = runIL $ do
(RGB im) <- readImage "blah.png"
return ()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.