gegl-0.0.0.5: Haskell bindings to GEGL library

Copyright(c) Amedeo Molnár, 2015-2016
LicenseLGPL-3
Maintainernek0@nek0.eu
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

GEGL.Buffer

Description

This module contains all functions necessary for manipulate GeglBuffers. Contents is roughly comparable to the functions provided by gegl-buffer.h in gegl-0.3.8.

Synopsis

Documentation

data GeglBuffer #

Outward representation of the buffer.

gegl_buffer_new #

Arguments

:: Maybe GeglRectangle

Geometry of the buffer. If Nothing is passed , the buffer is created empty

-> BablFormatPtr

Pixel format of the buffer

-> IO GeglBuffer 

Create a new GeglBuffer.

gegl_buffer_default_new :: IO GeglBuffer #

Creates a new GeglBuffer, which defaults to an empty buffer with the RGBAfloat format.

gegl_buffer_save :: GeglBuffer -> FilePath -> GeglRectangle -> IO () #

Write a GeglBuffer to a file.

gegl_buffer_load :: FilePath -> IO GeglBuffer #

Load an existing buffer from disk.

gegl_buffer_flush #

Arguments

:: GeglBuffer

Buffer to flush

-> IO () 

Flush all unsaved data to disk. This is not necessary for shared GeglBuffers opened with "gegl_buffer_open" since they auto-sync on writes.

gegl_buffer_create_sub_buffer #

Arguments

:: GeglBuffer

Parent buffer

-> GeglRectangle

Coordinates of new buffer

-> IO GeglBuffer

Child buffer

Create a new sub GeglBuffer, that is a view on a larger buffer.

gegl_buffer_get_extent #

Arguments

:: GeglBuffer

The buffer

-> IO GeglRectangle

active area

Retrieve position and size of the area considered active in a buffer.

gegl_buffer_set_extent #

Arguments

:: GeglBuffer

The buffer

-> GeglRectangle

New extent of the buffer

-> IO Bool

Returns True on success, otherwise False

Change postition and size of the area considered active in a buffer.

Some convenience functions that operate on the basis of gegl_buffer_get_extent.

gegl_buffer_get_x #

Arguments

:: GeglBuffer

The buffer

-> IO Int 

get X coordinate of the upper left corner of a buffer

gegl_buffer_get_y #

Arguments

:: GeglBuffer

The buffer

-> IO Int 

get Y coordinate of the upper left corner of a buffer

gegl_buffer_get_height #

Arguments

:: GeglBuffer

The buffer

-> IO Int 

get height of a buffer

gegl_buffer_get_width #

Arguments

:: GeglBuffer

The buffer

-> IO Int 

get width of a buffer

gegl_buffer_get_pixel_count #

Arguments

:: GeglBuffer

The buffer

-> IO Int 

get pixel count of a buffer

Returning to main functions

gegl_buffer_set_color #

Arguments

:: GeglBuffer

The buffer

-> GeglRectangle

Area of the buffer to fill

-> GeglColor

The colour to fill with

-> IO () 

Sets a region covered by a GeglRectangle to a specified colour.

gegl_buffer_set_pattern #

Arguments

:: GeglBuffer

Target buffer

-> GeglRectangle

Area of target buffer to fill

-> GeglBuffer

A buffer to be repeated as pattern

-> Double

X offset

-> Double

Y offset

-> IO () 

Fill a region with a repeating pattern.

gegl_buffer_clear #

Arguments

:: GeglBuffer

Target buffer

-> GeglRectangle

Area to clear

-> IO () 

Clear a provided rectangular region by setting all associated memory to 0.

gegl_buffer_get #

Arguments

:: GeglBuffer

Buffer to retrieve data from

-> Maybe GeglRectangle

Coordinates to retrieve data from. If set to Nothing the whole buffer is taken.

-> Double

Sampling scale

-> Maybe BablFormatPtr

Format to convert the data to. If set to Nothing no conversion is performed.

-> Ptr a 
-> Int 
-> GeglAbyssPolicy 
-> IO () 

Fetch a rectangular linear buffer of pixel data from the GeglBuffer, convert it if neccessary and push it into a memory location.