JuicyPixels-3.3.9: Picture loading/serialization (in png, jpeg, bitmap, gif, tga, tiff and radiance)

Safe Haskell | None
Language | Haskell2010

Codec.Picture.Jpg.Internal.Common

Synopsis

- type DctCoefficients = DcCoefficient
- data JpgUnpackerParameter = JpgUnpackerParameter {
  - dcHuffmanTree :: !HuffmanPackedTree
  - acHuffmanTree :: !HuffmanPackedTree
  - componentIndex :: !Int
  - restartInterval :: !Int
  - componentWidth :: !Int
  - componentHeight :: !Int
  - subSampling :: !(Int, Int)
  - coefficientRange :: !(Int, Int)
  - successiveApprox :: !(Int, Int)
  - readerIndex :: !Int
  - indiceVector :: !Int
  - blockIndex :: !Int
  - blockMcuX :: !Int
  - blockMcuY :: !Int
  }
- decodeInt :: Int -> BoolReader s Int32
- dcCoefficientDecode :: HuffmanPackedTree -> BoolReader s DcCoefficient
- deQuantize :: MacroBlock Int16 -> MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16)
- decodeRrrrSsss :: HuffmanPackedTree -> BoolReader s (Int, Int)
- zigZagReorderForward :: Storable a => MutableMacroBlock s a -> MutableMacroBlock s a -> ST s (MutableMacroBlock s a)
- zigZagReorderForwardv :: (Storable a, Num a) => Vector a -> Vector a
- zigZagReorder :: MutableMacroBlock s Int16 -> MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16)
- inverseDirectCosineTransform :: MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16)
- unpackInt :: Int -> BoolReader s Int32
- unpackMacroBlock :: Int -> Int -> Int -> Int -> Int -> Int -> MutableImage s PixelYCbCr8 -> MutableMacroBlock s Int16 -> ST s ()
- rasterMap :: Monad m => Int -> Int -> (Int -> Int -> m ()) -> m ()
- decodeMacroBlock :: MacroBlock DctCoefficients -> MutableMacroBlock s Int16 -> MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16)
- decodeRestartInterval :: BoolReader s Int32
- toBlockSize :: Int -> Int

# Documentation

type DctCoefficients = DcCoefficient #

Same as for DcCoefficient, to provide nicer type signatures

data JpgUnpackerParameter #

Constructors

JpgUnpackerParameter |

Fields

- dcHuffmanTree :: !HuffmanPackedTree
- acHuffmanTree :: !HuffmanPackedTree
- componentIndex :: !Int
- restartInterval :: !Int
- componentWidth :: !Int
- componentHeight :: !Int
- subSampling :: !(Int, Int)
- coefficientRange :: !(Int, Int)
- successiveApprox :: !(Int, Int)
- readerIndex :: !Int
- indiceVector :: !Int

  When in progressive mode, we can have many color in a scan or only one. The indices changes on this fact, when mixed, there is whole MCU for all color components, spanning multiple block lines. With only one color component we use the normal raster order.

- blockIndex :: !Int
- blockMcuX :: !Int
- blockMcuY :: !Int

#### Instances

Instances details

Show JpgUnpackerParameter # |
Instance details Defined in Codec.Picture.Jpg.Internal.Common Methods showsPrec :: Int -> JpgUnpackerParameter -> ShowS # show :: JpgUnpackerParameter -> String # showList :: [JpgUnpackerParameter] -> ShowS #

decodeInt :: Int -> BoolReader s Int32 #

dcCoefficientDecode :: HuffmanPackedTree -> BoolReader s DcCoefficient #

deQuantize :: MacroBlock Int16 -> MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16) #

Apply a quantization matrix to a macroblock

decodeRrrrSsss :: HuffmanPackedTree -> BoolReader s (Int, Int) #

zigZagReorderForward :: Storable a => MutableMacroBlock s a -> MutableMacroBlock s a -> ST s (MutableMacroBlock s a) #

zigZagReorderForwardv :: (Storable a, Num a) => Vector a -> Vector a #

zigZagReorder :: MutableMacroBlock s Int16 -> MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16) #

inverseDirectCosineTransform :: MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16) #

unpackInt :: Int -> BoolReader s Int32 #

Unpack an int of the given size encoded from MSB to LSB.

unpackMacroBlock #

Arguments

:: Int | Component count
-> Int | Width coefficient
-> Int | Height coefficient
-> Int | Component index
-> Int | x
-> Int | y
-> MutableImage s PixelYCbCr8 |
-> MutableMacroBlock s Int16 |
-> ST s () |

Given a size coefficient (how much a pixel span horizontally and vertically), the position of the macroblock, return a list of indices and value to be stored in an array (like the final image)

rasterMap :: Monad m => Int -> Int -> (Int -> Int -> m ()) -> m () #

decodeMacroBlock :: MacroBlock DctCoefficients -> MutableMacroBlock s Int16 -> MutableMacroBlock s Int16 -> ST s (MutableMacroBlock s Int16) #

This is one of the most important function of the decoding, it form the barebone decoding pipeline for macroblock. It's all there is to know for macro block transformation

decodeRestartInterval :: BoolReader s Int32 #

toBlockSize :: Int -> Int #