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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Codec.Picture.Jpg.Internal.Types

Synopsis

- type MutableMacroBlock s a = STVector s a
- createEmptyMutableMacroBlock :: (Storable a, Num a) => ST s (MutableMacroBlock s a)
- printMacroBlock :: (Storable a, PrintfArg a) => MutableMacroBlock s a -> ST s String
- printPureMacroBlock :: (Storable a, PrintfArg a) => MacroBlock a -> String
- type DcCoefficient = Int16
- data JpgImage = JpgImage {
  - jpgFrame :: [JpgFrame]
  }
- data JpgComponent = JpgComponent {
  - componentIdentifier :: !Word8
  - horizontalSamplingFactor :: !Word8
  - verticalSamplingFactor :: !Word8
  - quantizationTableDest :: !Word8
  }
- data JpgFrameHeader = JpgFrameHeader {
  - jpgFrameHeaderLength :: !Word16
  - jpgSamplePrecision :: !Word8
  - jpgHeight :: !Word16
  - jpgWidth :: !Word16
  - jpgImageComponentCount :: !Word8
  - jpgComponents :: ![JpgComponent]
  }
- data JpgFrame
  - = JpgAppFrame !Word8 ByteString
  - | JpgAdobeAPP14 !JpgAdobeApp14
  - | JpgJFIF !JpgJFIFApp0
  - | JpgExif ![ImageFileDirectory]
  - | JpgExtension !Word8 ByteString
  - | JpgQuantTable ![JpgQuantTableSpec]
  - | JpgHuffmanTable ![(JpgHuffmanTableSpec, HuffmanPackedTree)]
  - | JpgScanBlob !JpgScanHeader !ByteString
  - | JpgScans !JpgFrameKind !JpgFrameHeader
  - | JpgIntervalRestart !Word16
- data JpgFrameKind
  - = JpgBaselineDCTHuffman
  - | JpgExtendedSequentialDCTHuffman
  - | JpgProgressiveDCTHuffman
  - | JpgLosslessHuffman
  - | JpgDifferentialSequentialDCTHuffman
  - | JpgDifferentialProgressiveDCTHuffman
  - | JpgDifferentialLosslessHuffman
  - | JpgExtendedSequentialArithmetic
  - | JpgProgressiveDCTArithmetic
  - | JpgLosslessArithmetic
  - | JpgDifferentialSequentialDCTArithmetic
  - | JpgDifferentialProgressiveDCTArithmetic
  - | JpgDifferentialLosslessArithmetic
  - | JpgQuantizationTable
  - | JpgHuffmanTableMarker
  - | JpgStartOfScan
  - | JpgEndOfImage
  - | JpgAppSegment Word8
  - | JpgExtensionSegment Word8
  - | JpgRestartInterval
  - | JpgRestartIntervalEnd Word8
- data JpgScanHeader = JpgScanHeader {
  - scanLength :: !Word16
  - scanComponentCount :: !Word8
  - scans :: [JpgScanSpecification]
  - spectralSelection :: (Word8, Word8)
  - successiveApproxHigh :: !Word8
  - successiveApproxLow :: !Word8
  }
- data JpgQuantTableSpec = JpgQuantTableSpec {
  - quantPrecision :: !Word8
  - quantDestination :: !Word8
  - quantTable :: MacroBlock Int16
  }
- data JpgHuffmanTableSpec = JpgHuffmanTableSpec {
  - huffmanTableClass :: !DctComponent
  - huffmanTableDest :: !Word8
  - huffSizes :: !(Vector Word8)
  - huffCodes :: !(Vector (Vector Word8))
  }
- data JpgImageKind
  - = BaseLineDCT
  - | ProgressiveDCT
- data JpgScanSpecification = JpgScanSpecification {
  - componentSelector :: !Word8
  - dcEntropyCodingTable :: !Word8
  - acEntropyCodingTable :: !Word8
  }
