gi-vips-8.0.3: libvips GObject bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Vips.Objects.Image

Description

An image. These can represent an image on disc, a memory buffer, an image in the process of being written to disc or a partially evaluated image in memory.

Synopsis

Exported types

newtype Image Source #

Memory-managed wrapper type.

Constructors

Image (ManagedPtr Image) 

Instances

Instances details
Eq Image Source # 
Instance details

Defined in GI.Vips.Objects.Image

Methods

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

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

GObject Image Source # 
Instance details

Defined in GI.Vips.Objects.Image

ManagedPtrNewtype Image Source # 
Instance details

Defined in GI.Vips.Objects.Image

Methods

toManagedPtr :: Image -> ManagedPtr Image

TypedObject Image Source # 
Instance details

Defined in GI.Vips.Objects.Image

Methods

glibType :: IO GType

HasParentTypes Image Source # 
Instance details

Defined in GI.Vips.Objects.Image

IsGValue (Maybe Image) Source #

Convert Image to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Vips.Objects.Image

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Image -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Image)

type ParentTypes Image Source # 
Instance details

Defined in GI.Vips.Objects.Image

type ParentTypes Image = '[Object, Object]

class (GObject o, IsDescendantOf Image o) => IsImage o Source #

Type class for types which can be safely cast to Image, for instance with toImage.

Instances

Instances details
(GObject o, IsDescendantOf Image o) => IsImage o Source # 
Instance details

Defined in GI.Vips.Objects.Image

toImage :: (MonadIO m, IsImage o) => o -> m Image Source #

Cast to Image, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

argumentIsset, argumentNeedsstring, autorotRemoveAngle, bindProperty, bindPropertyFull, build, colourspaceIssupported, copyMemory, decode, decodePredict, encode, forceFloating, foreignLoadInvalidate, freeBuffer, freezeNotify, get, getv, guessFormat, guessInterpretation, hasalpha, historyArgs, iccAc2rc, initFields, inplace, invalidateAll, isMSBfirst, isFloating, isSequential, isfile, iskilled, ispartial, localCb, map, minimiseAll, notify, notifyByPspec, pioInput, pioOutput, preclose, printDump, printField, printName, printSummary, ref, refSink, remove, reorderMarginHint, reorderPrepareMany, rewind, runDispose, sanity, set, stealData, stealQdata, thawNotify, toString, unref, unrefOutputs, watchClosure, wioInput, write, writeLine, writePrepare, writeToMemory.

Getters

getArea, getArgumentFlags, getArgumentPriority, getArgumentToString, getArrayDouble, getArrayInt, getAsString, getBands, getBlob, getCoding, getData, getDescription, getDouble, getFields, getFilename, getFormat, getHeight, getHistory, getImage, getInt, getInterpretation, getMode, getNPages, getNSubifds, getOffset, getOrientation, getOrientationSwap, getPageHeight, getQdata, getScale, getString, getTypeof, getWidth, getXoffset, getXres, getYoffset, getYres.

Setters

setArea, setArgumentFromString, setArrayDouble, setArrayInt, setBlob, setBlobCopy, setData, setDataFull, setDeleteOnClose, setDouble, setFromString, setImage, setInt, setKill, setProgress, setRequired, setStatic, setString.

autorotRemoveAngle

imageAutorotRemoveAngle Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to remove orientation from

-> m () 

Remove the orientation tag on image. Also remove any exif orientation tags. You must vips_copy() the image before calling this function since it modifies metadata.

colourspaceIssupported

imageColourspaceIssupported Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: input image

-> m Bool

Returns: True if image is in a supported colourspace.

Test if image is in a colourspace that vips_colourspace() can process.

copyMemory

imageCopyMemory Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to copy to a memory buffer

-> m Image

Returns: the new Image, or Nothing on error.

This function allocates memory, renders image into it, builds a new image around the memory area, and returns that.

If the image is already a simple area of memory, it just refs image and returns it.

Call this before using the draw operations to make sure you have a memory image that can be modified.

vips_copy() adds a null "copy" node to a pipeline. Use that instead if you want to change metadata and not pixels.

This operation is thread-safe, unlike imageWioInput.

If you are sure that image is not shared with another thread (perhaps you have made it yourself), use imageWioInput instead.

See also: imageWioInput.

decode

imageDecode Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

in: image to decode

-> m (Int32, Image)

Returns: 0 on success, or -1 on error.

A convenience function to unpack to a format that we can compute with. out.coding is always VIPS_CODING_NONE.

This unpacks LABQ to plain LAB. Use vips_LabQ2LabS() for a bit more speed if you need it.

See also: imageEncode, vips_LabQ2Lab(), vips_rad2float().

decodePredict

imageDecodePredict Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

in: image to decode

-> m (Int32, Int32, BandFormat) 

We often need to know what an image will decode to without actually decoding it, for example, in arg checking.

See also: imageDecode.

encode

imageEncode Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

in: image to encode

-> Coding

coding: coding to apply

-> m (Int32, Image)

Returns: 0 on success, or -1 on error.

A convenience function to pack to a coding. The inverse of imageDecode.

See also: imageDecode.

foreignLoadInvalidate

imageForeignLoadInvalidate Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to invalidate

-> m () 

Loaders can call this on the image they are making if they see a read error from the load library. It signals "invalidate" on the load operation and will cause it to be dropped from cache.

