gi-vips-8.0.2: 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.Functions

Contents

Description

 
Synopsis

Methods

addOptionEntries

addOptionEntries Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> OptionGroup

optionGroup: group to add to

-> m () 

Add the standard vips GOptionEntry to a GOptionGroup.

See also: optionGroupNew.

cacheDropAll

cacheDropAll :: (HasCallStack, MonadIO m) => m () Source #

Drop the whole operation cache, handy for leak tracking. Also called automatically on shutdown.

cacheGetMax

cacheGetMax Source #

Arguments

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

Returns: the maximum number of operations we keep in cache

Get the maximum number of operations we keep in cache.

cacheGetMaxFiles

cacheGetMaxFiles Source #

Arguments

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

Returns: the maximum number of tracked files we allow

Get the maximum number of tracked files we allow before we start dropping cached operations. See trackedGetFiles.

libvips only tracks file descriptors it allocates, it can't track ones allocated by external libraries. If you use an operation like vips_magickload(), most of the descriptors it uses won't be included.

See also: trackedGetFiles.

cacheGetMaxMem

cacheGetMaxMem Source #

Arguments

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

Returns: the maximum amount of tracked memory we allow

Get the maximum amount of tracked memory we allow before we start dropping cached operations. See trackedGetMem.

See also: trackedGetMem.

cacheGetSize

cacheGetSize Source #

Arguments

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

Returns: get the current number of operations in cache.

Get the current number of operations in cache.

cacheOperationAdd

cacheOperationAdd Source #

Arguments

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

operation: pointer to operation to add

-> m () 

Add a built operation to the cache. The cache will ref the operation.

cacheOperationBuild

cacheOperationBuild Source #

Arguments

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

operation: operation to lookup

-> m Operation

Returns: The built operation.

A binding-friendly version of vips_cache_operation_buildp().

After calling this, operation has the same ref count as when it went in, and the result must be freed with objectUnrefOutputs and objectUnref.

cacheOperationLookup

cacheOperationLookup Source #

Arguments

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

operation: pointer to operation to lookup

-> m Operation

Returns: the cache hit, if any.

Look up an unbuilt operation in the cache. If we get a hit, ref and return the old operation. If there's no hit, return NULL.

cachePrint

cachePrint :: (HasCallStack, MonadIO m) => m () Source #

Print the whole operation cache to stdout. Handy for debugging.

cacheSetDump

cacheSetDump Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Bool

dump: if True, dump the operation cache on exit

-> m () 

Handy for debugging. Print the operation cache to stdout just before exit.

See also: cacheSetTrace.

cacheSetMax

cacheSetMax Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

max: maximum number of operation to cache

-> m () 

Set the maximum number of operations we keep in cache.

cacheSetMaxFiles

cacheSetMaxFiles Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

maxFiles: max open files we allow

-> m () 

Set the maximum number of tracked files we allow before we start dropping cached operations. See trackedGetFiles.

See also: trackedGetFiles.

cacheSetMaxMem

cacheSetMaxMem Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word64

maxMem: maximum amount of tracked memory we use

-> m () 

Set the maximum amount of tracked memory we allow before we start dropping cached operations. See trackedGetMem.

libvips only tracks memory it allocates, it can't track memory allocated by external libraries. If you use an operation like vips_magickload(), most of the memory it uses won't be included.

See also: trackedGetMem.

cacheSetTrace

cacheSetTrace Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Bool

trace: if True, trace the operation cache

-> m () 

Handy for debugging. Print operation cache actions to stdout as we run.

You can set the environment variable VIPS_TRACE to turn this option on, or use the command-line flag --vips-cache-trace.

See also: cacheSetDump.

callArgv

callArgv :: (HasCallStack, MonadIO m, IsOperation a) => a -> Int32 -> Text -> m Int32 Source #

No description available in the introspection data.

callOptions

callOptions :: (HasCallStack, MonadIO m, IsOperation a) => OptionGroup -> a -> m () Source #

