 foreign import ccall safe "gdal.h GDALGetMaskBand" c_getMaskBand
    :: (Band s t a) -> IO (Band s t Word8)
 
-getMaskBand :: Band s t a -> GDAL s (Band s t Word8)
-getMaskBand = liftIO . c_getMaskBand
+#c
+enum MaskFlag {
+     MaskAllValid = GMF_ALL_VALID,
+     MaskPerDataset = GMF_PER_DATASET,
+     MaskAlpha = GMF_ALPHA,
+     MaskNoData = GMF_NODATA
+};
+#endc
+
+{# enum MaskFlag  {} deriving (Eq, Bounded, Show) #}
+
+foreign import ccall unsafe "gdal.h GDALGetMaskFlags" c_getMaskFlags
+   :: (Band s t a) -> CInt
 
 
 instance GDALType Word8 where

           throwIfError "could not write block" $
              writeBlock_ b (fromIntegral x) (fromIntegral y)
                            (castPtr ptr)

foreign import ccall safe "gdal.h GDALWriteBlock" writeBlock_
   :: (RWBand s a) -> CInt -> CInt -> Ptr () -> IO CInt

            (fromEnumC (datatype (Proxy :: Proxy a)))
            0
            0
{-# INLINE writeBand #-}

foreign import ccall safe "gdal.h GDALRasterIO" rasterIO_
  :: (Band s a t) -> CInt -> CInt -> CInt -> CInt -> CInt -> Ptr () -> CInt -> CInt
