ibZ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY  Safe-InferredFContains the XYZ coordinates of a specific color in a specified color  space. ZZ Safe-Inferred  [  [ Safe-Inferred 2Things that can go wrong when loading a BMP file. %Something went wrong in the library. 5Mismatch between the image size stated in the header 8 and that which is calculuated from the other fields. $We only handle uncompressed images. %We only handle 24 and 32 bit images. $We only handle single color planes. 7We handle V3 V4 and V5 image headers, but the size of 2 the header indicates it has some other format. 7The offset to the image data from the file header doesn't  point anywhere sensible.  Reserved fields should be zero. -File is too short to contain the image data. .File is too short to contain an image header. ,File is too short to contain a file header. 0Magic number was not at the start of the file,  so this probably isn't a BMP file.        None!7Device Independent Bitmap (DIB) header for Windows V3. #)(+0) Size of the image header, in bytes. $$(+4) Width of the image, in pixels. %%(+8) Height of the image, in pixels. &(+12) Number of color planes. ' (+14) Number of bits per pixel. ((+16) Image compression mode. )(+20) Size of raw image data. D Some encoders set this to zero, so we need to calculate it based  on the overall file size. BIf it is non-zero then we check it matches the file size - header  size. *A(+24) Prefered resolution in pixels per meter, along the X axis. +A(+28) Prefered resolution in pixels per meter, along the Y axis. ,-(+32) Number of color entries that are used. -$(+36) Number of significant colors. \Size of ! header (in bytes) ]7Check headers for problems and unsupported features. ^4Compute the size of the image data from the header.  We can't just use the ) field because some encoders  set this to zero.  We also can'8t use the physical size of the data in the file because 9 some encoders add zero padding bytes on the end. !"#$%&'()*+,-\]^_ !"#$%&'()*+,-\]^! "#$%&'()*+,-\]^_None .BMP file header. 0(+0) Magic numbers 0x42 0x4d 1!(+2) Size of the file, in bytes. 2(+6) Reserved, must be zero. 3(+8) Reserved, must be zero. 46(+10) Offset in bytes to the start of the pixel data. `"Size of a file header (in bytes). a:Magic number that should come at the start of a BMP file. b;Check a file header for problems and unsupported features. ./01234`abc ./01234`ab./01234`abcNone 5EDevice Independent Bitmap (DIB) header for Windows V4 (95 and newer) 7$Size of the image header, in bytes. 8.Color masks specify components of each pixel. 2 Only used with the bitfields compression mode. <#The color space used by the image. =@Specifies the XYZ coords of the three colors that correspond to E the RGB endpoints for the logical color space associated with the G bitmap. Only used when ColorSpaceType specifies a calibrated image. >+Toned response curves for each component. C Only used when the ColorSpaceType specifies a calibrated image. dSize of 5 header (in bytes) e7Check headers for problems and unsupported features. E With a V4 header we support both the uncompressed 24bit RGB format, ) and the uncompressed 32bit RGBA format. f4Compute the size of the image data from the header.  We can't just use the ) field because some encoders  set this to zero.  We also can'9t use the physical size of the data in the file because 9 some encoders add zero padding bytes on the end. 56789:;<=>?@defg56789:;<=>?@def5 6789:;<=>?@defgNoneA9Device Independent Bitmap (DIB) header for Windows V5 (98/2000 and newer) D!Rendering intent for the bitmap. E@Offset (in bytes) from the beginning of the header to the start  of the profile data. F*Size (in bytes) of embedded profile data. GReserved, should be zero. hSize of A header (in bytes) i7Check headers for problems and unsupported features.  The V5 header doesn'0t give us any more useful info than the V4 one. j4Compute the size of the image data from the header. ABCDEFGhijk ABCDEFGhijABCDEFGhijk NoneH.A wrapper for the various image header types. lGet the common ! structure from a H HIJKlmHIJKlHKJIlm NoneL A BMP image. C For an uncompressed image, the image data contains triples of BGR L component values. Each line may also have zero pad values on the end, ; to bring them up to a multiple of 4 bytes in length. LMNOPLMNOPLMNOP NoneQ9Unpack a BMP image to a string of RGBA component values. n>Unpack raw, uncompressed 24 bit BMP image data to a string of  RGBA component values. 3The alpha component is set to 255 for every pixel. o>Unpack raw, uncompressed 32 bit BMP image data to a string of  RGBA component values. N Note in the BMP file the components are arse-around ABGR instead of RGBA.  The  unpacking5 here is really just flipping the components around. QnpoqQQnpoq NoneR9Pack a string of RGBA component values into a BMP image.  If the given dimensions don't match the input string then r. D This currently ignores the alpha component of the input string and " produces a 24bit RGB image. RWidth of image. Height of image. #A string of RGBA component values.  Must have length (width * height * 4) sWidth of image. Height of image. tRRstNoneSRead a BMP from a file. K The file is checked for problems and unsupported features when read. / If there is anything wrong this gives an   instead. T$Get a BMP image from a file handle. UParse a BMP image from a lazy u V Wrapper for W W"Put a BMP image to a file handle. XRender a BMP image to a lazy u. Y&Get the width and height of an image.  It'Cs better to use this function than to access the headers directly. STUvwxVWXYZ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZLMNOP./01234HKJI!"#$%&'()*+,-56789:;<=>?@ABCDEFG    STUVWXRQY STUvwxVWXYy   !"#$%&'()*+,--./01234567899:;<=>??@ABCDEFGHIJJKLMNO P Q R S T T U V W X YZ[\]^_`abcdefghijklmnopqr s t u v w xyz{ | }~ bmp-1.2.3.2 Codec.BMPCodec.BMP.CIEXYZCodec.BMP.CompressionCodec.BMP.ErrorCodec.BMP.BitmapInfoV3Codec.BMP.FileHeaderCodec.BMP.BitmapInfoV4Codec.BMP.BitmapInfoV5Codec.BMP.BitmapInfoCodec.BMP.BaseCodec.BMP.UnpackCodec.BMP.PackCIEXYZ CompressionCompressionUnknownCompressionPNGCompressionJPEGCompressionBitFieldsCompressionRLE4CompressionRLE8CompressionRGBErrorErrorInternalErrorPleaseReportErrorImagePhysicalSizeMismatcherrorImageSizeFromHeadererrorImageSizeOfBufferErrorUnhandledCompressionModeerrorCompressionErrorUnhandledColorDeptherrorColorDepthErrorUnhandledPlanesCounterrorPlanesCountErrorUnhandledBitmapHeaderSizeerrorBitmapHeaderSizeErrorDodgyFileHeaderFieldOffseterrorFileHeaderOffsetErrorReservedFieldNotZeroErrorImageDataTruncatederrorBytesNeedederrorBytesAvailableErrorImageHeaderTruncatedErrorFileHeaderTruncated ErrorBadMagic errorMagic BitmapInfoV3dib3Size dib3Width dib3Height dib3Planes dib3BitCountdib3Compression dib3ImageSizedib3PelsPerMeterXdib3PelsPerMeterYdib3ColorsUseddib3ColorsImportant FileHeaderfileHeaderTypefileHeaderFileSizefileHeaderReserved1fileHeaderReserved2fileHeaderOffset BitmapInfoV4 dib4InfoV3 dib4RedMask dib4GreenMask dib4BlueMask dib4AlphaMaskdib4ColorSpaceType dib4Endpoints dib4GammaReddib4GammaGreen dib4GammaBlue BitmapInfoV5 dib5InfoV4 dib5Intentdib5ProfileDatadib5ProfileSize dib5Reserved BitmapInfoInfoV5InfoV4InfoV3BMP bmpFileHeader bmpBitmapInfobmpRawImageDataunpackBMPToRGBA32packRGBA32ToBMPreadBMPhGetBMPparseBMPwriteBMPhPutBMP renderBMP bmpDimensions$fBinaryCIEXYZ$fBinaryCompressionsizeOfBitmapInfoV3checkBitmapInfoV3imageSizeFromBitmapInfoV3$fBinaryBitmapInfoV3sizeOfFileHeaderbmpMagiccheckFileHeader$fBinaryFileHeadersizeOfBitmapInfoV4checkBitmapInfoV4imageSizeFromBitmapInfoV4$fBinaryBitmapInfoV4sizeOfBitmapInfoV5checkBitmapInfoV5imageSizeFromBitmapInfoV5$fBinaryBitmapInfoV5getBitmapInfoV3$fBinaryBitmapInfopackRGB24ToRGBA32packRGB32ToRGBA32packRGB24ToRGBA32'packRGB32ToRGBA32'baseGHC.ErrerrorpackRGBA32ToRGB24packRGBA32ToRGB24'bytestring-0.10.0.0Data.ByteString.Internal ByteString parseBMP2 parseBMP3 parseBMP4