No description available in the introspection data.

check8or16

check8or16 Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image is 8 or 16-bit integer, signed or unsigned. Otherwise set an error message and return non-zero.

See also: vips_error().

checkBandno

checkBandno Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> Int32

bandno: band number

-> m Int32

Returns: 0 if OK, -1 otherwise.

bandno should be a valid band number (ie. 0 to im->Bands - 1), or can be -1, meaning all bands. If not, set an error message and return non-zero.

See also: vips_error().

checkBands

checkBands Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> Int32

bands: must have this many bands

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image has bands bands. Otherwise set an error message and return non-zero.

See also: vips_error().

checkBands1or3

checkBands1or3 Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image has either one or three bands. Otherwise set an error message and return non-zero.

See also: vips_error().

checkBands1orn

checkBands1orn Source #

Arguments

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

domain: the originating domain for the error message

-> a

im1: first image to check

-> b

im2: second image to check

-> m Int32

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

Check that the images have the same number of bands, or that one of the images has just 1 band. If not, set an error message and return non-zero.

See also: vips_error().

checkBands1ornUnary

checkBands1ornUnary Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> Int32

n: number of bands, or 1

-> m Int32

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

Check that an image has 1 or n bands. Handy for unary operations, cf. checkBands1orn. If not, set an error message and return non-zero.

See also: checkBands1orn.

checkBandsAtleast

checkBandsAtleast Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> Int32

bands: at least this many bands

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image has at least bands bands. Otherwise set an error message and return non-zero.

See also: vips_error().

checkBandsSame

checkBandsSame Source #

Arguments

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

domain: the originating domain for the error message

-> a

im1: first image to check

-> b

im2: second image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the images have the same number of bands. If not, set an error message and return non-zero.

See also: vips_error().

checkCoding

checkCoding Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> Coding

coding: required coding

-> m Int32

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

Check that the image has the required coding. If not, set an error message and return non-zero.

See also: vips_error().

checkCodingKnown

checkCodingKnown Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

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

Check that the image is uncoded, LABQ coded or RAD coded. If not, set an error message and return non-zero.

See also: vips_error().

checkCodingNoneorlabq

checkCodingNoneorlabq Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

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

Check that the image is uncoded or LABQ coded. If not, set an error message and return non-zero.

See also: vips_error().

checkCodingSame

checkCodingSame Source #

Arguments

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

domain: the originating domain for the error message

-> a

im1: first image to check

-> b

im2: second image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the images have the same coding. If not, set an error message and return non-zero.

See also: vips_error().

checkComplex

checkComplex Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image is complex. Otherwise set an error message and return non-zero.

See also: vips_error().

checkFormat

checkFormat Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> BandFormat

fmt: format to test for

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image has the specified format. Otherwise set an error message and return non-zero.

See also: vips_error().

checkFormatSame

checkFormatSame Source #

Arguments

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

domain: the originating domain for the error message

-> a

im1: first image to check

-> b

im2: second image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the images have the same format. If not, set an error message and return non-zero.

See also: vips_error().

checkHist

checkHist Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Histogram images must have width or height 1, and must not have more than 65536 elements. Return 0 if the image will pass as a histogram, or -1 and set an error message otherwise.

See also: vips_error().

checkInt

checkInt Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image is in one of the integer formats. Otherwise set an error message and return non-zero.

See also: vips_error().

checkMatrix

checkMatrix Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m (Int32, Image)

Returns: 0 if OK, -1 otherwise.

Matrix images must have width and height less than 100000 and have 1 band.

Return 0 if the image will pass as a matrix, or -1 and set an error message otherwise.

out is set to be im cast to double and stored in memory. Use VIPS_MATRIX() to address values in out.

You must unref out when you are done with it.

See also: VIPS_MATRIX(), vips_object_local()

checkMono

checkMono Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image has exactly one band. Otherwise set an error message and return non-zero.

See also: vips_error().

checkNoncomplex

