htdp-image-1.0.0.0: Beginner friendly graphics library.

Safe HaskellNone
LanguageHaskell2010

Graphics.Htdp

Contents

Description

htdp-image is a simple graphics library written on top of Gloss that allows users to create complex images by combining smaller images.

For example, four iterations of the sierpinski triangle can be drawn as:

   import Graphics.Htdp
   main = drawImage $ sier . sier . sier . sier $ triangle 20 solid red
    where
    sier :: Image -> Image
    sier t = above t (beside t t)
   

Once the image is drawn, you can use Gloss key bindings to navigate around.

Synopsis

Documentation

Image constructors

Image combinators

Image

data Image Source #

A 2D Image.

Instances
Eq Image Source # 
Instance details

Defined in Graphics.Data.Image

Methods

(==) :: Image -> Image -> Bool #

(/=) :: Image -> Image -> Bool #

width :: Image -> Float Source #

Width of image

height :: Image -> Float Source #

Height of image

rotate Source #

Arguments

:: Float
deg
-> Image
i
-> Image 

Rotates i by deg degrees in a counter-clockwise direction. Unlike 2htdp/image's rotate function, this function is not smart enough to reduce the rotated image's binding box to fit the actual image. Instead, it just creates a new binding box so that i's binding box fits in it.

Output

drawImage :: Image -> IO () Source #

Function to draw an image in a new window with same dimensions as the given image.