If we know a file will cause a read error, we don't want to cache the failing operation, we want to make sure the image will really be opened again if our caller tries again. For example, a broken file might be replaced by a working one.

freeBuffer

imageFreeBuffer Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: the image that contains the buffer

-> Ptr ()

buffer: the orignal buffer that was stolen

-> m () 

Free the externally allocated buffer found in the input image. This function is intended to be used with g_signal_connect.

get

imageGet Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the field from from

-> Text

name: the name to fetch

-> m GValue 

Fill valueCopy with a copy of the header field. valueCopy must be zeroed but uninitialised.

This will return -1 and add a message to the error buffer if the field does not exist. Use imageGetTypeof to test for the existence of a field first if you are not certain it will be there.

For example, to read a double from an image (though of course you would use imageGetDouble in practice):

GValue value = { 0 };
double d;

if (vips_image_get (image, name, &value))
  return -1;

if (G_VALUE_TYPE (&value) != G_TYPE_DOUBLE) {
  vips_error( "mydomain",
    _("field \"%s\" is of type %s, not double"),
    name,
    g_type_name (G_VALUE_TYPE (&value)));
  g_value_unset (&value);
  return -1;
}

d = g_value_get_double (&value);
g_value_unset (&value);

See also: imageGetTypeof, imageGetDouble.

getArea

imageGetArea Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the metadata from

-> Text

name: metadata name

-> m (Int32, Ptr ())

Returns: 0 on success, -1 otherwise.

Gets data from image under the name name. A convenience function over imageGet. Use imageGetTypeof to test for the existence of a piece of metadata.

See also: imageSetArea, imageGet, imageGetTypeof

getArrayDouble

imageGetArrayDouble Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the metadata from

-> Text

name: metadata name

-> m (Int32, [Double])

Returns: 0 on success, -1 otherwise.

Gets out from im under the name name. The field must be of type VIPS_TYPE_ARRAY_INT.

Do not free out. out is valid as long as image is valid.

Use imageGetTypeof to test for the existence of a piece of metadata.

See also: imageGet, imageSetImage

getArrayInt

imageGetArrayInt Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the metadata from

-> Text

name: metadata name

-> m (Int32, [Int32])

Returns: 0 on success, -1 otherwise.

Gets out from im under the name name. The field must be of type VIPS_TYPE_ARRAY_INT.

Do not free out. out is valid as long as image is valid.

Use imageGetTypeof to test for the existence of a piece of metadata.

See also: imageGet, imageSetImage

getAsString

imageGetAsString Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the header field from

-> Text

name: field name

-> m (Int32, Text)

Returns: 0 on success, -1 otherwise.

Returns name from image in out. This function will read any field, returning it as a printable string. You need to free the string with free when you are done with it.

This will base64-encode BLOBs, for example. Use vips_buf_appendgv() to make a string that's for humans.

See also: imageGet, imageGetTypeof, vips_buf_appendgv().

getBands

imageGetBands Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Int32

Returns: the number of bands (channels) in the image.

No description available in the introspection data.

getBlob

imageGetBlob Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the metadata from

-> Text

name: metadata name

-> m (Int32, ByteString)

Returns: 0 on success, -1 otherwise.

Gets blob from image under the name name, optionally returns its length in length. A convenience function over imageGet. Use imageGetTypeof to test for the existence of a piece of metadata.

See also: imageGet, imageGetTypeof, blobGet,

getCoding

imageGetCoding Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Coding

Returns: the image coding

No description available in the introspection data.

getData

imageGetData Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get data for

-> m (Ptr ())

Returns: a pointer to pixel data, if possible.

Return a pointer to the image's pixel data, if possible. This can involve allocating large amounts of memory and performing a long computation. Image pixels are laid out in band-packed rows.

Since this function modifies image, it is not threadsafe. Only call it on images which you are sure have not been shared with another thread.

See also: imageWioInput, imageCopyMemory.

getDouble

imageGetDouble Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the header field from

-> Text

name: field name

-> m (Int32, Double)

Returns: 0 on success, -1 otherwise.

Gets out from im under the name name. The value will be transformed into a double, if possible.

See also: imageGet, imageGetTypeof

getFields

imageGetFields Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get fields from

-> m [Text]

Returns: metadata fields in image, as a Nothing-terminated array.

Get a Nothing-terminated array listing all the metadata field names on image. Free the return result with strfreev.

This is handy for language bindings. From C, it's usually more convenient to use imageMap.

getFilename

imageGetFilename Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Text

Returns: the name of the file the image was loaded from, or NULL if there is no filename.

No description available in the introspection data.

getFormat

imageGetFormat Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m BandFormat

Returns: the format of each band element.

No description available in the introspection data.

getFormatMax

imageGetFormatMax Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BandFormat

format: the format

-> m Double

Returns: the maximum numeric value possible for this format.

No description available in the introspection data.

getHeight

imageGetHeight Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Int32

Returns: the number of pixels down the image.

No description available in the introspection data.

getHistory

imageGetHistory Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: get history from here

-> m Text

Returns: The history of image as a C string. Do not free!

This function reads the image history as a C string. The string is owned by VIPS and must not be freed.

VIPS tracks the history of each image, that is, the sequence of operations that generated that image. Applications built on VIPS need to call vips_image_history_printf() for each action they perform, setting the command-line equivalent for the action.