checkNoncomplex Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image is not complex. Otherwise set an error message and return non-zero.

See also: vips_error().

checkOddsquare

checkOddsquare Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image is square and that the sides are odd. If not, set an error message and return non-zero.

See also: vips_error().

checkPrecisionIntfloat

checkPrecisionIntfloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

domain: the originating domain for the error message

-> Precision

precision: precision to check

-> m Int32

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

Check that prec image is either float or int. If not, set an error message and return non-zero.

See also: vips_error().

checkSeparable

checkSeparable Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Separable matrix images must have width or height 1. Return 0 if the image will pass, or -1 and set an error message otherwise.

See also: vips_error().

checkSizeSame

checkSizeSame Source #

Arguments

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

domain: the originating domain for the error message

-> a

im1: first image to check

-> b

im2: second image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the images have the same size. If not, set an error message and return non-zero.

See also: vips_error().

checkTwocomponents

checkTwocomponents Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image is has two "components", ie. is a one-band complex or a two-band non-complex. Otherwise set an error message and return non-zero.

See also: vips_error().

checkU8or16

checkU8or16 Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image is 8 or 16-bit unsigned integer. Otherwise set an error message and return non-zero.

See also: vips_error().

checkU8or16orf

checkU8or16orf Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image is 8 or 16-bit unsigned integer, or float. Otherwise set an error message and return non-zero.

See also: vips_error().

checkUint

checkUint Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image is in one of the unsigned integer formats. Otherwise set an error message and return non-zero.

See also: vips_error().

checkUintorf

checkUintorf Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that the image is unsigned int or float. Otherwise set an error message and return non-zero.

See also: vips_error().

checkUncoded

checkUncoded Source #

Arguments

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

domain: the originating domain for the error message

-> a

im: image to check

-> m Int32

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

Check that the image is not coded. If not, set an error message and return non-zero.

See also: vips_error().

checkVector

checkVector Source #

Arguments

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

domain: the originating domain for the error message

-> Int32

n: number of elements in vector

-> a

im: image to check against

-> m Int32

Returns: 0 if OK, -1 otherwise.

Operations with a vector constant need a 1-element vector, or a vector with the same number of elements as there are bands in the image.

See also: vips_error().

checkVectorLength

checkVectorLength Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

domain: the originating domain for the error message

-> Int32

n: number of elements in vector

-> Int32

len: number of elements vector should have

-> m Int32

Returns: 0 if OK, -1 otherwise.

Check that n == len.

See also: vips_error().

classFind

classFind Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

basename: name of base class

-> Text

nickname: search for a class with this nickname

-> m ObjectClass

Returns: the found class.

Search below basename, return the first class whose name or nickname matches.

See also: typeFind

colAb2Ch

colAb2Ch :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> m () Source #

No description available in the introspection data.

colAb2h

colAb2h Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Double

a: CIE a

-> Double

b: CIE b

-> m Double

Returns: Hue (degrees)

No description available in the introspection data.

colC2Ccmc

colC2Ccmc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

c_: Chroma

-> m Float

Returns: Ccmc.

Calculate Ccmc from C.

colCcmc2C

colCcmc2C Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

ccmc: Ccmc

-> m Float

Returns: C.

Calculate C from Ccmc using a table. Call colMakeTablesCMC at least once before using this function.

colCh2ab

colCh2ab Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

c_: Chroma

-> Float

h: Hue angle (degrees)

-> Float

a: return CIE a* value

-> Float

b: return CIE b* value

-> m () 

Calculate ab from Ch, h in degrees.

colCh2hcmc

colCh2hcmc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

c_: Chroma

-> Float

h: Hue (degrees)

-> m Float

Returns: hcmc.

Calculate hcmc from C and h.

colChcmc2h

colChcmc2h Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

c_: Chroma

-> Float

hcmc: Hue cmc (degrees)

-> m Float

Returns: h.

Calculate h from C and hcmc, using a table. Call colMakeTablesCMC at least once before using this function.

colDE00

