lcms2.Flag

class Flag(*values)[source]

Bases: IntFlag

LittleCMS transform flags (cmsFLAGS_*).

Flag.parse accepts an int, a Flag or a string such as "NOOPTIMIZE,BLACKPOINTCOMPENSATION" (separators , | ; or spaces). 8BITS_DEVICELINK is spelled EIGHTBITS_DEVICELINK in Python.

Examples

>>> Flag.parse("gamutcheck|softproofing") == Flag.GAMUTCHECK | Flag.SOFTPROOFING
True
>>> int(Flag.grid_points(33))
2162688
__init__(*args, **kwds)

Methods

conjugate()

Returns self, the complex conjugate of any int.

bit_length()

Number of bits necessary to represent self in binary.

bit_count()

Number of ones in the binary representation of the absolute value of self.

to_bytes([length, byteorder, signed])

Return an array of bytes representing an integer.

from_bytes(bytes[, byteorder, signed])

Return the integer represented by the given array of bytes.

as_integer_ratio()

Return a pair of integers, whose ratio is equal to the original int.

is_integer()

Returns True.

grid_points(n)

Flag requesting n CLUT grid points per dimension (cmsFLAGS_GRIDPOINTS).

parse(value)

Convert None, an int or a flag string to a Flag.

__init__(*args, **kwds)

Attributes

real

the real part of a complex number

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

denominator

the denominator of a rational number in lowest terms

NONE

CLUT_POST_LINEARIZATION

FORCE_CLUT

NOWHITEONWHITEFIXUP

EIGHTBITS_DEVICELINK

CLUT_PRE_LINEARIZATION

GUESSDEVICECLASS

NOCACHE

KEEP_SEQUENCE

NOOPTIMIZE

NULLTRANSFORM

HIGHRESPRECALC

LOWRESPRECALC

GAMUTCHECK

BLACKPOINTCOMPENSATION

SOFTPROOFING

NONEGATIVES

NODEFAULTRESOURCEDEF

COPY_ALPHA

NONE = 0
CLUT_POST_LINEARIZATION = 1
FORCE_CLUT = 2
NOWHITEONWHITEFIXUP = 4
CLUT_PRE_LINEARIZATION = 16
GUESSDEVICECLASS = 32
NOCACHE = 64
KEEP_SEQUENCE = 128
NOOPTIMIZE = 256
NULLTRANSFORM = 512
HIGHRESPRECALC = 1024
LOWRESPRECALC = 2048
GAMUTCHECK = 4096
BLACKPOINTCOMPENSATION = 8192
SOFTPROOFING = 16384
NONEGATIVES = 32768
NODEFAULTRESOURCEDEF = 16777216
COPY_ALPHA = 67108864
static grid_points(n: int) → Flag[source]

Flag requesting n CLUT grid points per dimension (cmsFLAGS_GRIDPOINTS).

classmethod parse(value: Flag | int | str | None) → Flag[source]

Convert None, an int or a flag string to a Flag.