netpbm 1.0.3 → 1.0.4
raw patch · 2 files changed
+32/−50 lines, 2 files
Files
- netpbm.cabal +2/−20
- src/Graphics/Netpbm.hs +30/−30
netpbm.cabal view
@@ -1,5 +1,5 @@ name: netpbm-version: 1.0.3+version: 1.0.4 license: MIT copyright: 2013 Niklas Hambüchen <mail@nh2.me> author: Niklas Hambüchen <mail@nh2.me>@@ -7,7 +7,7 @@ category: Codec, Graphics build-type: Simple stability: experimental-tested-With: GHC==7.4.2+tested-With: GHC==7.4.2, GHC==9.0.1 cabal-version: >= 1.10 homepage: https://github.com/nh2/haskell-netpbm bug-Reports: https://github.com/nh2/haskell-netpbm/issues@@ -18,24 +18,6 @@ All netpbm image formats are implemented (P1 - P6). . The current implementation parses PPM images at around 10 MB/s on a Core i5-2520M.- .- CHANGELOG- .- Version 1.0.3- .- * Package maintenance improvements only (base-4.5 excluded). See #3- .- Version 1.0.2- .- * Package maintenance improvements only.- .- Version 1.0.1- .- * Added required Vector imports necessary for deriving Unbox instances.- .- Version 1.0.0- .- * Use storable instead of unboxed vectors to allow easier integration with Ptr based APIs. extra-source-files: test/ppms/SIPI-16.ppm
src/Graphics/Netpbm.hs view
@@ -125,36 +125,6 @@ PgmPixelData16 v -> [ fromIntegral x | PgmPixel16 x <- S.toList v ] --- * Unbox instance for pixels------ Not used internally, but an Unbox instance might be convenient for users.--derivingUnbox "PpmPixelRGB8"- [t| PpmPixelRGB8 -> (Word8, Word8, Word8) |]- [| \ (PpmPixelRGB8 a b c) -> (a, b, c) |]- [| \ (a, b, c) -> PpmPixelRGB8 a b c |]--derivingUnbox "PpmPixelRGB16"- [t| PpmPixelRGB16 -> (Word16, Word16, Word16) |]- [| \ (PpmPixelRGB16 a b c) -> (a, b, c) |]- [| \ (a, b, c) -> PpmPixelRGB16 a b c |]--derivingUnbox "PbmPixel"- [t| PbmPixel -> Bool |]- [| \ (PbmPixel b) -> b |]- [| \ b -> PbmPixel b |]--derivingUnbox "PgmPixel8"- [t| PgmPixel8 -> Word8 |]- [| \ (PgmPixel8 x) -> x |]- [| \ x -> PgmPixel8 x |]--derivingUnbox "PgmPixel16"- [t| PgmPixel16 -> Word16 |]- [| \ (PgmPixel16 x) -> x |]- [| \ x -> PgmPixel16 x |]-- -- * Storable instance for pixels storePpmPixel8 :: Store.Dictionary PpmPixelRGB8@@ -545,3 +515,33 @@ Done rest images -> Right (images, Just rest) Partial _ -> error "parsePPM bug: Got a partial result after end of input" Fail _ cs e -> Left $ e ++ "; contexts: " ++ show cs+++-- * Unbox instance for pixels+--+-- Not used internally, but an Unbox instance might be convenient for users.++derivingUnbox "PpmPixelRGB8"+ [t| PpmPixelRGB8 -> (Word8, Word8, Word8) |]+ [| \ (PpmPixelRGB8 a b c) -> (a, b, c) |]+ [| \ (a, b, c) -> PpmPixelRGB8 a b c |]++derivingUnbox "PpmPixelRGB16"+ [t| PpmPixelRGB16 -> (Word16, Word16, Word16) |]+ [| \ (PpmPixelRGB16 a b c) -> (a, b, c) |]+ [| \ (a, b, c) -> PpmPixelRGB16 a b c |]++derivingUnbox "PbmPixel"+ [t| PbmPixel -> Bool |]+ [| \ (PbmPixel b) -> b |]+ [| \ b -> PbmPixel b |]++derivingUnbox "PgmPixel8"+ [t| PgmPixel8 -> Word8 |]+ [| \ (PgmPixel8 x) -> x |]+ [| \ x -> PgmPixel8 x |]++derivingUnbox "PgmPixel16"+ [t| PgmPixel16 -> Word16 |]+ [| \ (PgmPixel16 x) -> x |]+ [| \ x -> PgmPixel16 x |]