 , getAllPixels
 , getAllPixelsRowMajor
 , mapImageInplace
+, mapColourImageInplace
 -- * Image information
 , ImageDepth
 , Sized(..)

import Foreign.Ptr
import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
import Foreign.Storable
import System.IO.Unsafe
import Data.Word
import qualified Data.Complex as C

                                         r <- peek (castPtr (d`plusPtr` (y*cs +(x*3+2)*fs)))
                                         return (r,g,b)

instance  GetPixel (Image BGRA D8) where
    type P (Image BGRA D8) = (D8,D8,D8,D8)
    {-#INLINE getPixel#-}
    getPixel (x,y) i = unsafePerformIO $
                        withGenImage i $ \c_i -> do
                                         d <- {#get IplImage->imageData#} c_i
                                         s <- {#get IplImage->widthStep#} c_i
                                         let cs = fromIntegral s
                                             fs = sizeOf (undefined :: D8)
                                         b <- peek (castPtr (d`plusPtr` (y*cs +x*4*fs)))
                                         g <- peek (castPtr (d`plusPtr` (y*cs +(x*4+1)*fs)))
                                         r <- peek (castPtr (d`plusPtr` (y*cs +(x*4+2)*fs)))
                                         a <- peek (castPtr (d`plusPtr` (y*cs +(x*4+3)*fs)))
                                         return (b,g,r,a)

instance GetPixel (Image LAB D32) where
    type P (Image LAB D32) = (D32,D32,D32)
    {-#INLINE getPixel#-}
