module WebP.Decode ( webPDecodeRGBA , webPDecodeRGB , UInt8 ) where import Data.Coerce (coerce) import Foreign.C.Types (CInt, CSize) import Foreign.Marshal.Alloc (alloca) import Foreign.Ptr (Ptr, castPtr) import Foreign.Storable (peek) #include type UInt8 = {# type uint8_t #} -- see docs: https://developers.google.com/speed/webp/docs/api {# fun WebPDecodeRGBA as ^ { castPtr `Ptr a', coerce `CSize', alloca- `CInt' peek*, alloca- `CInt' peek* } -> `Ptr UInt8' id #} {# fun WebPDecodeRGB as ^ { castPtr `Ptr a', coerce `CSize', alloca- `CInt' peek*, alloca- `CInt' peek* } -> `Ptr UInt8' id #} -- WebPDecodeYUV