See also: vips_image_history_printf().

getImage

imageGetImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the metadata from

-> Text

name: metadata name

-> m (Int32, Image)

Returns: 0 on success, -1 otherwise.

Gets out from im under the name name. The field must be of type VIPS_TYPE_IMAGE. You must unref out with objectUnref.

Use imageGetTypeof to test for the existence of a piece of metadata.

See also: imageGet, imageSetImage

getInt

imageGetInt Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the header field from

-> Text

name: field name

-> m (Int32, Int32)

Returns: 0 on success, -1 otherwise.

Gets out from im under the name name. The value will be transformed into an int, if possible.

See also: imageGet, imageGetTypeof

getInterpretation

imageGetInterpretation Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Interpretation

Returns: the Interpretation from the image header.

Return the Interpretation set in the image header. Use imageGuessInterpretation if you want a sanity-checked value.

getMode

imageGetMode Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Text

Returns: the image mode.

Image modes are things like "t", meaning a memory buffer, and "p" meaning a delayed computation.

getNPages

imageGetNPages Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Int32

Returns: the number of pages in the image file

Fetch and sanity-check META_N_PAGES. Default to 1 if not present or crazy.

This is the number of pages in the image file, not the number of pages that have been loaded into image.

getNSubifds

imageGetNSubifds Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Int32

Returns: the number of subifds in the image file

Fetch and sanity-check META_N_SUBIFDS. Default to 0 if not present or crazy.

getOffset

imageGetOffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Double

Returns: the offset.

Matrix images can have an optional offset field for use by integer convolution.

getOrientation

imageGetOrientation Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Int32

Returns: the image orientation.

Fetch and sanity-check META_ORIENTATION. Default to 1 (no rotate, no flip) if not present or crazy.

getOrientationSwap

imageGetOrientationSwap Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Bool

Returns: if width/height will swap

Return True if applying the orientation would swap width and height.

getPageHeight

imageGetPageHeight Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Int32

Returns: the page height.

Multi-page images can have a page height. Fetch it, and sanity check it. If page-height is not set, it defaults to the image height.

getScale

imageGetScale Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Double

Returns: the scale.

Matrix images can have an optional scale field for use by integer convolution.

getString

imageGetString Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the header field from

-> Text

name: field name

-> m (Int32, Text)

Returns: 0 on success, -1 otherwise.

Gets out from im under the name name. The field must be of type G_TYPE_STRING, VIPS_TYPE_REF_STRING.

Do not free out.

Use imageGetAsString to fetch any field as a string.

See also: imageGet, imageGetTypeof

getTypeof

imageGetTypeof Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to test

-> Text

name: the name to search for

-> m GType

Returns: the GType of the field, or zero if there is no field of that name.

Read the GType for a header field. Returns zero if there is no field of that name.

See also: imageGet.

getWidth

imageGetWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Int32

Returns: the number of pixels across the image.

No description available in the introspection data.

getXoffset

imageGetXoffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Int32

Returns: the horizontal position of the image origin, in pixels.

No description available in the introspection data.

getXres

imageGetXres Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Double

Returns: the horizontal image resolution in pixels per millimeter.

No description available in the introspection data.

getYoffset

imageGetYoffset Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Int32

Returns: the vertical position of the image origin, in pixels.

No description available in the introspection data.

getYres

imageGetYres Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get from

-> m Double

Returns: the vertical image resolution in pixels per millimeter.

No description available in the introspection data.

guessFormat

imageGuessFormat Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to guess for

-> m BandFormat

Returns: a sensible BandFormat for the image.

Return the BandFormat for an image, guessing a sane value if the set value looks crazy.

For example, for a float image tagged as rgb16, we'd return ushort.

guessInterpretation

imageGuessInterpretation Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to guess for

-> m Interpretation

Returns: a sensible Interpretation for the image.

Return the Interpretation for an image, guessing a sane value if the set value looks crazy.

hasalpha

imageHasalpha Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to check

-> m Bool 

Look at an image's interpretation and see if it has extra alpha bands. For example, a 4-band VIPS_INTERPRETATION_sRGB would, but a six-band VIPS_INTERPRETATION_MULTIBAND would not.

Return True if image has an alpha channel.

historyArgs

imageHistoryArgs Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to attach history line to

-> Text

name: program name

-> [Text]

argv: program arguments

-> m Int32

Returns: 0 on success, -1 on error.

Formats the name/argv as a single string and calls vips_image_history_printf(). A convenience function for command-line prorams.

See also: imageGetHistory.

iccAc2rc

imageIccAc2rc Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

in: input image

-> Text

profileFilename: use this profile

-> m (Int32, Image)

Returns: 0 on success, -1 on error.

Transform an image from absolute to relative colorimetry using the MediaWhitePoint stored in the ICC profile.

See also: vips_icc_transform(), vips_icc_import().

initFields

imageInitFields Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to init

-> Int32

xsize: image width

-> Int32

ysize: image height

-> Int32

bands: image bands

-> BandFormat

format: band format

-> Coding

coding: image coding

-> Interpretation

interpretation: image type

-> Double

xres: horizontal resolution, pixels per millimetre

-> Double

yres: vertical resolution, pixels per millimetre

-> m () 

A convenience function to set the header fields after creating an image. Normally you copy the fields from your input images with vips_image_pipelinev() and then make any adjustments you need, but if you are creating an image from scratch, for example vips_black() or vips_jpegload(), you do need to set all the fields yourself.

