friday-0.1.2: A functionnal image processing library for Haskell.

Safe HaskellNone

Vision.Image.Mutable

Synopsis

Documentation

class Image (Freezed i) => MutableImage i whereSource

Class for images which can be constructed from a mutable image.

Associated Types

type Freezed i Source

The type of the immutable version of the mutable image i.

Methods

mShape :: i s -> SizeSource

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.

Instances

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

Constructors

MutableManifest 

Fields

mmSize :: !Size
 
mmVector :: !(MVector s p)
 

Instances