HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleJuicyPixels-3.3.8Haskell2010

Codec.Picture.Jpg.Internal.Types

A good explanation of the JPEG format, including diagrams, is given at: https://github.com/corkami/formats/blob/master/image/jpeg.md

The full spec (excluding EXIF): https://www.w3.org/Graphics/JPEG/itu-t81.pdf

  • 19 types
  • 13 values
  • PackageJuicyPixels-3.3.8
  • Exports33
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTypes.hs
typetype DcCoefficient = Int16
#

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

datadata JpgImage
#

Constructors

Instances6Eq, Show, Generic, NFData, Binary, Rep
datadata JpgComponent
#
Instances7Eq, Show, Generic, NFData, Binary, SizeCalculable, …
datadata JpgFrameHeader
#
Instances7Eq, Show, Generic, NFData, Binary, SizeCalculable, …
datadata JpgFrame
#
Instances5Eq, Show, Generic, NFData, Rep
datadata JpgFrameKind
#
Instances6Eq, Show, Generic, NFData, Binary, Rep
datadata JpgScanHeader
#
Instances7Eq, Show, Generic, NFData, Binary, SizeCalculable, …
datadata JpgQuantTableSpec
#

Constructors

Instances7Eq, Show, Generic, NFData, Binary, SizeCalculable, …
datadata JpgHuffmanTableSpec
#

Constructors

Instances7Eq, Show, Generic, NFData, Binary, SizeCalculable, …
datadata JpgScanSpecification
#
Instances7Eq, Show, Generic, NFData, Binary, SizeCalculable, …
datadata JpgColorSpace
#
Instances5Eq, Show, Generic, NFData, Rep
datadata AdobeTransform
#

Constructors

Instances6Eq, Show, Generic, NFData, Binary, Rep
datadata JpgAdobeApp14
#
Instances6Eq, Show, Generic, NFData, Binary, Rep
datadata JpgJFIFApp0
#
Instances6Eq, Show, Generic, NFData, Binary, Rep
datadata JFifUnit
#
Instances6Eq, Show, Generic, NFData, Binary, Rep
newtypenewtype TableList a
#

Type introduced only to avoid some typeclass overlapping problem

Constructors

Instances1Binary
  • (SizeCalculable a, Binary a) => Binary (TableList a)Defined in JuicyPixels-3.3.8 · Codec.Picture.Jpg.Internal.Types
valueparseECS :: Get ByteString
#

Parses a Scan's ECS (Entropy-Coded Segment, the largest part of compressed image data) from the Get stream.

When this function is called, the parser's offset should be immediately behind the SOS tag.

As described on e.g. https://www.ccoderun.ca/programming/2017-01-31_jpeg/,

To find the next segment after the SOS, you must keep reading until you
find a 0xFF bytes which is not immediately followed by 0x00 (see "byte stuffing")
[or a reset marker's byte: 0xD0 through 0xD7].
Normally, this will be the EOI segment that comes at the end of the file.

where the 0xFF is the next segment's marker. See https://github.com/corkami/formats/blob/master/image/jpeg.md#entropy-coded-segment for more details.

This function returns the ECS, not including the next segment's marker on its trailing end.