See also: vips_image_pipelinev().

inplace

imageInplace Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to make read-write

-> m Int32

Returns: 0 on succeess, or -1 on error.

Gets image ready for an in-place operation, such as vips_draw_circle(). After calling this function you can both read and write the image with VIPS_IMAGE_ADDR().

This method is called for you by the base class of the draw operations, there's no need to call it yourself.

Since this function modifies image, it is not thread-safe. Only call it on images which you are sure have not been shared with another thread. All in-place operations are inherently not thread-safe, so you need to take great care in any case.

See also: vips_draw_circle(), imageWioInput.

invalidateAll

imageInvalidateAll Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: Image to invalidate

-> m () 

Invalidate all pixel caches on image and any downstream images, that is, images which depend on this image. Additionally, all operations which depend upon this image are dropped from the VIPS operation cache.

You should call this function after destructively modifying an image with something like vips_draw_circle().

The Image::invalidate signal is emitted for all invalidated images.

See also: regionInvalidate.

isMSBfirst

imageIsMSBfirst Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to test

-> m Bool 

Return True if image is in most-significant- byte first form. This is the byte order used on the SPARC architecture and others.

isSequential

imageIsSequential Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: Image to minimise

-> m Bool

Returns: True if image is in sequential mode.

TRUE if any of the images upstream from image were opened in sequential mode. Some operations change behaviour slightly in sequential mode to optimize memory behaviour.

isfile

imageIsfile Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to test

-> m Bool 

Return True if image represents a file on disc in some way.

iskilled

imageIskilled Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to test

-> m Bool

Returns: True if image has been killed.

If image has been killed (see imageSetKill), set an error message, clear the Image.kill flag and return True. Otherwise return False.

Handy for loops which need to run sets of threads which can fail.

See also: imageSetKill.

ispartial

imageIspartial Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to test

-> m Bool 

Return True if im represents a partial image (a delayed calculation).

memory

imageMemory Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Image

Returns: the new Image, or Nothing on error.

A renamed vips_image_new_memory() ... Some gobject binding systems do not like more than one _new() method.

See also: vips_image_new_memory().

minimiseAll

imageMinimiseAll Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: Image to minimise

-> m () 

Minimise memory use on this image and any upstream images, that is, images which this image depends upon. This function is called automatically at the end of a computation, but it might be useful to call at other times.

The Image::minimise signal is emitted for all minimised images.

new

imageNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Image

Returns: the new Image, or Nothing on error.

imageNew creates a new, empty Image. If you write to one of these images, vips will just attach some callbacks, no pixels will be generated.

Write pixels to an image with vips_image_generate() or imageWriteLine. Write a whole image to another image with imageWrite.

newFromFileRW

imageNewFromFileRW Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

filename: filename to open

-> m Image

Returns: the new Image, or Nothing on error.

Opens the named file for simultaneous reading and writing. This will only work for VIPS files in a format native to your machine. It is only for paintbox-type applications.

See also: vips_draw_circle().

newFromFileRaw

imageNewFromFileRaw Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

filename: filename to open

-> Int32

xsize: image width

-> Int32

ysize: image height

-> Int32

bands: image bands (or bytes per pixel)

-> Word64

offset: bytes to skip at start of file

-> m Image

Returns: the new Image, or Nothing on error.

This function maps the named file and returns a Image you can use to read it.

It returns an 8-bit image with bands bands. If the image is not 8-bit, use vips_copy() to transform the descriptor after loading it.

See also: vips_copy(), vips_rawload(), vips_image_new_from_file().

newFromImage

imageNewFromImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to copy

-> [Double]

c: array of constants

-> m Image

Returns: the new Image, or Nothing on error.

Creates a new image with width, height, format, interpretation, resolution and offset taken from image, but with number of bands taken from n and the value of each band element set from c.

See also: imageNewFromImage1

newFromImage1

imageNewFromImage1 Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to copy

-> Double

c: constants

-> m Image

Returns: the new Image, or Nothing on error.

Creates a new image with width, height, format, interpretation, resolution and offset taken from image, but with one band and each pixel having the value c.

See also: imageNewFromImage

newFromMemory

imageNewFromMemory Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ByteString

data: start of memory area

-> Int32

width: image width

-> Int32

height: image height

-> Int32

bands: image bands (or bytes per pixel)

-> BandFormat

format: image format

-> m Image

Returns: the new Image, or Nothing on error.

This function wraps a Image around a memory area. The memory area must be a simple array, for example RGBRGBRGB, left-to-right, top-to-bottom. Use vips_image_new_from_buffer() to load an area of memory containing an image in a format.

VIPS does not take responsibility for the area of memory, it's up to you to make sure it's freed when the image is closed. See for example Object::close.

Because VIPS is "borrowing" data from the caller, this function is extremely dangerous. Unless you are very careful, you will get crashes or memory corruption. Use imageNewFromMemoryCopy instead if you are at all unsure.

Use vips_copy() to set other image properties.

See also: imageNew, imageWriteToMemory, imageNewFromMemoryCopy.

newFromMemoryCopy

imageNewFromMemoryCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ByteString

data: start of memory area

-> Int32

width: image width

-> Int32

height: image height

-> Int32

bands: image bands (or bytes per pixel)

-> BandFormat

