vty-5.19: A simple terminal UI library

Safe HaskellNone
LanguageHaskell2010

Graphics.Vty.PictureToSpans

Description

Transforms an image into rows of operations.

Synopsis

Documentation

data BlitEnv s Source #

Constructors

BlitEnv 

mrowOps :: forall s s. Lens (BlitEnv s) (BlitEnv s) (MRowOps s) (MRowOps s) Source #

type BlitM s a = ReaderT (BlitEnv s) (StateT BlitState (ST s)) a Source #

displayOpsForPic :: Picture -> DisplayRegion -> DisplayOps Source #

Produces the span ops that will render the given picture, possibly cropped or padded, into the specified region.

displayOpsForImage :: Image -> DisplayOps Source #

Returns the DisplayOps for an image rendered to a window the size of the image.

largerly used only for debugging.

combinedOpsForLayers :: Picture -> DisplayRegion -> ST s (MRowOps s) Source #

Produces the span ops for each layer then combines them.

buildSpans :: Image -> DisplayRegion -> ST s (MRowOps s) Source #

Builds a vector of row operations that will output the given picture to the terminal.

Crops to the given display region.

startImageBuild :: Image -> BlitM s () Source #

Add the operations required to build a given image to the current set of row operations.

addMaybeClipped :: forall s. Image -> BlitM s () Source #

This adds an image that might be partially clipped to the output ops.

This is a very touchy algorithm. Too touchy. For instance, the CropRight and CropBottom implementations are odd. They pass the current tests but something seems terribly wrong about all this.

snocOp :: SpanOp -> Int -> BlitM s () Source #

snocs the operation to the operations for the given row.

(-~) :: Num a => ASetter s t a a -> a -> s -> t Source #

(+~) :: Num a => ASetter s t a a -> a -> s -> t Source #