colDE00 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

l1: Input coordinate 1

-> Float

a1: Input coordinate 1

-> Float

b1: Input coordinate 1

-> Float

l2: Input coordinate 2

-> Float

a2: Input coordinate 2

-> Float

b2: Input coordinate 2

-> m Float

Returns: CIE dE2000 colour difference.

CIEDE2000, from:

Luo, Cui, Rigg, "The Development of the CIE 2000 Colour-Difference Formula: CIEDE2000", COLOR research and application, pp 340

colL2Lcmc

colL2Lcmc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

l_: CIE L*

-> m Float

Returns: Lcmc

Calculate Lcmc from L.

colLab2XYZ

colLab2XYZ Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

l_: Input CIE Lab value

-> Float

a: Input CIE Lab value

-> Float

b: Input CIE Lab value

-> m (Float, Float, Float) 

Calculate XYZ from Lab, D65.

See also: vips_Lab2XYZ().

colLcmc2L

colLcmc2L Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

lcmc: L cmc

-> m Float

Returns: L*

Calculate L from Lcmc using a table. Call colMakeTablesCMC at least once before using this function.

colMakeTablesCMC

colMakeTablesCMC :: (HasCallStack, MonadIO m) => m () Source #

Make the lookup tables for cmc.

colSRGB2scRGB16

colSRGB2scRGB16 :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> Int32 -> Float -> Float -> Float -> m Int32 Source #

No description available in the introspection data.

colSRGB2scRGB8

colSRGB2scRGB8 :: (HasCallStack, MonadIO m) => Int32 -> Int32 -> Int32 -> Float -> Float -> Float -> m Int32 Source #

No description available in the introspection data.

colScRGB2BW16

colScRGB2BW16 :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Int32 -> Int32 -> m Int32 Source #

No description available in the introspection data.

colScRGB2BW8

colScRGB2BW8 :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Int32 -> Int32 -> m Int32 Source #

No description available in the introspection data.

colScRGB2XYZ

colScRGB2XYZ :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> Float -> Float -> m Int32 Source #

No description available in the introspection data.

colScRGB2sRGB16

colScRGB2sRGB16 :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Int32 -> Int32 -> Int32 -> Int32 -> m Int32 Source #

No description available in the introspection data.

colScRGB2sRGB8

colScRGB2sRGB8 :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Int32 -> Int32 -> Int32 -> Int32 -> m Int32 Source #

No description available in the introspection data.

colXYZ2Lab

colXYZ2Lab Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

x_: Input CIE XYZ colour

-> Float

y_: Input CIE XYZ colour

-> Float

z_: Input CIE XYZ colour

-> Float

l_: Return CIE Lab value

-> Float

a: Return CIE Lab value

-> Float

b: Return CIE Lab value

-> m () 

Calculate XYZ from Lab, D65.

See also: vips_XYZ2Lab().

colXYZ2scRGB

colXYZ2scRGB :: (HasCallStack, MonadIO m) => Float -> Float -> Float -> Float -> Float -> Float -> m Int32 Source #

No description available in the introspection data.

colourspaceIssupported

colourspaceIssupported 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.

concurrencyGet

concurrencyGet Source #

Arguments

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

Returns: number of worker threads to use.

Returns the number of worker threads that vips should use when running a VipsThreadPool.

vips gets this values from these sources in turn:

If concurrencySet has been called, this value is used. The special value 0 means "default". You can also use the command-line argument "--vips-concurrency" to set this value.

If concurrencySet has not been called and no command-line argument was used, vips uses the value of the environment variable VIPS_CONCURRENCY,

If VIPS_CONCURRENCY has not been set, vips finds the number of hardware threads that the host machine can run in parallel and uses that value.

The final value is clipped to the range 1 - 1024.

See also: concurrencyGet.

concurrencySet

concurrencySet Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

concurrency: number of threads to run

-> m () 

Sets the number of worker threads that vips should use when running a VipsThreadPool.

