sdl2-gfx-0.3.0.0: Haskell bindings to SDL2_gfx
Copyright(c) 2015 Siniša Biđin
LicenseMIT
Maintainer[email protected]
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

SDL.Rotozoom

Description

Bindings to SDL2_gfx's surface rotation and zoom functionality.

Synopsis

Documentation

type Angle = Double Source #

Desired rotation in degrees.

type Zoom = Double Source #

A dimension scaling factor.

data Smooth Source #

Whether resulting Surfaces are anti-aliased or not.

Constructors

Smooth 
Rough 

Instances

Instances details
Bounded Smooth Source # 
Instance details

Defined in SDL.Rotozoom

Enum Smooth Source # 
Instance details

Defined in SDL.Rotozoom

Generic Smooth Source # 
Instance details

Defined in SDL.Rotozoom

Associated Types

type Rep Smooth 
Instance details

Defined in SDL.Rotozoom

type Rep Smooth = D1 ('MetaData "Smooth" "SDL.Rotozoom" "sdl2-gfx-0.3.0.0-8sqgq9QIqC9LTWyCP1MonQ" 'False) (C1 ('MetaCons "Smooth" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Rough" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Smooth -> Rep Smooth x #

to :: Rep Smooth x -> Smooth #

Read Smooth Source # 
Instance details

Defined in SDL.Rotozoom

Show Smooth Source # 
Instance details

Defined in SDL.Rotozoom

Eq Smooth Source # 
Instance details

Defined in SDL.Rotozoom

Methods

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

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

Ord Smooth Source # 
Instance details

Defined in SDL.Rotozoom

type Rep Smooth Source # 
Instance details

Defined in SDL.Rotozoom

type Rep Smooth = D1 ('MetaData "Smooth" "SDL.Rotozoom" "sdl2-gfx-0.3.0.0-8sqgq9QIqC9LTWyCP1MonQ" 'False) (C1 ('MetaCons "Smooth" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Rough" 'PrefixI 'False) (U1 :: Type -> Type))

rotozoom :: MonadIO m => Surface -> Angle -> Zoom -> Smooth -> m Surface Source #

Rotates and zooms a 32 or 8-bit Surface.

If the Surface isn't 8-bit or 32-bit RGBA/ABGR, it will be converted into 32-bit RGBA.

rotozoomXY :: MonadIO m => Surface -> Angle -> Zoom -> Zoom -> Smooth -> m Surface Source #

Same as rotozoom, but applies different horizontal and vertical scaling factors.

The Zoom arguments are the horizontal and vertical zoom, respectively.

type Size = V2 CInt Source #

A surface size, packing width and height.

rotozoomSize :: MonadIO m => Size -> Angle -> Zoom -> m Size Source #

Given the Size of an input Surface, returns the Size of a Surface resulting from a rotozoom call.

rotozoomSizeXY :: MonadIO m => Size -> Angle -> Zoom -> Zoom -> m Size Source #

Same as rotozoomSize, but for different horizontal and vertical scaling factors.

zoom :: MonadIO m => Surface -> Zoom -> Smooth -> m Surface Source #

Same as rotozoom, but only performs the zoom.

If a Zoom factor is negative, it flips the image on both axes.

zoomXY :: MonadIO m => Surface -> Zoom -> Zoom -> Smooth -> m Surface Source #

Same as zoom, but applies different horizontal and vertical scaling factors.

If a Zoom factor is negative, it flips the image on its corresponding axis.

zoomSize :: MonadIO m => Size -> Zoom -> m Size Source #

Calculates the Size of a resulting Surface for a zoom call.

zoomSizeXY :: MonadIO m => Size -> Angle -> Zoom -> m Size Source #

Same as zoomSize, but for different horizontal and vertical scaling factors.

shrink :: MonadIO m => Surface -> CInt -> CInt -> m Surface Source #

Shrink a surface by an integer ratio.

The two CInt arguments are the horizontal and vertical shrinking ratios: 2 halves a dimension, 5 makes it a fifth of its original size etc.

The resulting Surface is anti-aliased and, if the input wasn't 8-bit or 32-bit, converted to a 32-bit RGBA format.

rotate90 :: MonadIO m => Surface -> Int -> m Surface Source #

Given a number of clockwise rotations to perform, rotates Surface in increments of 90 degrees.

Since no interpolation is done, this is faster than rotozoomer.