- data JpgColorSpace
  - = JpgColorSpaceYCbCr
  - | JpgColorSpaceYCC
  - | JpgColorSpaceY
  - | JpgColorSpaceYA
  - | JpgColorSpaceYCCA
  - | JpgColorSpaceYCCK
  - | JpgColorSpaceCMYK
  - | JpgColorSpaceRGB
  - | JpgColorSpaceRGBA
- data AdobeTransform
  - = AdobeUnknown
  - | AdobeYCbCr
  - | AdobeYCck
- data JpgAdobeApp14 = JpgAdobeApp14 {
  - _adobeDctVersion :: !Word16
  - _adobeFlag0 :: !Word16
  - _adobeFlag1 :: !Word16
  - _adobeTransform :: !AdobeTransform
  }
- data JpgJFIFApp0 = JpgJFIFApp0 {
  - _jfifUnit :: !JFifUnit
  - _jfifDpiX :: !Word16
  - _jfifDpiY :: !Word16
  - _jfifThumbnail :: !(Maybe Int)
  }
- data JFifUnit
  - = JFifUnitUnknown
  - | JFifPixelsPerInch
  - | JFifPixelsPerCentimeter
- calculateSize :: SizeCalculable a => a -> Int
- dctBlockSize :: Num a => a

# Documentation

type MutableMacroBlock s a = STVector s a Source #

Macroblock that can be transformed.

createEmptyMutableMacroBlock :: (Storable a, Num a) => ST s (MutableMacroBlock s a) Source #

Create a new macroblock with the good array size

printMacroBlock :: (Storable a, PrintfArg a) => MutableMacroBlock s a -> ST s String Source #

printPureMacroBlock :: (Storable a, PrintfArg a) => MacroBlock a -> String Source #

type DcCoefficient = Int16 Source #

Type only used to make clear what kind of integer we are carrying Might be transformed into newtype in the future

data JpgImage Source #

Constructors

JpgImage |

Fields

- jpgFrame :: [JpgFrame]

#### Instances

Instances details

Show JpgImage Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JpgImage -> ShowS Source # show :: JpgImage -> String Source # showList :: [JpgImage] -> ShowS Source #
Binary JpgImage Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JpgImage -> Put Source # get :: Get JpgImage Source # putList :: [JpgImage] -> Put Source #

data JpgComponent Source #

Constructors

JpgComponent |

Fields

- componentIdentifier :: !Word8
- horizontalSamplingFactor :: !Word8

  Stored with 4 bits

- verticalSamplingFactor :: !Word8

  Stored with 4 bits

- quantizationTableDest :: !Word8

#### Instances

Instances details

Show JpgComponent Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JpgComponent -> ShowS Source # show :: JpgComponent -> String Source # showList :: [JpgComponent] -> ShowS Source #
Binary JpgComponent Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JpgComponent -> Put Source # get :: Get JpgComponent Source # putList :: [JpgComponent] -> Put Source #

data JpgFrameHeader Source #

Constructors

JpgFrameHeader |

Fields

- jpgFrameHeaderLength :: !Word16
- jpgSamplePrecision :: !Word8
- jpgHeight :: !Word16
- jpgWidth :: !Word16
- jpgImageComponentCount :: !Word8
- jpgComponents :: ![JpgComponent]

#### Instances

Instances details

Show JpgFrameHeader Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JpgFrameHeader -> ShowS Source # show :: JpgFrameHeader -> String Source # showList :: [JpgFrameHeader] -> ShowS Source #
Binary JpgFrameHeader Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JpgFrameHeader -> Put Source # get :: Get JpgFrameHeader Source # putList :: [JpgFrameHeader] -> Put Source #

data JpgFrame Source #

Constructors

JpgAppFrame !Word8 ByteString |
JpgAdobeAPP14 !JpgAdobeApp14 |
JpgJFIF !JpgJFIFApp0 |
JpgExif ![ImageFileDirectory] |
JpgExtension !Word8 ByteString |
JpgQuantTable ![JpgQuantTableSpec] |
JpgHuffmanTable ![(JpgHuffmanTableSpec, HuffmanPackedTree)] |
JpgScanBlob !JpgScanHeader !ByteString |
JpgScans !JpgFrameKind !JpgFrameHeader |
JpgIntervalRestart !Word16 |