format: image format

-> m Image

Returns: the new Image, or Nothing on error.

Like imageNewFromMemory, but VIPS will make a copy of the memory area. This means more memory use and an extra copy operation, but is much simpler and safer.

See also: imageNewFromMemory.

newMatrix

imageNewMatrix Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

width: image width

-> Int32

height: image height

-> m Image

Returns: the new Image, or Nothing on error.

This convenience function makes an image which is a matrix: a one-band VIPS_FORMAT_DOUBLE image held in memory.

Use VIPS_IMAGE_ADDR(), or VIPS_MATRIX() to address pixels in the image.

Use imageSetDouble to set "scale" and "offset", if required.

See also: vips_image_new_matrixv()

newMatrixFromArray

imageNewMatrixFromArray Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

width: image width

-> Int32

height: image height

-> [Double]

array: array of elements

-> m Image

Returns: the new Image, or Nothing on error.

A binding-friendly version of vips_image_new_matrixv().

newTempFile

imageNewTempFile Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

format: format of file

-> m Image

Returns: the new Image, or Nothing on error.

Make a Image which, when written to, will create a temporary file on disc. The file will be automatically deleted when the image is destroyed. format is something like "%s.v" for a vips file.

The file is created in the temporary directory. This is set with the environment variable TMPDIR. If this is not set, then on Unix systems, vips will default to /tmp. On Windows, vips uses GetTempPath() to find the temporary directory.

See also: imageNew.

pioInput

imagePioInput Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to check

-> m Int32

Returns: 0 on succeess, or -1 on error.

Check that an image is readable with regionPrepare and friends. If it isn't, try to transform the image so that regionPrepare can work.

See also: imagePioOutput, regionPrepare.

pioOutput

imagePioOutput Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to check

-> m Int32

Returns: 0 on succeess, or -1 on error.

Check that an image is writeable with vips_image_generate(). If it isn't, try to transform the image so that vips_image_generate() can work.

See also: imagePioInput.

printField

imagePrintField Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to get the header field from

-> Text

name: field name

-> m () 

Prints field name to stdout as ASCII. Handy for debugging.

remove

imageRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to test

-> Text

name: the name to search for

-> m Bool

Returns: True if an item of metadata of that name was found and removed

Find and remove an item of metadata. Return False if no metadata of that name was found.

See also: imageSet, imageGetTypeof.

reorderMarginHint

imageReorderMarginHint Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: the image to hint on

-> Int32

margin: the size of the margin this operation has added

-> m () 

imageReorderMarginHint sets a hint that image contains a margin, that is, that each regionPrepare on image will request a slightly larger region from it's inputs. A good value for margin is (width * height) for the window the operation uses.

This information is used by vips_image_prepare_many() to attempt to reorder computations to minimise recomputation.

See also: vips_image_prepare_many().

reorderPrepareMany

imageReorderPrepareMany Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: the image that's being written

-> [Region]

regions: the set of regions to prepare

-> Rect

r: the Rect to prepare on each region

-> m Int32

Returns: 0 on success, or -1 on error.

imageReorderPrepareMany runs regionPrepare on each region in regions, requesting the pixels in r.

It tries to request the regions in the order which will cause least recomputation. This can give a large speedup, in some cases.

See also: regionPrepare, imageReorderMarginHint.

set

imageSet Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to set the metadata on

-> Text

name: the name to give the metadata

-> GValue

value: the GValue to copy into the image

-> m () 

Set a piece of metadata on image. Any old metadata with that name is destroyed. The GValue is copied into the image, so you need to unset the value when you're done with it.

For example, to set an integer on an image (though you would use the convenience function imageSetInt in practice), you would do:

GValue value = { 0 };

g_value_init (&value, G_TYPE_INT);
g_value_set_int (&value, 42);
vips_image_set (image, name, &value);
g_value_unset (&value);

See also: imageGet.

setArea

imageSetArea Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to attach the metadata to

-> Text

name: metadata name

-> CallbackFn

freeFn: free function for data

-> m () 

Attaches data as a metadata item on image under the name name. When VIPS no longer needs the metadata, it will be freed with freeFn.

See also: imageGetDouble, imageSet

setArrayDouble

imageSetArrayDouble Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to attach the metadata to

-> Text

name: metadata name

-> Maybe [Double]

array: array of doubles

-> m () 

Attaches array as a metadata item on image as name. A convenience function over imageSet.

See also: imageGetImage, imageSet.

setArrayInt

imageSetArrayInt Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to attach the metadata to

-> Text

name: metadata name

-> Maybe [Int32]

array: array of ints

-> m () 

Attaches array as a metadata item on image as name. A convenience function over imageSet.

See also: imageGetImage, imageSet.

setBlob

imageSetBlob Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to attach the metadata to

-> Text

name: metadata name

-> CallbackFn

freeFn: free function for data

-> ByteString

data: pointer to area of memory

-> m () 

Attaches blob as a metadata item on image under the name name. A convenience function over imageSet using a vips_blob.

See also: imageGetBlob, imageSet.

setBlobCopy

imageSetBlobCopy Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to attach the metadata to

-> Text

name: metadata name

-> ByteString

data: pointer to area of memory

-> m () 

Attaches blob as a metadata item on image under the name name, taking a copy of the memory area. A convenience function over imageSetBlob.

See also: imageGetBlob, imageSet.

