úÎ.#+61      !"#$%&'()*+,-./02Things that can go wrong when loading a BMP file.     7Device Independent Bitmap (DIB) header for Windows V3. $Size of the image header, in bytes. Width of the image, in pixels.  Height of the image, in pixels. Number of color planes. Number of bits per pixel. *Image compression mode. 0 = uncompressed. Size of raw image data. ;Prefered resolution in pixels per meter, along the X axis. ;Prefered resolution in pixels per meter, along the Y axis. 'Number of color entries that are used. Number of significant colors.  A wrapper for the bitmap info, > in case we want to support other header types in the future. 1Size of  header (in bytes) 27Check headers for problems and unsupported features. 12 12 BMP file header.  Magic numbers 0x42 0x4d !Size of the file, in bytes. "Reserved, must be zero. #Reserved, must be zero. $0Offset in bytes to the start of the pixel data. 3"Size of a file header (in bytes). 4:Magic number that should come at the start of a BMP file. 5;Check a file header for problems and unsupported features.  !"#$345  !"#$ !"#$345% A BMP image. U For an uncompressed image, the image data contains triples of BGR component values. T Each line may also have zero pad values on the end, to bring them up to a multiple  of 4 bytes in length. &'()%&'()%&'()&'()*9Unpack a BMP image to a string of RGBA component values. 4 The alpha component is set to 255 for every pixel. 6UUnpack raw, uncompressed 24 bit BMP image data to a string of RGBA component values. 4 The alpha component is set to 255 for every pixel. **+9Pack a string of RGBA component values into a BMP image. " The alpha component is ignored.  If the given dimensions don't match the input string then 7. Width of image. Height of image. 5A string of RGBA component values. Must have length (width * height * 4) 8Width of image. Height of image. ++, Wrapper for - -$Get a BMP image from a file handle. F The file is checked for problems and unsupported features when read. * If there is anything wrong this gives an  instead. . Wrapper for / /"Put a BMP image to a file handle. N The size of the provided image data is checked against the given dimensions.  If these don' t match then 7. 0&Get the width and height of an image.  It'Cs better to use this function than to access the headers directly. 1  !"#$%&'()*+,-./01%&'() !"#$ ,.-/+*0,-./09      !"#$%%&'()*++,-./0123456789:;<=>?@ bmp-1.0.0.0 Codec.BMPCodec.BMP.ErrorCodec.BMP.BitmapInfoCodec.BMP.FileHeaderCodec.BMP.BaseCodec.BMP.UnpackCodec.BMP.PackErrorErrorLacksWholeNumberOfLinesErrorZeroImageSizeErrorUnhandledCompressionModeErrorUnhandledColorDepthErrorUnhandledPlanesCountErrorUnhandledBitmapHeaderSizeErrorFileIsTruncated!ErrorDodgyFileHeaderFieldFileSizeErrorDodgyFileHeaderFieldOffsetErrorReservedFieldNotZero ErrorBadMagicErrorReadOfImageDataFailedErrorReadOfImageHeaderFailedErrorReadOfFileHeaderFailed BitmapInfoV3dib3Size dib3Width dib3Height dib3Planes dib3BitCountdib3Compression dib3ImageSizedib3PelsPerMeterXdib3PelsPerMeterYdib3ColorsUseddib3ColorsImportant BitmapInfoInfoV3 FileHeaderfileHeaderTypefileHeaderFileSizefileHeaderReserved1fileHeaderReserved2fileHeaderOffsetBMP bmpFileHeader bmpBitmapInfobmpRawImageDataunpackBMPToRGBA32packRGBA32ToBMPreadBMPhGetBMPwriteBMPhPutBMP bmpDimensionssizeOfBitmapInfoV3checkBitmapInfoV3sizeOfFileHeaderbmpMagiccheckFileHeaderpackRGB24ToRGBA32baseGHC.ErrerrorpackRGBA32ToRGB24