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.

Vips.ArgumentFlags.SET_ALWAYS is handy for arguments which are set from C. For example, Vips.Image ::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.

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 Vips.ArgumentFlags.MODIFY will be modified by the operation. This is used for things like the in-place drawing operations.

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.ForeignFlags(value)

Bases: GObject.GFlags

Some hints about the image loader.

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

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.

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 vips_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 and some TIFF tags)

XMP = 2

keep XMP metadata

ALL = 31

keep all metadata

IPTC = 4

keep IPTC 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.OperationFlags(value)

Bases: GObject.GFlags

Flags we associate with an operation.

Vips.OperationFlags.SEQUENTIAL means that the operation works like vips_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

Vips.OperationFlags.NOCACHE means that the operation must not be cached by vips.

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

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 Vips.block_untrusted_set() to block all untrusted operations.

Vips.OperationFlags.BLOCKED means the operation is prevented from executing. Use Vips.Operation.block_set() to enable and disable groups of operations.

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