-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A library for decoding JPEG files written in pure Haskell -- -- JPEG Decompression library @package jpeg @version 0.0.1 module Graphics.JPEG o :: (c -> d) -> (a -> b -> c) -> (a -> b -> d) type Table a = Int -> a subst :: (Eq a) => a -> b -> (a -> b) -> (a -> b) multi :: Int -> [a] -> [a] ceilDiv :: Int -> Int -> Int data PixelRGB PixelRGB :: !!Word8 -> !!Word8 -> !!Word8 -> PixelRGB red :: PixelRGB -> !!Word8 green :: PixelRGB -> !!Word8 blue :: PixelRGB -> !!Word8 sane :: Int -> Int yCbCr2RGB :: [Int8] -> PixelRGB type Dim = (Int, Int) type Mat a = [[a]] matapply :: (Num a) => Mat a -> [a] -> [a] inprod :: (Num a) => [a] -> [a] -> a matmap :: (a -> b) -> Mat a -> Mat b matconcat :: Mat (Mat a) -> Mat a matzip :: [Mat a] -> Mat [a] type Bits = [Bool] byte2bits :: Int -> Bits string2bits :: String -> Bits byte2nibs :: Int -> (Int, Int) data Tree a Nil :: Tree a Tip :: a -> Tree a Bin :: (Tree a) -> (Tree a) -> Tree a empty :: State [a] Bool item :: State [a] a peekitem :: State [a] a entropy :: State String String byte :: State String Int word :: State String Int nibbles :: State String (Int, Int) matrix :: (Monad m) => Dim -> m a -> m (Mat a) many :: (Monad (State [a])) => State [a] b -> State [a] [b] sf_uncur :: (b -> State a (b, c)) -> State (a, b) c sf_curry :: State (a, b) c -> b -> State a (b, c) build :: (Monad (State [(a, Int)])) => Int -> State [(a, Int)] (Tree a) huffmanTree :: (Monad (State [(a, Int)])) => [[a]] -> Tree a treeLookup :: Tree a -> State Bits a receive :: Int -> State Bits Int dcdecode :: Tree Int -> State Bits Int extend :: Int -> Int -> Int acdecode :: Tree (Int, Int) -> Int -> State Bits [Int] idct1 :: [Float] -> [Float] idct2 :: Mat Float -> Mat Float cosinuses :: Mat Float type QuaTab = [Int] dequant :: QuaTab -> [Int] -> Mat Int8 upsamp :: Dim -> Mat a -> Mat a zigzag :: [a] -> Mat a zigzag2 :: [a] -> Mat a type DataUnit = Mat Int8 type Picture = Mat PixelRGB type DataSpec = (Dim, QuaTab, Tree Int, Tree (Int, Int)) type MCUSpec = [(Dim, DataSpec)] dataunit :: DataSpec -> Int -> State Bits (Int, DataUnit) units :: Dim -> DataSpec -> State (Bits, Int) DataUnit units2 :: (Dim, DataSpec) -> Int -> State Bits (Int, DataUnit) mcu :: MCUSpec -> [Int -> State Bits (Int, DataUnit)] mcu2 :: MCUSpec -> [Int] -> [State Bits (Int, DataUnit)] mcu3 :: MCUSpec -> [Int] -> State Bits ([Int], [DataUnit]) mcu4 :: MCUSpec -> State (Bits, [Int]) Picture picture :: Dim -> MCUSpec -> State (Bits, [Int]) Picture type FrameCompo = (Int, Dim, Int) type ScanCompo = (Int, Int, Int) type QtabCompo = (Int, [Int]) type SOF = (Dim, [FrameCompo]) type DHT = (Int, Int, Tree Int) type SOS = ([ScanCompo], Bits) type DQT = [QtabCompo] type XXX = (Char, String) frameCompo :: State String (Int, (Int, Int), Int) scanCompo :: State String (Int, Int, Int) qtabCompo :: State String (Int, [Int]) sofSeg :: State String ((Int, Int), [(Int, (Int, Int), Int)]) dhtSeg :: State String (Int, Int, Tree Int) dqtSeg :: State String [(Int, [Int])] sosSeg :: State String ([(Int, Int, Int)], Bits) segment :: (SOF -> a, DHT -> a, DQT -> a, SOS -> a, XXX -> a) -> State String a type Huf = (Table (Tree Int), Table (Tree (Int, Int))) type Sof = (Dim, Table (Dim, QuaTab)) type Qua = Table QuaTab type State2 = (Sof, Huf, Qua, Picture) segments :: State String [State2 -> State2] errRes :: State2 evalSOF :: SOF -> State2 -> Sof evalDHT :: DHT -> State2 -> Huf evalDQT :: DQT -> State2 -> Qua evalSOS :: SOS -> State2 -> Picture jpegDecode :: String -> Picture ppmEncode :: Mat PixelRGB -> String rgbPixel2ppmChars :: PixelRGB -> String bmpEncode :: Mat PixelRGB -> String bmphead :: [[a]] -> String bmpline :: [PixelRGB] -> String bmpPad :: Int -> Int rgbPixel2bmpChars :: PixelRGB -> String wor :: Int -> String readBinFile :: String -> IO String writeBinFile :: String -> String -> IO () jpgFile2bmpFile :: String -> String -> IO () jpgFile2ppmFile :: String -> String -> IO () instance Functor Tree