setDeleteOnClose

imageSetDeleteOnClose Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to set

-> Bool

deleteOnClose: format of file

-> m () 

Sets the delete_on_close flag for the image. If this flag is set, when image is finalized, the filename held in image->filename at the time of this call is deleted.

This function is clearly extremely dangerous, use with great caution.

See also: imageNewTempFile.

setDouble

imageSetDouble Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to attach the metadata to

-> Text

name: metadata name

-> Double

d: metadata value

-> m () 

Attaches d as a metadata item on image as name. A convenience function over imageSet.

See also: imageGetDouble, imageSet

setImage

imageSetImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a, IsImage b) 
=> a

image: image to attach the metadata to

-> Text

name: metadata name

-> b

im: metadata value

-> m () 

Attaches im as a metadata item on image as name. A convenience function over imageSet.

See also: imageGetImage, imageSet.

setInt

imageSetInt Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to attach the metadata to

-> Text

name: metadata name

-> Int32

i: metadata value

-> m () 

Attaches i as a metadata item on image under the name name. A convenience function over imageSet.

See also: imageGetInt, imageSet

setKill

imageSetKill Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to test

-> Bool

kill: the kill state

-> m () 

Set the Image.kill flag on an image. Handy for stopping sets of threads.

See also: imageIskilled.

setProgress

imageSetProgress Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to signal progress on

-> Bool

progress: turn progress reporting on or off

-> m () 

vips signals evaluation progress via the Image::preeval, Image::eval and Image::posteval signals. Progress is signalled on the most-downstream image for which imageSetProgress was called.

setString

imageSetString Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to attach the metadata to

-> Text

name: metadata name

-> Text

str: metadata value

-> m () 

Attaches str as a metadata item on image as name. A convenience function over imageSet using VIPS_TYPE_REF_STRING.

See also: imageGetDouble, imageSet.

wioInput

imageWioInput Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to transform

-> m Int32

Returns: 0 on succeess, or -1 on error.

Check that an image is readable via the VIPS_IMAGE_ADDR() macro, that is, that the entire image is in memory and all pixels can be read with VIPS_IMAGE_ADDR(). If it isn't, try to transform it so that VIPS_IMAGE_ADDR() can work.

Since this function modifies image, it is not thread-safe. Only call it on images which you are sure have not been shared with another thread. If the image might have been shared, use the less efficient imageCopyMemory instead.

See also: imageCopyMemory, imagePioInput, imageInplace, VIPS_IMAGE_ADDR().

write

imageWrite Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to write

-> m (Int32, Image)

Returns: 0 on success, or -1 on error.

Write image to out. Use imageNew and friends to create the Image you want to write to.

See also: imageNew, vips_copy(), vips_image_write_to_file().

writeLine

imageWriteLine Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to write to

-> Int32

ypos: vertical position of scan-line to write

-> Word8

linebuffer: scanline of pixels

-> m Int32

Returns: 0 on success, or -1 on error.

Write a line of pixels to an image. This function must be called repeatedly with ypos increasing from 0 to Image::height . linebuffer must be VIPS_IMAGE_SIZEOF_LINE() bytes long.

See also: vips_image_generate().

writePrepare

imageWritePrepare Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

image: image to prepare

-> m Int32

Returns: 0 on success, or -1 on error.

Call this after setting header fields (width, height, and so on) to allocate resources ready for writing.

Normally this function is called for you by vips_image_generate() or imageWriteLine. You will need to call it yourself if you plan to write directly to the ->data member of a memory image.

writeToMemory

imageWriteToMemory Source #

Arguments

:: (HasCallStack, MonadIO m, IsImage a) 
=> a

in: image to write

-> m ByteString

Returns: return buffer start here

Writes in to memory as a simple, unformatted C-style array.

The caller is responsible for freeing this memory with free.

See also: vips_image_write_to_buffer().

Properties

bands

No description available in the introspection data.

