HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulevty-6.5Haskell2010

Graphics.Vty.Image.Internal

  • 1 type
  • 6 values
  • Packagevty-6.5
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInternal.hs
datadata Image
#

This is the internal representation of Images. Use the constructors in Graphics.Vty.Image to create instances.

Images are:

  • a horizontal span of text

  • a horizontal or vertical join of two images

  • a two dimensional fill of the Pictures background character

  • a cropped image

  • an empty image of no size or content.

Constructors

  • HorizText

    A horizontal text span has a row height of 1.

    • attr :: Attr
    • displayText :: Text

      The text to display. The display width of the text is always outputWidth.

    • outputWidth :: Int

      The number of display columns for the text.

    • charWidth :: Int

      the number of characters in the text.

  • HorizJoin

    A horizontal join can be constructed between any two images. However a HorizJoin instance is required to be between two images of equal height. The horizJoin constructor adds background fills to the provided images that assure this is true for the HorizJoin value produced.

    • partLeft :: Image
    • partRight :: Image
    • outputWidth :: Int

      The number of display columns for the text.

    • outputHeight :: Int

      imageHeight partLeft == imageHeight partRight. Always > 0

  • VertJoin

    A veritical join can be constructed between any two images. However a VertJoin instance is required to be between two images of equal width. The vertJoin constructor adds background fills to the provides images that assure this is true for the VertJoin value produced.

    • partTop :: Image
    • partBottom :: Image
    • outputWidth :: Int

      The number of display columns for the text.

    • outputHeight :: Int

      imageHeight partLeft == imageHeight partRight. Always > 0

  • BGFill

    A background fill will be filled with the background char. The background char is defined as a property of the Picture this Image is used to form.

    • outputWidth :: Int

      The number of display columns for the text.

    • outputHeight :: Int

      imageHeight partLeft == imageHeight partRight. Always > 0

  • Crop

    Crop an image

    • croppedImage :: Image
    • leftSkip :: Int
    • topSkip :: Int
    • outputWidth :: Int

      The number of display columns for the text.

    • outputHeight :: Int

      imageHeight partLeft == imageHeight partRight. Always > 0

  • EmptyImage

    The empty image

    The combining operators identity constant. EmptyImage | a = a EmptyImage - a = a

    Any image of zero size equals the empty image.

Instances8Eq, Read, Show, Generic, Semigroup, Monoid, …
valueimageHeight :: Image -> Int
#

The height of an Image. This is the number of display rows the image will occupy.

valueimageWidth :: Image -> Int
#

The width of an Image. This is the number display columns the image will occupy.

valuehorizJoin :: Image -> Image -> Image
#

combines two images side by side

Combines text chunks where possible. Assures outputWidth and outputHeight properties are not violated.

The result image will have a width equal to the sum of the two images width. And the height will equal the largest height of the two images. The area not defined in one image due to a height mismatch will be filled with the background pattern.

valuevertJoin :: Image -> Image -> Image
#

combines two images vertically

The result image will have a height equal to the sum of the heights of both images. The width will equal the largest width of the two images. The area not defined in one image due to a width mismatch will be filled with the background pattern.

valueppImageStructure :: Image -> String
#

pretty print just the structure of an image.