#### Instances

Instances details

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

data JpgFrameKind Source #

Constructors

JpgBaselineDCTHuffman |
JpgExtendedSequentialDCTHuffman |
JpgProgressiveDCTHuffman |
JpgLosslessHuffman |
JpgDifferentialSequentialDCTHuffman |
JpgDifferentialProgressiveDCTHuffman |
JpgDifferentialLosslessHuffman |
JpgExtendedSequentialArithmetic |
JpgProgressiveDCTArithmetic |
JpgLosslessArithmetic |
JpgDifferentialSequentialDCTArithmetic |
JpgDifferentialProgressiveDCTArithmetic |
JpgDifferentialLosslessArithmetic |
JpgQuantizationTable |
JpgHuffmanTableMarker |
JpgStartOfScan |
JpgEndOfImage |
JpgAppSegment Word8 |
JpgExtensionSegment Word8 |
JpgRestartInterval |
JpgRestartIntervalEnd Word8 |

#### Instances

Instances details

Show JpgFrameKind Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JpgFrameKind -> ShowS Source # show :: JpgFrameKind -> String Source # showList :: [JpgFrameKind] -> ShowS Source #
Binary JpgFrameKind Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JpgFrameKind -> Put Source # get :: Get JpgFrameKind Source # putList :: [JpgFrameKind] -> Put Source #
Eq JpgFrameKind Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods (==) :: JpgFrameKind -> JpgFrameKind -> Bool Source # (/=) :: JpgFrameKind -> JpgFrameKind -> Bool Source #

data JpgScanHeader Source #

Constructors

JpgScanHeader |

Fields

- scanLength :: !Word16
- scanComponentCount :: !Word8
- scans :: [JpgScanSpecification]
- spectralSelection :: (Word8, Word8)

  (begin, end)

- successiveApproxHigh :: !Word8

  Encoded as 4 bits

- successiveApproxLow :: !Word8

  Encoded as 4 bits

#### Instances

Instances details

Show JpgScanHeader Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JpgScanHeader -> ShowS Source # show :: JpgScanHeader -> String Source # showList :: [JpgScanHeader] -> ShowS Source #
Binary JpgScanHeader Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JpgScanHeader -> Put Source # get :: Get JpgScanHeader Source # putList :: [JpgScanHeader] -> Put Source #

data JpgQuantTableSpec Source #

Constructors

JpgQuantTableSpec |

Fields

- quantPrecision :: !Word8

  Stored on 4 bits

- quantDestination :: !Word8

  Stored on 4 bits

- quantTable :: MacroBlock Int16

#### Instances

Instances details

Show JpgQuantTableSpec Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JpgQuantTableSpec -> ShowS Source # show :: JpgQuantTableSpec -> String Source # showList :: [JpgQuantTableSpec] -> ShowS Source #
Binary JpgQuantTableSpec Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JpgQuantTableSpec -> Put Source # get :: Get JpgQuantTableSpec Source # putList :: [JpgQuantTableSpec] -> Put Source #

data JpgHuffmanTableSpec Source #

Constructors

JpgHuffmanTableSpec |

Fields

- huffmanTableClass :: !DctComponent

  0 : DC, 1 : AC, stored on 4 bits

- huffmanTableDest :: !Word8

  Stored on 4 bits

- huffSizes :: !(Vector Word8)
- huffCodes :: !(Vector (Vector Word8))

#### Instances

Instances details

Show JpgHuffmanTableSpec Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JpgHuffmanTableSpec -> ShowS Source # show :: JpgHuffmanTableSpec -> String Source # showList :: [JpgHuffmanTableSpec] -> ShowS Source #
Binary JpgHuffmanTableSpec Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JpgHuffmanTableSpec -> Put Source # get :: Get JpgHuffmanTableSpec Source # putList :: [JpgHuffmanTableSpec] -> Put Source #

