Safe Haskell | None |
---|
- class Image (Freezed i) => MutableImage i where
- type Freezed i
- mShape :: i s -> Size
- new :: PrimMonad m => Size -> m (i (PrimState m))
- new' :: PrimMonad m => Size -> ImagePixel (Freezed i) -> m (i (PrimState m))
- read :: PrimMonad m => i (PrimState m) -> DIM2 -> m (ImagePixel (Freezed i))
- linearRead :: PrimMonad m => i (PrimState m) -> Int -> m (ImagePixel (Freezed i))
- write :: PrimMonad m => i (PrimState m) -> DIM2 -> ImagePixel (Freezed i) -> m ()
- linearWrite :: PrimMonad m => i (PrimState m) -> Int -> ImagePixel (Freezed i) -> m ()
- freeze :: PrimMonad m => i (PrimState m) -> m (Freezed i)
- unsafeFreeze :: PrimMonad m => i (PrimState m) -> m (Freezed i)
- thaw :: PrimMonad m => Freezed i -> m (i (PrimState m))
- create :: MutableImage i => (forall s. ST s (i s)) -> Freezed i
- data Storable p => MutableManifest p s = MutableManifest {}
Documentation
class Image (Freezed i) => MutableImage i whereSource
Class for images which can be constructed from a mutable image.
mShape
doesn't run in a monad as the size of a mutable image is
constant.
new :: PrimMonad m => Size -> m (i (PrimState m))Source
Creates a new mutable image of the given size. Pixels are initialized with an unknown value.
new' :: PrimMonad m => Size -> ImagePixel (Freezed i) -> m (i (PrimState m))Source
Creates a new mutable image of the given size and fill it with the given value.
read :: PrimMonad m => i (PrimState m) -> DIM2 -> m (ImagePixel (Freezed i))Source
Returns the pixel value at Z :. y :. x
.
linearRead :: PrimMonad m => i (PrimState m) -> Int -> m (ImagePixel (Freezed i))Source
Returns the pixel value as if the image was a single dimension vector (row-major representation).
write :: PrimMonad m => i (PrimState m) -> DIM2 -> ImagePixel (Freezed i) -> m ()Source
Overrides the value of the pixel at Z :. y :. x
.
linearWrite :: PrimMonad m => i (PrimState m) -> Int -> ImagePixel (Freezed i) -> m ()Source
Overrides the value of the pixel at the given index as if the image was a single dimension vector (row-major representation).
freeze :: PrimMonad m => i (PrimState m) -> m (Freezed i)Source
Returns an immutable copy of the mutable image.
unsafeFreeze :: PrimMonad m => i (PrimState m) -> m (Freezed i)Source
Returns the immutable version of the mutable image. The mutable image should not be modified thereafter.
thaw :: PrimMonad m => Freezed i -> m (i (PrimState m))Source
Returns a mutable copy of the immutable image.
(Pixel p, Storable p) => MutableImage (MutableManifest p) |
create :: MutableImage i => (forall s. ST s (i s)) -> Freezed iSource
Creates an immutable image from an ST
action creating a mutable image.
data Storable p => MutableManifest p s Source
(Pixel p, Storable p) => MutableImage (MutableManifest p) |