The special value 0 means "default". In this case, the number of threads is set by the environment variable VIPS_CONCURRENCY, or if that is not set, the number of threads available on the host machine.

See also: concurrencyGet.

errorBuffer

errorBuffer Source #

Arguments

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

Returns: the error buffer as a C string which must not be freed

Get a pointer to the start of the error buffer as a C string. The string is owned by the error system and must not be freed.

See also: errorClear.

errorBufferCopy

errorBufferCopy Source #

Arguments

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

Returns: a copy of the libvips error buffer

Return a copy of the vips error buffer, and clear it.

errorClear

errorClear :: (HasCallStack, MonadIO m) => m () Source #

Clear and reset the error buffer. This is typically called after presenting an error to the user.

See also: errorBuffer.

errorFreeze

errorFreeze :: (HasCallStack, MonadIO m) => m () Source #

Stop errors being logged. Use errorThaw to unfreeze. You can nest freeze/thaw pairs.

errorG

errorG Source #

Arguments

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

(Can throw GError)

This function sets the glib error pointer from the vips error buffer and clears it. It's handy for returning errors to glib functions from vips.

See gError for the inverse operation.

See also: g_set_error(), gError.

errorThaw

errorThaw :: (HasCallStack, MonadIO m) => m () Source #

Reenable error logging.

filenameGetFilename

filenameGetFilename Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

vipsFilename: a filename including a set of options

-> m Text

Returns: transfer full: just the filename component.

Given a vips filename like "fred.jpg[Q=90]", return a new string of just the filename part, "fred.jpg" in this case.

Useful for language bindings.

See also: filenameGetOptions.

filenameGetOptions

filenameGetOptions Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

vipsFilename: a filename including a set of options

-> m Text

Returns: transfer full: just the options component.

Given a vips filename like "fred.jpg[Q=90]", return a new string of just the options part, "[Q=90]" in this case.

Useful for language bindings.

See also: filenameGetFilename.

foreignFlags

foreignFlags Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

loader: name of loader to use for test

-> Text

filename: file to test

-> m [ForeignFlags]

Returns: the flags for filename.

Return the flags for filename using loader. loader is something like "tiffload" or "VipsForeignLoadTiff".

formatSizeof

formatSizeof Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> BandFormat

format: format type

-> m Word64

Returns: number of bytes for a band format.

No description available in the introspection data.

gError

gError Source #

Arguments

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

(Can throw GError)

This function adds the GError to the vips error buffer and clears it. It's the opposite of errorG.

See also: errorG.

getArgv0

getArgv0 Source #

Arguments

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

Returns: a pointer to an internal copy of the argv0 string passed to VIPS_INIT(). Do not free this value

See also: VIPS_INIT().

getDiscThreshold

getDiscThreshold Source #

Arguments

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

Returns: disc threshold in bytes.

Return the number of bytes at which we flip between open via memory and open via disc. This defaults to 100mb, but can be changed with the VIPS_DISC_THRESHOLD environment variable or the --vips-disc-threshold command-line flag. See vips_image_new_from_file().

getPrgname

getPrgname Source #

Arguments

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

Returns: a pointer to an internal copy of the program name. Do not free this value

Return the program name. This can be useful for the user tio see,.

See also: VIPS_INIT().

guessLibdir

guessLibdir Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

argv0: program name (typically argv[0])

-> Text

envName: save prefix in this environment variable

-> m Text

Returns: the libdir as a static string, do not free.

guessLibdir tries to guess the install directory (usually the configure libdir, or $prefix/lib). You should pass in the value of argv[0] (the name your program was run as) as a clue to help it out, plus the name of the environment variable you let the user override your package install area with (eg. "VIPSHOME").

