úÎ5ì2}3      !"#$%&'()*+,-./0123(width,height) #number of channels (eg. 3 for RGB) 4pointer to the data %the padding of the rows, measured in bytes %the alignment of the rows (in bytes)  567834 56783434 56785678    9:;< 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. /The resulting new bitmap is filled with zeros. (width,height) number of channels (components/pixel) #the row alignment of the new image (width,height) of the source "number of channels in the source source padding  the source target alignment  withBitmap bitmap $ \(w,h) nchn padding ptr -> ...=>?JMaps a function over each component of each pixel. Warning: this is slow! ; Use a specialized function if there is one for your task.  Note: We don'Gt do the more general (s->t) here, because then we would have no idea * about the padding in the new bitmap. See   for that.  See the comments at . source bitmap &row alignment of the resulting bitmap !>Copies a subrectangle of the source image into a new image.  source image source rectangle offset source rectangle size "Copy 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 #DThe 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 $ source image target image row alignment source channel index %&' source image source channel index  target image target channel index ( The data is copied, not shared. ) The data is copied, not shared. @AB*  !"#$%&'() !"#&%$'() !"#$%&'() *"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 +Warning: this is probably slow ,Warning: this is probably slow ->Copies a subrectangle of the source image into a new image.  source image source rectangle offset source rectangle size .Copy 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 / source image target image row alignment source channel index 012Note that the data is shared. " *+,-./012 *+,-.10/2 *+,-./012" *+,-./012C      !"#$%&'()*+,-./012&()*,-.3 456789:;<=>?@ABC bitmap-0.0.0Data.Bitmap.BaseData.Bitmap.IOData.Bitmap.PureData.Bitmap.Internal Data.BitmapbaseGHC.WordWord8Word16Word32Bitmap bitmapSizebitmapNChannelsbitmapRowPaddingbitmapRowAlignment AlignmentPaddingNChnOffsetSizePixelComponentPixelComponentTypePctFloat PctWord32 PctWord16PctWord8pixelComponentTypebitmapComponentSizeInBytesbitmapPixelSizeInBytesbitmapUnpaddedRowSizeInBytesbitmapPaddedRowSizeInBytesbitmapSizeInBytes newBitmapnewBitmapUninitializedcopyBitmapFromPtrbitmapFromForeignPtrUnsafe withBitmap componentMapcomponentMapInPlace componentMap' copySubImage copySubImage'copySubImageIntoextractSingleChannelextractChannelscombineChannelsextractChannelIntocopyBitmapToByteStringcopyBitmapFromByteString emptyBitmapbitmapToByteString bitmapPtrc_typenbytestoFloat fromFloatc_extract_channelc_memcpyc_memset newBitmapRawgenericComponentRowMapgenericPixelRowMapgenericComponentMap advancePtr1 myPlusPtrci