Flags

Details

class Vips.ArgumentFlags(value)

Bases: GObject.GFlags

Flags we associate with each object argument.

Have separate input & output flags. Both set is an error; neither set is OK.

Input gobjects are automatically reffed, output gobjects automatically ref us. We also automatically watch for “destroy” and unlink.

[flags`Vips`.ArgumentFlags.SET_ALWAYS] is handy for arguments which are set from C. For example, [property`Image`:py:data::width<Vips.ArgumentFlags.props.width>] is a property that gives access to the Xsize member of struct _VipsImage. We default its ‘assigned’ to TRUE since the field is always set directly by C.

[flags`Vips`.ArgumentFlags.DEPRECATED] arguments are not shown in help text, are not looked for if required, are not checked for “have-been-set”. You can deprecate a required argument, but you must obviously add a new required argument if you do.

Input args with [flags`Vips`.ArgumentFlags.MODIFY] will be modified by the operation. This is used for things like the in-place drawing operations.

[flags`Vips`.ArgumentFlags.NON_HASHABLE] stops the argument being used in hash and equality tests. It’s useful for arguments like revalidate which control the behaviour of the operator cache.

NONE = 0

no flags

REQUIRED = 1

must be set in the constructor

MODIFY = 128

the input argument will be modified

INPUT = 16

is an input argument (one we depend on)

CONSTRUCT = 2

can only be set in the constructor

NON_HASHABLE = 256

the argument is non-hashable

OUTPUT = 32

is an output argument (depends on us)

SET_ONCE = 4

can only be set once

DEPRECATED = 64

just there for back-compat, hide

SET_ALWAYS = 8

don’t do use-before-set checks

class Vips.ForeignCoding(value)

Bases: GObject.GFlags

The set of coding types supported by a saver.

::: seealso [enum`Coding`].

NONE = 1

saver supports [enum`Vips`.Coding.NONE]

LABQ = 2

saver supports [enum`Vips`.Coding.LABQ]

RAD = 4

saver supports [enum`Vips`.Coding.RAD]

ALL = 7

saver supports all coding types

class Vips.ForeignFlags(value)

Bases: GObject.GFlags

Some hints about the image loader.

[flags`Vips`.ForeignFlags.PARTIAL] means that the image can be read directly from the file without needing to be unpacked to a temporary image first.

[flags`Vips`.ForeignFlags.SEQUENTIAL] means that the loader supports lazy reading, but only top-to-bottom (sequential) access. Formats like PNG can read sets of scanlines, for example, but only in order.

If neither PARTIAL or SEQUENTIAL is set, the loader only supports whole image read. Setting both PARTIAL and SEQUENTIAL is an error.

[flags`Vips`.ForeignFlags.BIGENDIAN] means that image pixels are most-significant byte first. Depending on the native byte order of the host machine, you may need to swap bytes. See [method`Image`.copy].

NONE = 0

no flags set

PARTIAL = 1

the image may be read lazilly

BIGENDIAN = 2

image pixels are most-significant byte first

SEQUENTIAL = 4

top-to-bottom lazy reading

ALL = 7
class Vips.ForeignKeep(value)

Bases: GObject.GFlags

Which metadata to retain.

NONE = 0

don’t attach metadata

EXIF = 1

keep Exif metadata

OTHER = 16

keep other metadata (e.g. PNG comments)

XMP = 2

keep XMP metadata

GAINMAP = 32

keep the gainmap metadata

IPTC = 4

keep IPTC metadata

ALL = 63

keep all metadata

ICC = 8

keep ICC metadata

class Vips.ForeignPngFilter(value)

Bases: GObject.GFlags

http://www.w3.org/TR/PNG-Filters.html The values mirror those of png.h in libpng.

PAETH = 128

pick best neighbor predictor automatically

SUB = 16

difference to the left

ALL = 248

adaptive

UP = 32

difference up

AVG = 64

average of left and up

NONE = 8

no filtering

class Vips.ForeignSaveable(value)

Bases: GObject.GFlags

The set of image types supported by a saver.

::: seealso [class`ForeignSave`].

ANY = 0

saver supports everything (eg. TIFF)

MONO = 1

1 band

ALL = 15
RGB = 2

3 bands

CMYK = 4

4 bands

ALPHA = 8

an extra band

class Vips.OperationFlags(value)

Bases: GObject.GFlags

Flags we associate with an operation.

[flags`Vips`.OperationFlags.SEQUENTIAL] means that the operation works like [method`Image`.conv]: it can process images top-to-bottom with only small non-local references.

Every scan-line must be requested, you are not allowed to skip ahead, but as a special case, the very first request can be for a region not at the top of the image. In this case, the first part of the image will be read and discarded

Every scan-line must be requested, you are not allowed to skip ahead, but as a special case, the very first request can be for a region not at the top of the image. In this case, the first part of the image will be read and discarded

[flags`Vips`.OperationFlags.NOCACHE] means that the operation must not be cached by vips.

[flags`Vips`.OperationFlags.DEPRECATED] means this is an old operation kept in vips for compatibility only and should be hidden from users.

[flags`Vips`.OperationFlags.UNTRUSTED] means the operation depends on external libraries which have not been hardened against attack. It should probably not be used on untrusted input. Use [func`block_untrusted_set`] to block all untrusted operations.

[flags`Vips`.OperationFlags.BLOCKED] means the operation is prevented from executing. Use [func`Operation`.block_set] to enable and disable groups of operations.

[flags`Vips`.OperationFlags.REVALIDATE] force the operation to run, updating the cache with the new value. This is used by eg. Vips.ForeignLoad to implement the “revalidate” argument.

NONE = 0

no flags

SEQUENTIAL = 1

can work sequentially with a small buffer

UNTRUSTED = 16

not hardened for untrusted input

SEQUENTIAL_UNBUFFERED = 2

deprecated, use [flags`Vips`.OperationFlags.SEQUENTIAL] instead

BLOCKED = 32

prevent this operation from running

NOCACHE = 4

must not be cached

REVALIDATE = 64

force the operation to run

DEPRECATED = 8

a compatibility thing