On success, guessLibdir returns the libdir it discovered, and as a side effect, sets the prefix environment variable (if it's not set).

Don't free the return string!

See also: guessPrefix.

guessPrefix

guessPrefix Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

argv0: program name (typically argv[0])

-> Text

envName: save prefix in this environment variable

-> m Text

Returns: the install prefix as a static string, do not free.

guessPrefix tries to guess the install directory. You should pass in the value of argv[0] (the name your program was run as) as a clue to help it out, plus the name of the environment variable you let the user override your package install area with (eg. "VIPSHOME").

On success, guessPrefix returns the prefix it discovered, and as a side effect, sets the environment variable (if it's not set).

Don't free the return string!

See also: guessLibdir.

iccIsCompatibleProfile

iccIsCompatibleProfile :: (HasCallStack, MonadIO m, IsImage a) => a -> Ptr () -> Word64 -> m Bool Source #

No description available in the introspection data.

iccPresent

iccPresent Source #

Arguments

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

Returns: non-zero if the ICC library is present.

VIPS can optionally be built without the ICC library. Use this function to test for its availability.

init

init Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

argv0: name of application

-> m Int32

Returns: 0 on success, -1 otherwise

This function starts up libvips, see VIPS_INIT().

This function is for bindings which need to start up vips. C programs should use the VIPS_INIT() macro, which does some extra checks.

See also: VIPS_INIT().

leakSet

leakSet Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Bool

leak: turn leak checking on or off

-> m () 

Turn on or off vips leak checking. See also --vips-leak, addOptionEntries and the VIPS_LEAK environment variable.

You should call this very early in your program.

malloc

malloc Source #

Arguments

:: (HasCallStack, MonadIO m, IsObject a) 
=> Maybe a

object: allocate memory local to this Object, or Nothing

-> Word64

size: number of bytes to allocate

-> m (Ptr ())

Returns: a pointer to the allocated memory.

malloc local to object, that is, the memory will be automatically freed for you when the object is closed. If object is Nothing, you need to free the memory explicitly with free.

This function cannot fail. See trackedMalloc if you are allocating large amounts of memory.

See also: trackedMalloc.

nicknameFind

nicknameFind Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GType

type: GType to search for

-> m Text

Returns: the class nickname.

Return the VIPS nickname for a GType. Handy for language bindings.

objectSetMember_

objectSetMember_ :: (HasCallStack, MonadIO m, IsObject a, IsObject b, IsObject c) => a -> GParamSpec -> b -> c -> m () Source #

No description available in the introspection data.

pathFilename7

pathFilename7 :: (HasCallStack, MonadIO m) => Text -> m Text Source #

No description available in the introspection data.

pathMode7

pathMode7 :: (HasCallStack, MonadIO m) => Text -> m Text Source #

No description available in the introspection data.

pythagoras

pythagoras Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Float

l1: Input coordinate 1

-> Float

a1: Input coordinate 1

-> Float

b1: Input coordinate 1

-> Float

l2: Input coordinate 2

-> Float

a2: Input coordinate 2

-> Float

b2: Input coordinate 2

-> m Float 

Pythagorean distance between two points in colour space. Lab/XYZ/CMC etc.

shutdown

shutdown :: (HasCallStack, MonadIO m) => m () Source #

Call this to drop caches and close plugins. Run with "--vips-leak" to do a leak check too.

You may call VIPS_INIT() many times and shutdown many times, but you must not call VIPS_INIT() after shutdown. In other words, you cannot stop and restart vips.

strdup

strdup Source #

Arguments

:: (HasCallStack, MonadIO m, IsObject a) 
=> Maybe a

object: allocate memory local to this Object, or Nothing

-> Text

str: string to copy

-> m Text

Returns: a pointer to the allocated memory

strdup a string. When object is freed, the string will be freed for you. If object is Nothing, you need to free the memory yourself with free.

This function cannot fail.

See also: malloc.

threadShutdown

threadShutdown :: (HasCallStack, MonadIO m) => m () Source #

Free any thread-private data and flush any profiling information.

This function needs to be called when a thread that has been using vips exits. It is called for you by shutdown and for any threads created within the VipsThreadPool.

You will need to call it from threads created in other ways or there will be memory leaks. If you do not call it, vips will generate a warning message.

It may be called many times, and you can continue using vips after calling it. Calling it too often will reduce performance.

trackedClose

trackedClose Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

fd: file to close()

-> m Int32

Returns: a file descriptor, or -1 on error.

Exactly as close(2), but update the number of files currently open via trackedGetFiles. This is used by the vips operation cache to drop cache when the number of files available is low.

You must only close file descriptors opened with trackedOpen.

See also: trackedOpen, trackedGetFiles.

trackedFree

trackedFree Source #

Arguments

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

s: memory to free

-> m () 

Only use it to free memory that was previously allocated with trackedMalloc with a Nothing first argument.

See also: trackedMalloc.

trackedGetAllocs

trackedGetAllocs Source #

Arguments

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

Returns: the number of active allocations

Returns the number of active allocations.

trackedGetFiles

trackedGetFiles Source #

Arguments

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

Returns: the number of open files

Returns the number of open files.

trackedGetMem

trackedGetMem Source #

Arguments

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

Returns: the number of currently allocated bytes

Returns the number of bytes currently allocated via malloc and friends. vips uses this figure to decide when to start dropping cache, see Operation.

trackedGetMemHighwater

trackedGetMemHighwater Source #

Arguments

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

Returns: the largest number of currently allocated bytes

Returns the largest number of bytes simultaneously allocated via trackedMalloc. Handy for estimating max memory requirements for a program.

trackedMalloc

trackedMalloc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word64

size: number of bytes to allocate

-> m (Ptr ())

Returns: a pointer to the allocated memory, or Nothing on error.

Allocate an area of memory that will be tracked by trackedGetMem and friends.

If allocation fails, malloc returns Nothing and sets an error message.

You must only free the memory returned with trackedFree.

See also: trackedFree, malloc.

trackedOpen

trackedOpen Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

pathname: name of file to open

-> Int32

flags: flags for open()

-> Int32

mode: open mode

-> m Int32

Returns: a file descriptor, or -1 on error.

Exactly as open(2), but the number of files currently open via trackedOpen is available via trackedGetFiles. This is used by the vips operation cache to drop cache when the number of files available is low.

You must only close the file descriptor with trackedClose.

pathname should be utf8.

See also: trackedClose, trackedGetFiles.

typeDepth

typeDepth :: (HasCallStack, MonadIO m) => GType -> m Int32 Source #

No description available in the introspection data.

typeFind

typeFind Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

basename: name of base class

-> Text

nickname: search for a class with this nickname

-> m GType

Returns: the GType of the class, or 0 if the class is not found.

Search below basename, return the GType of the class whose name or nickname matches, or 0 for not found. If basename is NULL, the whole of Object is searched.

This function uses a cache, so it should be quick.

See also: classFind

valueGetArea

valueGetArea Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: get from this value

-> Word64

length: optionally return length here

-> m (Ptr ())

Returns: The pointer held by value.

Get the pointer from an area. Don't touch count (area is static).

valueGetArray

valueGetArray Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: GValue to get from

-> Int32

n: return the number of elements here, optionally

-> GType

type: return the type of each element here, optionally

-> Word64

sizeofType: return the sizeof each element here, optionally

-> m (Ptr ())

Returns: The array address.

Return the pointer to the array held by value. Optionally return the other properties of the array in n, type, sizeofType.

See also: valueSetArray.

valueGetArrayDouble

valueGetArrayDouble Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: GValue to get from

-> Int32

n: return the number of elements here, optionally

-> m Double

Returns: The array address.

Return the start of the array of doubles held by value. optionally return the number of elements in n.

See also: arrayDoubleNew.

valueGetArrayImage

valueGetArrayImage Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: GValue to get from

-> Int32

n: return the number of elements here, optionally

-> m Image

Returns: The array address.

Return the start of the array of images held by value. optionally return the number of elements in n.

See also: valueSetArrayImage.

valueGetArrayInt

valueGetArrayInt Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: GValue to get from

-> Int32

n: return the number of elements here, optionally

-> m Int32

Returns: The array address.

Return the start of the array of ints held by value. optionally return the number of elements in n.

See also: arrayIntNew.

valueGetBlob

valueGetBlob Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: GValue to set

-> Word64

length: optionally return length of memory area

-> m (Ptr ())

Returns: The pointer held by value.

Returns the data pointer from a blob. Optionally returns the length too.

blobs are things like ICC profiles or EXIF data. They are relocatable, and are saved to VIPS files for you coded as base64 inside the XML. They are copied by copying reference-counted pointers.

See also: valueSetBlob

valueGetRefString

valueGetRefString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: GValue to get from

-> Word64

length: return length here, optionally

-> m Text

Returns: The C string held by value.

Get the C string held internally by the GValue.

valueGetSaveString

valueGetSaveString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: GValue to get from

-> m Text

Returns: The C string held by value.

Get the C string held internally by the GValue.

valueIsNull

valueIsNull :: (HasCallStack, MonadIO m) => GParamSpec -> GValue -> m Bool Source #

No description available in the introspection data.

valueSetArea

valueSetArea Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> CallbackFn

freeFn: data will be freed with this function

-> m GValue 

Set value to be a ref-counted area of memory with a free function.

valueSetArray

valueSetArray Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

n: number of elements

-> GType

type: the type of each element

-> Word64

sizeofType: the sizeof each element

-> m GValue 

Set value to be an array of things.

This allocates memory but does not initialise the contents: get the pointer and write instead.

valueSetArrayDouble

valueSetArrayDouble Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe [Double]

array: array of doubles

-> m GValue 

Set value to hold a copy of array. Pass in the array length in n.

See also: arrayDoubleGet.

valueSetArrayImage

valueSetArrayImage Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

n: the number of elements

-> m GValue 

Set value to hold an array of images. Pass in the array length in n.

See also: arrayImageArrayImageGet.

valueSetArrayInt

valueSetArrayInt Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe [Int32]

array: array of ints

-> m GValue 

Set value to hold a copy of array. Pass in the array length in n.

See also: arrayIntGet.

valueSetArrayObject

valueSetArrayObject Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

n: the number of elements

-> m GValue 

Set value to hold an array of GObject. Pass in the array length in n.

See also: vips_value_get_array_object().

valueSetBlob

valueSetBlob Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> CallbackFn

freeFn: free function for data

-> Word64

length: length of memory area

-> m GValue 

Sets value to hold a data. When value is freed, data will be freed with freeFn. value also holds a note of the size of the memory area.

blobs are things like ICC profiles or EXIF data. They are relocatable, and are saved to VIPS files for you coded as base64 inside the XML. They are copied by copying reference-counted pointers.

See also: valueGetBlob

valueSetBlobFree

valueSetBlobFree Source #

Arguments

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

data: pointer to area of memory

-> Word64

length: length of memory area

-> m GValue 

Just like valueSetBlob, but when value is freed, data will be freed with free.

This can be easier to call for language bindings.

See also: valueSetBlob

valueSetRefString

valueSetRefString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

str: C string to copy into the GValue

-> m GValue 

Copies the C string str into value.

vips_ref_string are immutable C strings that are copied between images by copying reference-counted pointers, making them much more efficient than regular GValue strings.

str should be a valid utf-8 string.

valueSetSaveString

valueSetSaveString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

str: C string to copy into the GValue

-> m GValue 

Copies the C string into value.

str should be a valid utf-8 string.

version

version Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

flag: which field of the version to get

-> m Int32

Returns: library version number

Get the major, minor or micro library version, with flag values 0, 1 and 2.

Get the ABI current, revision and age (as used by libtool) with flag values 3, 4, 5.

versionString

versionString Source #

Arguments

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

Returns: a static version string

Get the VIPS version as a static string, including a build date and time. Do not free.