ú·°‚T      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS T(width,height) #number of channels (eg. 3 for RGB) Upointer to the data %the padding of the rows, measured in bytes %the alignment of the rows (in bytes)  VWXYZ!The width divided by the height. [ TU VWXYZ[ TUTU VWXVWXYZ[    ;\component type weight1, weight2 width, height source1, nchn, pad, offset source2, nchn, pad, offset target, nchn, pad, offset ]component type gamma width, height, nchn  source, pad  target, pad ^component type gamma width, height source, nchn, pad, offset target, nchn, pad, offset _component type )width, height, source, nchn, pad, offset )width, height, target, nchn, pad, offset `component type width, height source, nchn, pad, offset target, nchn, pad, offset abcdef Note: we cannot guarantee the alignment V of the memory block (but typically it is aligned at least to machine word boundary),  but what we can1 guarantee is that the rows are properly padded. SAt the moment, the default alignment is 4, valid alignments are 1, 2, 4, 8 and 16, W and the padding method is compatible with the OpenGL one (that is, the padding is the K smallest multiple of a component size such that the next row is aligned). /The resulting new bitmap is filled with zeros. (width,height) number of channels (components/pixel) #the row alignment of the new image ICreates a new single-channel bitmap, using the given function to compute  the pixel values. # Warning, this is probably slow! (width,height) #the row alignment of the new image ,the function we will use to fill the bitmap (width,height) of the source "number of channels in the source source padding  the source target alignment   withBitmap bitmap $ \(w,h) nchn padding ptr -> ...!UNote that the resulting pointer is valid only within a line (because of the padding)  the bitmap position (x,y) $channel index {0,1,...,nchannels-1}  user action " It is not very efficient to read/write lots of pixels this way.  the bitmap position (x,y) $channel index {0,1,...,nchannels-1} # the bitmap position (x,y) $channel index {0,1,...,nchannels-1} the value to write $4Please note that the component array to read shouldn' t cross  the boundary between lines.  the bitmap position (x,y) $channel index {0,1,...,nchannels-1} !the number of components to read %5Please note that the component array to write shouldn' t cross  the boundary between lines.  the bitmap position (x,y) $channel index {0,1,...,nchannels-1} the components to write & the bitmap position (x,y) 'AThese functions assume that the number of channels of the bitmap 1 agrees with the number suffix of the function. (Maybe I should put E the number of components into the Bitmap type? But that would cause  different problems...) ()*+,-.g ypos totalNumberOfComps src tgt h"ypos width ptr1 nchn1 ptr2 nchn2 ij/SMaps a function over each component of each pixel. Warning: this is probably slow! ; Use a specialized function if there is one for your task. 01source bitmap &row alignment of the resulting bitmap 2>Copies a subrectangle of the source image into a new image.  source image source rectangle offset source rectangle size 3Copy into a new "black"3 bitmap; common generalization of crop and extend.  source image source rectangle offset source rectangle size target image size target rectangle offset 4DThe source rectangle may be arbitrary, may or may not intersect the I source image in any way. We only copy the intersection of the rectangle  with the image.  source image source rectangle offset source rectangle size  target image target rectangle offset 5 source image target image row alignment source channel index 678 source image source channel index  target image target channel index 9 source image target image size target image alignment : source image source channel index target image size target image alignment ; source image source channel index  target image target channel index <This is equivalent to componentMap (c -> c^gamma), except that  (^)F is defined only for integral exponents; but should be faster anyway. gamma source bitmap target alignment =gamma  source image source channel index target image alignment >gamma  source image source channel index  target image target channel index ?BBlends two bitmaps with the given weights; that is, the result is I the specified linear combination. If the values are outside the allowed I range (this can happen with the Word8, Word16, Word32 types and weights G whose sum is bigger than 1, or with a negative weight), then they are  clipped. The clipping does not' happen with the Float component type. weight1 weight2 source1 image source2 image target alignment @weight1 weight2 source1 image source1 channel index source2 image source2 channel index target alignment Aweight1 weight2 source1 image source1 channel index source2 image source2 channel index  target image target channel index BFThe data is copied, not shared. Note that the resulting ByteString is  encoded using the host machine'*s endianness, so it may be not compatible ! across different architectures! C The data is copied, not shared. 2 Note that we expect the ByteString to be encoded  encoded using the host machine's endianness. klmD  !"#$%&'()*+,-./0123456789:;<=>?@ABC) /1023476589:;?@A<=>BC!"#$%&'()*+,-.) !"#$%&'()*+,-./0123456789:;<=>?@ABCD"A bitmap filled with zero values.  Note: we cannot guarantee the alignment V of the memory block (but typically it is aligned at least to machine word boundary),  but what we can1 guarantee is that the rows are properly padded. (width,height) number of channels (components/pixel) #the row alignment of the new image E1Creates a single channel bitmap from a function.  This is probably a bit slow. (width,height) #the row alignment of the new image 'the function used to create the bitmap F Warning: this is probably slow. G Warning: this is probably slow. H>Copies a subrectangle of the source image into a new image.  source image source rectangle offset source rectangle size ICopy into a new "black"3 bitmap; common generalization of crop and extend.  source image source rectangle offset source rectangle size target image size target rectangle offset J source image target image row alignment source channel index KLM source image target image size target image row alignment N source image source channel indexe target image size target image row alignment OBBlends two bitmaps with the given weights; that is, the result is I the specified linear combination. If the values are outside the allowed I range (this can happen with the Word8, Word16, Word32 types and weights G whose sum is bigger than 1, or with a negative weight), then they are  clipped. The clipping does not' happen with the Float component type.  weight 1  weight 2 source image 1 source image 2 target alignment P weight 1  weight 2 source image 1 channel index 1 source image 2 channel index 2 target alignment QThis is equivalent to componentMap (c -> c^gamma), except that  (^)F is defined only for integral exponents; but should be faster anyway. gamma  source image target image row alignment Rgamma  source image source channel indexe target image row alignment SNote that the data is shared); and also that the resulting ByteString " is encoded using the host machine's endianness. + DEFGHIJKLMNOPQRSDEFGHILKJMNOPQRSDEFGHIJKLMNOPQRS+ DEFGHIJKLMNOPQRSn      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL%79:;=>?ABGHDEM NOPQRSTUVWXYZ[\]^_`abcdefg bitmap-0.0.1Data.Bitmap.BaseData.Bitmap.IOData.Bitmap.PureData.Bitmap.Internal Data.BitmapbaseGHC.WordWord8Word16Word32Bitmap bitmapSizebitmapNChannelsbitmapRowPaddingbitmapRowAlignment AlignmentPaddingNChnOffsetSizePixelComponentPixelComponentTypePctFloat PctWord32 PctWord16PctWord8pixelComponentSizepixelComponentTypebitmapComponentSizeInBytesbitmapPixelSizeInBytesbitmapUnpaddedRowSizeInBytesbitmapPaddedRowSizeInBytesbitmapSizeInBytes bitmapAspect newBitmapnewBitmapUninitializedcreateSingleChannelBitmapcopyBitmapFromPtrbitmapFromForeignPtrUnsafe withBitmapwithComponentPtrunsafeReadComponentunsafeWriteComponentunsafeReadComponentsunsafeWriteComponentsunsafeReadPixelunsafeReadPixel1unsafeReadPixel2unsafeReadPixel3unsafeReadPixel4unsafeWritePixel1unsafeWritePixel2unsafeWritePixel3unsafeWritePixel4 componentMapcomponentMapInPlace componentMap' copySubImage copySubImage'copySubImageIntoextractSingleChannelextractChannelscombineChannelsextractChannelIntobilinearResamplebilinearResampleChannelbilinearResampleChannelIntopowerlawGammaCorrectionpowerlawGammaCorrectionChannel"powerlawGammaCorrectionChannelInto blendBitmaps blendChannelsblendChannelsIntocopyBitmapToByteStringcopyBitmapFromByteString emptyBitmapbitmapToByteString bitmapPtrc_typetoFloat fromFloatclampisValidAlignmentrecommendedPaddingc_linear_combine_channelsc_gamma_correct_all_channelsc_gamma_correct_channelc_bilinear_resample_channelc_extract_channelc_memcpyc_memsetdefaultAlignmentvalidateMaybeAlignmentvalidateAlignment newBitmapRawgenericComponentRowMapgenericPixelRowMapgenericComponentMapgenericComponentMapWithPos advancePtr1 myPlusPtrci