wxcore-0.90.0.3: wxHaskell core

Portability | portable
Stability | provisional
Maintainer | wxhaskell-devel@lists.sourceforge.net
Safe Haskell | None

Graphics.UI.WXCore.Image

Contents

- Images
  - Imagelist
  - Icons
  - Cursors
  - Bitmaps
  - Helpers
- Direct image manipulation
  - Pixel buffer

Description

Synopsis

- topLevelWindowSetIconFromFile :: TopLevelWindow a -> FilePath -> IO ()
- imageListAddIconsFromFiles :: ImageList a -> Size -> [FilePath] -> IO ()
- imageListAddIconFromFile :: ImageList a -> Size -> FilePath -> IO ()
- withIconFromFile :: FilePath -> Size -> (Icon () -> IO a) -> IO a
- iconCreateFromFile :: FilePath -> Size -> IO (Icon ())
- iconGetSize :: Icon a -> IO Size
- withCursorFromFile :: FilePath -> (Cursor () -> IO a) -> IO a
- cursorCreateFromFile :: String -> IO (Cursor ())
- withBitmapFromFile :: FilePath -> (Bitmap () -> IO a) -> IO a
- bitmapCreateFromFile :: FilePath -> IO (Bitmap ())
- bitmapGetSize :: Bitmap a -> IO Size
- bitmapSetSize :: Bitmap a -> Size -> IO ()
- imageTypeFromExtension :: String -> BitFlag
- imageTypeFromFileName :: String -> BitFlag
- imageGetPixels :: Image a -> IO [Color]
- imageCreateFromPixels :: Size -> [Color] -> IO (Image ())
- imageGetPixelArray :: IArray a Color => Image b -> IO (a Point Color)
- imageCreateFromPixelArray :: IArray a Color => a Point Color -> IO (Image ())
- imageGetSize :: Image a -> IO Size
- withImageData :: Image a -> (Ptr () -> IO b) -> IO b
- imageCreateFromPixelBuffer :: PixelBuffer -> IO (Image ())
- imageGetPixelBuffer :: Image a -> IO PixelBuffer
- withPixelBuffer :: Image a -> (PixelBuffer -> IO b) -> IO b
- data PixelBuffer
- pixelBufferCreate :: Size -> IO PixelBuffer
- pixelBufferDelete :: PixelBuffer -> IO ()
- pixelBufferInit :: PixelBuffer -> Color -> IO ()
- pixelBufferSetPixel :: PixelBuffer -> Point -> Color -> IO ()
- pixelBufferGetPixel :: PixelBuffer -> Point -> IO Color
- pixelBufferSetPixels :: PixelBuffer -> [Color] -> IO ()
- pixelBufferGetPixels :: PixelBuffer -> IO [Color]
- pixelBufferGetSize :: PixelBuffer -> Size

# Images

topLevelWindowSetIconFromFile :: TopLevelWindow a -> FilePath -> IO ()

Set the icon of a frame.

## Imagelist

imageListAddIconsFromFiles :: ImageList a -> Size -> [FilePath] -> IO ()

Initialize an image list with icons from files. Use a `sizeNull` to use the native size of the loaded icons.

imageListAddIconFromFile :: ImageList a -> Size -> FilePath -> IO ()

Add an icon from a file to an imagelist.

## Icons

withIconFromFile :: FilePath -> Size -> (Icon () -> IO a) -> IO a

Load an icon (see `iconCreateFromFile`) and automatically delete it after use.

iconCreateFromFile :: FilePath -> Size -> IO (Icon ())

Load an icon from an icon file (ico,xbm,xpm,gif). The `Size` argument gives the desired size but can be `sizeNull` to retrieve the image in its natural size.

iconGetSize :: Icon a -> IO Size

Get the size of an icon.

## Cursors

withCursorFromFile :: FilePath -> (Cursor () -> IO a) -> IO a

Load an cursor (see `cursorCreateFromFile`) and automatically delete it after use.

cursorCreateFromFile :: String -> IO (Cursor ())

Load an cursor from an icon file (ico,xbm,xpm,gif). For a reason, this function is incomatible with `iconCreateFromFile`.

## Bitmaps

withBitmapFromFile :: FilePath -> (Bitmap () -> IO a) -> IO a

Load a bitmap (see `bitmapCreateFromFile`) and automatically delete it after use.

bitmapCreateFromFile :: FilePath -> IO (Bitmap ())

Load a bitmap from an image file (gif, jpg, png, etc.)

bitmapGetSize :: Bitmap a -> IO Size

The size of a bitmap.

bitmapSetSize :: Bitmap a -> Size -> IO ()

Set the size of a bitmap.

## Helpers

imageTypeFromExtension :: String -> BitFlag

Get an image type from a file extension.

imageTypeFromFileName :: String -> BitFlag

Get an image type from a file name.

# Direct image manipulation

imageGetPixels :: Image a -> IO [Color]

Get the pixels of an image.

imageCreateFromPixels :: Size -> [Color] -> IO (Image ())

Create an image from a list of pixels.

imageGetPixelArray :: IArray a Color => Image b -> IO (a Point Color)

Get the pixels of an image as an array

imageCreateFromPixelArray :: IArray a Color => a Point Color -> IO (Image ())

Create an image from a pixel array

imageGetSize :: Image a -> IO Size

Get the size of an image

withImageData :: Image a -> (Ptr () -> IO b) -> IO b

Do something with the pixels of an image

## Pixel buffer

imageCreateFromPixelBuffer :: PixelBuffer -> IO (Image ())

Create an image from a pixel buffer. Note: the image will delete the pixelbuffer.

imageGetPixelBuffer :: Image a -> IO PixelBuffer

Deprecated: Use withPixelBuffer instead

Get the pixel buffer of an image. Note: use `withPixelBuffer` instead

withPixelBuffer :: Image a -> (PixelBuffer -> IO b) -> IO b

data PixelBuffer

An abstract pixel buffer (= array of RGB values)

pixelBufferCreate :: Size -> IO PixelBuffer

Create a pixel buffer. (To be deleted with `pixelBufferDelete`).

pixelBufferDelete :: PixelBuffer -> IO ()

Delete a pixel buffer.

pixelBufferInit :: PixelBuffer -> Color -> IO ()

Initialize the pixel buffer with a grey color. The second argument specifies the greyness as a number between 0.0 (black) and 1.0 (white).

pixelBufferSetPixel :: PixelBuffer -> Point -> Color -> IO ()

Set the color of a pixel.

pixelBufferGetPixel :: PixelBuffer -> Point -> IO Color

Get the color of a pixel

pixelBufferSetPixels :: PixelBuffer -> [Color] -> IO ()

Set all the pixels of a pixel buffer.

pixelBufferGetPixels :: PixelBuffer -> IO [Color]

Get all the pixels of a pixel buffer as a single list.

pixelBufferGetSize :: PixelBuffer -> Size

The size of a pixel buffer