Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module used by the jpeg decoder internally, shouldn't be used in user code.
Synopsis
- data DctComponent
- data HuffmanTree
- type HuffmanTable = [[Word8]]
- type HuffmanPackedTree = Vector Word16
- type MacroBlock a = Vector a
- type QuantificationTable = MacroBlock Int16
- type HuffmanWriterCode = Vector (Word8, Word16)
- scaleQuantisationMatrix :: Int -> QuantificationTable -> QuantificationTable
- makeMacroBlock :: Storable a => [a] -> MacroBlock a
- makeInverseTable :: HuffmanTree -> HuffmanWriterCode
- buildHuffmanTree :: [[Word8]] -> HuffmanTree
- packHuffmanTree :: HuffmanTree -> HuffmanPackedTree
- huffmanPackedDecode :: HuffmanPackedTree -> BoolReader s Word8
- defaultChromaQuantizationTable :: QuantificationTable
- defaultLumaQuantizationTable :: QuantificationTable
- defaultAcChromaHuffmanTree :: HuffmanTree
- defaultAcChromaHuffmanTable :: HuffmanTable
- defaultAcLumaHuffmanTree :: HuffmanTree
- defaultAcLumaHuffmanTable :: HuffmanTable
- defaultDcChromaHuffmanTree :: HuffmanTree
- defaultDcChromaHuffmanTable :: HuffmanTable
- defaultDcLumaHuffmanTree :: HuffmanTree
- defaultDcLumaHuffmanTable :: HuffmanTable
Documentation
data DctComponent Source #
Enumeration used to search in the tables for different components.
Instances
Eq DctComponent Source # | |
Defined in Codec.Picture.Jpg.Internal.DefaultTable (==) :: DctComponent -> DctComponent -> Bool # (/=) :: DctComponent -> DctComponent -> Bool # | |
Show DctComponent Source # | |
Defined in Codec.Picture.Jpg.Internal.DefaultTable showsPrec :: Int -> DctComponent -> ShowS # show :: DctComponent -> String # showList :: [DctComponent] -> ShowS # |
data HuffmanTree Source #
Tree storing the code used for huffman encoding.
Branch HuffmanTree HuffmanTree | If bit is 0 take the first subtree, if 1, the right. |
Leaf Word8 | We should output the value |
Empty | no value present |
Instances
Eq HuffmanTree Source # | |
Defined in Codec.Picture.Jpg.Internal.DefaultTable (==) :: HuffmanTree -> HuffmanTree -> Bool # (/=) :: HuffmanTree -> HuffmanTree -> Bool # | |
Show HuffmanTree Source # | |
Defined in Codec.Picture.Jpg.Internal.DefaultTable showsPrec :: Int -> HuffmanTree -> ShowS # show :: HuffmanTree -> String # showList :: [HuffmanTree] -> ShowS # |
type HuffmanTable = [[Word8]] Source #
type HuffmanPackedTree = Vector Word16 Source #
type MacroBlock a = Vector a Source #
Represent a compact array of 8 * 8 values. The size is not guarenteed by type system, but if makeMacroBlock is used, everything should be fine size-wise
type QuantificationTable = MacroBlock Int16 Source #
makeMacroBlock :: Storable a => [a] -> MacroBlock a Source #
Helper function to create pure macro block of the good size.
buildHuffmanTree :: [[Word8]] -> HuffmanTree Source #
Transform parsed coefficients from the jpeg header to a tree which can be used to decode data.
huffmanPackedDecode :: HuffmanPackedTree -> BoolReader s Word8 Source #
defaultAcLumaHuffmanTable :: HuffmanTable Source #
From the Table K.5 of ITU-81 (p154)
defaultDcChromaHuffmanTable :: HuffmanTable Source #
From the Table K.4 of ITU-81 (p153)
defaultDcLumaHuffmanTable :: HuffmanTable Source #
From the Table K.3 of ITU-81 (p153)