constructImageBands :: (IsImage o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “bands” property. This is rarely needed directly, but it is used by new.

getImageBands :: (MonadIO m, IsImage o) => o -> m Int32 Source #

Get the value of the “bands” property. When overloading is enabled, this is equivalent to

get image #bands

setImageBands :: (MonadIO m, IsImage o) => o -> Int32 -> m () Source #

Set the value of the “bands” property. When overloading is enabled, this is equivalent to

set image [ #bands := value ]

coding

No description available in the introspection data.

constructImageCoding :: (IsImage o, MonadIO m) => Coding -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “coding” property. This is rarely needed directly, but it is used by new.

getImageCoding :: (MonadIO m, IsImage o) => o -> m Coding Source #

Get the value of the “coding” property. When overloading is enabled, this is equivalent to

get image #coding

setImageCoding :: (MonadIO m, IsImage o) => o -> Coding -> m () Source #

Set the value of the “coding” property. When overloading is enabled, this is equivalent to

set image [ #coding := value ]

demand

No description available in the introspection data.

constructImageDemand :: (IsImage o, MonadIO m) => DemandStyle -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “demand” property. This is rarely needed directly, but it is used by new.

getImageDemand :: (MonadIO m, IsImage o) => o -> m DemandStyle Source #

Get the value of the “demand” property. When overloading is enabled, this is equivalent to

get image #demand

setImageDemand :: (MonadIO m, IsImage o) => o -> DemandStyle -> m () Source #

Set the value of the “demand” property. When overloading is enabled, this is equivalent to

set image [ #demand := value ]

filename

No description available in the introspection data.

clearImageFilename :: (MonadIO m, IsImage o) => o -> m () Source #

Set the value of the “filename” property to Nothing. When overloading is enabled, this is equivalent to

clear #filename

constructImageFilename :: (IsImage o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “filename” property. This is rarely needed directly, but it is used by new.

getImageFilename :: (MonadIO m, IsImage o) => o -> m Text Source #

Get the value of the “filename” property. When overloading is enabled, this is equivalent to

get image #filename

setImageFilename :: (MonadIO m, IsImage o) => o -> Text -> m () Source #

Set the value of the “filename” property. When overloading is enabled, this is equivalent to

set image [ #filename := value ]

foreignBuffer

No description available in the introspection data.

constructImageForeignBuffer :: (IsImage o, MonadIO m) => Ptr () -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “foreign-buffer” property. This is rarely needed directly, but it is used by new.

getImageForeignBuffer :: (MonadIO m, IsImage o) => o -> m (Ptr ()) Source #

Get the value of the “foreign-buffer” property. When overloading is enabled, this is equivalent to

get image #foreignBuffer

setImageForeignBuffer :: (MonadIO m, IsImage o) => o -> Ptr () -> m () Source #

Set the value of the “foreign-buffer” property. When overloading is enabled, this is equivalent to

set image [ #foreignBuffer := value ]

format

No description available in the introspection data.

constructImageFormat :: (IsImage o, MonadIO m) => BandFormat -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “format” property. This is rarely needed directly, but it is used by new.

getImageFormat :: (MonadIO m, IsImage o) => o -> m BandFormat Source #

Get the value of the “format” property. When overloading is enabled, this is equivalent to

get image #format

setImageFormat :: (MonadIO m, IsImage o) => o -> BandFormat -> m () Source #

Set the value of the “format” property. When overloading is enabled, this is equivalent to

set image [ #format := value ]

height

No description available in the introspection data.

constructImageHeight :: (IsImage o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “height” property. This is rarely needed directly, but it is used by new.

getImageHeight :: (MonadIO m, IsImage o) => o -> m Int32 Source #

Get the value of the “height” property. When overloading is enabled, this is equivalent to

get image #height

setImageHeight :: (MonadIO m, IsImage o) => o -> Int32 -> m () Source #

Set the value of the “height” property. When overloading is enabled, this is equivalent to

set image [ #height := value ]

interpretation

No description available in the introspection data.

constructImageInterpretation :: (IsImage o, MonadIO m) => Interpretation -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “interpretation” property. This is rarely needed directly, but it is used by new.

getImageInterpretation :: (MonadIO m, IsImage o) => o -> m Interpretation Source #

Get the value of the “interpretation” property. When overloading is enabled, this is equivalent to

get image #interpretation

setImageInterpretation :: (MonadIO m, IsImage o) => o -> Interpretation -> m () Source #

Set the value of the “interpretation” property. When overloading is enabled, this is equivalent to

set image [ #interpretation := value ]

kill

No description available in the introspection data.

constructImageKill :: (IsImage o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “kill” property. This is rarely needed directly, but it is used by new.

getImageKill :: (MonadIO m, IsImage o) => o -> m Bool Source #

Get the value of the “kill” property. When overloading is enabled, this is equivalent to

get image #kill

setImageKill :: (MonadIO m, IsImage o) => o -> Bool -> m () Source #

Set the value of the “kill” property. When overloading is enabled, this is equivalent to

set image [ #kill := value ]

mode

No description available in the introspection data.

clearImageMode :: (MonadIO m, IsImage o) => o -> m () Source #

Set the value of the “mode” property to Nothing. When overloading is enabled, this is equivalent to

clear #mode

constructImageMode :: (IsImage o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “mode” property. This is rarely needed directly, but it is used by new.

getImageMode :: (MonadIO m, IsImage o) => o -> m Text Source #

Get the value of the “mode” property. When overloading is enabled, this is equivalent to

get image #mode

setImageMode :: (MonadIO m, IsImage o) => o -> Text -> m () Source #

Set the value of the “mode” property. When overloading is enabled, this is equivalent to

set image [ #mode := value ]

sizeofHeader

No description available in the introspection data.

constructImageSizeofHeader :: (IsImage o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “sizeof-header” property. This is rarely needed directly, but it is used by new.

getImageSizeofHeader :: (MonadIO m, IsImage o) => o -> m Word64 Source #

Get the value of the “sizeof-header” property. When overloading is enabled, this is equivalent to

get image #sizeofHeader

setImageSizeofHeader :: (MonadIO m, IsImage o) => o -> Word64 -> m () Source #

Set the value of the “sizeof-header” property. When overloading is enabled, this is equivalent to

set image [ #sizeofHeader := value ]

width

No description available in the introspection data.

constructImageWidth :: (IsImage o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “width” property. This is rarely needed directly, but it is used by new.

getImageWidth :: (MonadIO m, IsImage o) => o -> m Int32 Source #

Get the value of the “width” property. When overloading is enabled, this is equivalent to

get image #width

setImageWidth :: (MonadIO m, IsImage o) => o -> Int32 -> m () Source #

Set the value of the “width” property. When overloading is enabled, this is equivalent to

set image [ #width := value ]

xoffset

No description available in the introspection data.

constructImageXoffset :: (IsImage o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “xoffset” property. This is rarely needed directly, but it is used by new.

getImageXoffset :: (MonadIO m, IsImage o) => o -> m Int32 Source #

Get the value of the “xoffset” property. When overloading is enabled, this is equivalent to

get image #xoffset

setImageXoffset :: (MonadIO m, IsImage o) => o -> Int32 -> m () Source #

Set the value of the “xoffset” property. When overloading is enabled, this is equivalent to

set image [ #xoffset := value ]

xres

No description available in the introspection data.

constructImageXres :: (IsImage o, MonadIO m) => Double -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “xres” property. This is rarely needed directly, but it is used by new.

getImageXres :: (MonadIO m, IsImage o) => o -> m Double Source #

Get the value of the “xres” property. When overloading is enabled, this is equivalent to

get image #xres

setImageXres :: (MonadIO m, IsImage o) => o -> Double -> m () Source #

Set the value of the “xres” property. When overloading is enabled, this is equivalent to

set image [ #xres := value ]

yoffset

No description available in the introspection data.

constructImageYoffset :: (IsImage o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “yoffset” property. This is rarely needed directly, but it is used by new.

getImageYoffset :: (MonadIO m, IsImage o) => o -> m Int32 Source #

Get the value of the “yoffset” property. When overloading is enabled, this is equivalent to

get image #yoffset

setImageYoffset :: (MonadIO m, IsImage o) => o -> Int32 -> m () Source #

Set the value of the “yoffset” property. When overloading is enabled, this is equivalent to

set image [ #yoffset := value ]

yres

No description available in the introspection data.

constructImageYres :: (IsImage o, MonadIO m) => Double -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “yres” property. This is rarely needed directly, but it is used by new.

getImageYres :: (MonadIO m, IsImage o) => o -> m Double Source #

Get the value of the “yres” property. When overloading is enabled, this is equivalent to

get image #yres

setImageYres :: (MonadIO m, IsImage o) => o -> Double -> m () Source #

Set the value of the “yres” property. When overloading is enabled, this is equivalent to

set image [ #yres := value ]

Signals

eval

type ImageEvalCallback Source #

Arguments

 = Progress

progress: Progress for this image

-> IO () 

The eval signal is emitted once per work unit (typically a 128 x 128 area of pixels) during image computation.

You can use this signal to update user-interfaces with progress feedback. Beware of updating too frequently: you will usually need some throttling mechanism.

Use imageSetProgress to turn on progress reporting for an image.

afterImageEval :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImageEvalCallback) -> m SignalHandlerId Source #

Connect a signal handler for the eval signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after image #eval callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onImageEval :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImageEvalCallback) -> m SignalHandlerId Source #

Connect a signal handler for the eval signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on image #eval callback

invalidate

type ImageInvalidateCallback = IO () Source #

The invalidate signal is emitted when an image or one of it's upstream data sources has been destructively modified. See imageInvalidateAll.

afterImageInvalidate :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImageInvalidateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the invalidate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after image #invalidate callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onImageInvalidate :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImageInvalidateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the invalidate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on image #invalidate callback

minimise

type ImageMinimiseCallback = IO () Source #

The minimise signal is emitted when an image has been asked to minimise memory usage. All non-essential caches are dropped. See imageMinimiseAll.

afterImageMinimise :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImageMinimiseCallback) -> m SignalHandlerId Source #

Connect a signal handler for the minimise signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after image #minimise callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onImageMinimise :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImageMinimiseCallback) -> m SignalHandlerId Source #

Connect a signal handler for the minimise signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on image #minimise callback

posteval

type ImagePostevalCallback Source #

Arguments

 = Progress

progress: Progress for this image

-> IO () 

The posteval signal is emitted once at the end of the computation of image. It's a good place to shut down evaluation feedback.

Use imageSetProgress to turn on progress reporting for an image.

afterImagePosteval :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImagePostevalCallback) -> m SignalHandlerId Source #

Connect a signal handler for the posteval signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after image #posteval callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onImagePosteval :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImagePostevalCallback) -> m SignalHandlerId Source #

Connect a signal handler for the posteval signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on image #posteval callback

preeval

type ImagePreevalCallback Source #

Arguments

 = Progress

progress: Progress for this image

-> IO () 

The preeval signal is emitted once before computation of image starts. It's a good place to set up evaluation feedback.

Use imageSetProgress to turn on progress reporting for an image.

afterImagePreeval :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImagePreevalCallback) -> m SignalHandlerId Source #

Connect a signal handler for the preeval signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after image #preeval callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onImagePreeval :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImagePreevalCallback) -> m SignalHandlerId Source #

Connect a signal handler for the preeval signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on image #preeval callback

written

type ImageWrittenCallback = IO Int32 Source #

The written signal is emitted just after an image has been written to. It is used by vips to implement things like write to foreign file formats.

afterImageWritten :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImageWrittenCallback) -> m SignalHandlerId Source #

Connect a signal handler for the written signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after image #written callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onImageWritten :: (IsImage a, MonadIO m) => a -> ((?self :: a) => ImageWrittenCallback) -> m SignalHandlerId Source #

Connect a signal handler for the written signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on image #written callback