halide-JuicyPixels-0.0.2.0: Integration between Halide and JuicyPixels
Copyright(c) Tom Westerhout 2023
Safe HaskellSafe-Inferred
LanguageGHC2021

Language.Halide.JuicyPixels

Description

This package allows you to use JuicyPixels together with halide-haskell. It defines IsHalideBuffer instances for Image and MutableImage types from the JuicyPixels library.

That allows you to write code such as:

kernel :: Ptr (HalideBuffer 3 Word8) -> Ptr (HalideBuffer 3 Word8) -> IO ()
kernel = ...

brighten :: Image PixelRGB8 -> MutableImage RealWorld PixelRGB8 -> IO ()
brighten input output = do
  withHalideBuffer 3 Word8 input $ input' ->
    withHalideBuffer 3 Word8 output $ output' ->
      kernel input' output'

Orphan instances

(Pixel a, r ~ PixelBaseComponent a, IsHalideType r) => IsHalideBuffer (Image a) 3 r Source # 
Instance details

Methods

withHalideBufferImpl :: Image a -> (Ptr (HalideBuffer 3 r) -> IO b) -> IO b

(Pixel a, r ~ PixelBaseComponent a, IsHalideType r) => IsHalideBuffer (MutableImage RealWorld a) 3 r Source # 
Instance details

Methods

withHalideBufferImpl :: MutableImage RealWorld a -> (Ptr (HalideBuffer 3 r) -> IO b) -> IO b