data JpgImageKind Source #

Constructors

BaseLineDCT |
ProgressiveDCT |

data JpgScanSpecification Source #

Constructors

JpgScanSpecification |

Fields

- componentSelector :: !Word8
- dcEntropyCodingTable :: !Word8

  Encoded as 4 bits

- acEntropyCodingTable :: !Word8

  Encoded as 4 bits

#### Instances

Instances details

Show JpgScanSpecification Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JpgScanSpecification -> ShowS Source # show :: JpgScanSpecification -> String Source # showList :: [JpgScanSpecification] -> ShowS Source #
Binary JpgScanSpecification Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JpgScanSpecification -> Put Source # get :: Get JpgScanSpecification Source # putList :: [JpgScanSpecification] -> Put Source #

data JpgColorSpace Source #

Constructors

JpgColorSpaceYCbCr |
JpgColorSpaceYCC |
JpgColorSpaceY |
JpgColorSpaceYA |
JpgColorSpaceYCCA |
JpgColorSpaceYCCK |
JpgColorSpaceCMYK |
JpgColorSpaceRGB |
JpgColorSpaceRGBA |

#### Instances

Instances details

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

data AdobeTransform Source #

Constructors

AdobeUnknown | Value 0
AdobeYCbCr | value 1
AdobeYCck | value 2

#### Instances

Instances details

Show AdobeTransform Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> AdobeTransform -> ShowS Source # show :: AdobeTransform -> String Source # showList :: [AdobeTransform] -> ShowS Source #
Binary AdobeTransform Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: AdobeTransform -> Put Source # get :: Get AdobeTransform Source # putList :: [AdobeTransform] -> Put Source #

data JpgAdobeApp14 Source #

Constructors

JpgAdobeApp14 |

Fields

- _adobeDctVersion :: !Word16
- _adobeFlag0 :: !Word16
- _adobeFlag1 :: !Word16
- _adobeTransform :: !AdobeTransform

#### Instances

Instances details

Show JpgAdobeApp14 Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JpgAdobeApp14 -> ShowS Source # show :: JpgAdobeApp14 -> String Source # showList :: [JpgAdobeApp14] -> ShowS Source #
Binary JpgAdobeApp14 Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JpgAdobeApp14 -> Put Source # get :: Get JpgAdobeApp14 Source # putList :: [JpgAdobeApp14] -> Put Source #

data JpgJFIFApp0 Source #

Constructors

JpgJFIFApp0 |

Fields

- _jfifUnit :: !JFifUnit
- _jfifDpiX :: !Word16
- _jfifDpiY :: !Word16
- _jfifThumbnail :: !(Maybe Int)

#### Instances

Instances details

Show JpgJFIFApp0 Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JpgJFIFApp0 -> ShowS Source # show :: JpgJFIFApp0 -> String Source # showList :: [JpgJFIFApp0] -> ShowS Source #
Binary JpgJFIFApp0 Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JpgJFIFApp0 -> Put Source # get :: Get JpgJFIFApp0 Source # putList :: [JpgJFIFApp0] -> Put Source #

data JFifUnit Source #

Size: 1

Constructors

JFifUnitUnknown | 0
JFifPixelsPerInch | 1
JFifPixelsPerCentimeter | 2

#### Instances

Instances details

Show JFifUnit Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods showsPrec :: Int -> JFifUnit -> ShowS Source # show :: JFifUnit -> String Source # showList :: [JFifUnit] -> ShowS Source #
Binary JFifUnit Source # |
Instance details Defined in Codec.Picture.Jpg.Internal.Types Methods put :: JFifUnit -> Put Source # get :: Get JFifUnit Source # putList :: [JFifUnit] -> Put Source #

calculateSize :: SizeCalculable a => a -> Int Source #

dctBlockSize :: Num a => a Source #