Layout constraints flags (bits 0 to 15). All of those introduce "gap pixels" after the scanline, in order to follow the various constraints.
Load flags (range: bits 16 to 23). Load flags occupy high-order word so that casting to ushort only keeps LayoutConstraints part.
Converts from DPI (Dots Per Inch) to PPM (Points Per Meter).
Converts from PPM (Points Per Meter) to DPI (Dots Per Inch).
Image format. It is the kind of container/codec formats Gamut can read and write to.
Pixel component type. Integer components are stored normalized (255 or 65535 being the maximum of intensity).
Converts from inches to meters.
Converts from meters to inches.
When images have an unknown physical pixel ratio. Explanation: it is possible to have a known pixel ratio, but an unknown DPI (eg: PNG).
When images have an unknown DPI resolution;
Internal use, this is to test a variation of a compiler. Supported by: JPEG, PNG, DDS, QOI, QOIX.
Do nothing particular. Supported by: JPEG, PNG, DDS, QOI, QOIX.
No Gamut Image can have a size that exceeds this value. Technically, the true maximum is MAX(size_t.max, GAMUT_MAX_IMAGE_BYTES). So this is worth 32gb. Cannot really exceed that size with just malloc/realloc. Not strictly needed, but such a large allocation is indicative of forged images / attacks anyway. For the decoders limitations themselves, see Issue # resolution.
No Gamut Image can exceed this height.
No Gamut Image can have this many layers.
No Gamut Image can exceed this width.
No particular border constraint.
The whole image has a border of at least 1 pixel addressable without segfault.
The whole image has a border of at least 2 pixels addressable without segfault.
The whole image has a border of at least 3 pixels addressable without segfault.
Default / do-not-care layout options. This is what will give
There must be no single trailing bytes between scanlines.
No particular multiplicity requirements.
Beginning at the start of a scanline, pixels can be READ 2 by 2 without segfault.
Beginning at the start of a scanline, pixels can be READ 4 by 4 without segfault.
Beginning at the start of a scanline, pixels can be READ 8 by 8 without segfault.
No particular alignment for scanline.
Scanlines required to be at least aligned on 128 bytes boundaries.
Scanlines required to be at least aligned on 16 bytes boundaries.
Scanlines required to be at least aligned on 2 bytes boundaries.
Scanlines required to be at least aligned on 32 bytes boundaries.
Scanlines required to be at least aligned on 4 bytes boundaries.
Scanlines required to be at least aligned on 64 bytes boundaries.
Scanlines required to be at least aligned on 8 bytes boundaries.
Scanlines have no trailing requirements.
Scanlines must be followed by at least 1 READABLE gap pixels.
Scanlines must be followed by at least 3 READABLE gap pixels.
Scanlines must be followed by at least 7 READABLE gap pixels.
The whole image MUST be stored upside down. Can't be used with LAYOUT_VERT_STRAIGHT flag.
The whole image MUST NOT be stored upside down. Can't be used with LAYOUT_VERT_FLIPPED flag.
Load the image directly in 16-bit, can be faster than loading as 8-bit PNG and then converting to 16-bit. Can't be used with LOAD_8BIT or LOAD_FP32 flag.
Load the image directly in 8-bit, can be faster than loading as 16-bit PNG and then converting to 8-bit. Can't be used with LOAD_10BIT or LOAD_FP32 flag.
Load the image and adds an alpha channel (opaque if not existing). This will preserve the color channels. The resulting image will have 2 or 4 channels. Can't be used with LOAD_NO_ALPHA flag.
Load the image directly in 32-bit floating point. Probably the same speed as just calling convertToFP32 after load though. Can't be used with LOAD_8BIT or LOAD_10BIT flag.
Load the image in greyscale, can be faster than loading as RGB8 then converting to greyscale. This will preserve an alpha channel, if existing. The resulting image will have 1 or 2 channels. Can't be used with LOAD_RGB flag.
No loading options. This will keep the original input pixel format, so as to make the least conversions possible.
Load the image and drops an eventual alpha channel, if it exists. The resulting image will have 1 or 3 channels. Can't be used with LOAD_ALPHA flag.
Only decode metadata, not the pixels themselves. NOT SUPPORTED YET!
Load the image in RGB, can be faster than loading a greyscale image and then converting it RGB. The resulting image will have 3 or 4 channels. Can't be used with LOAD_GREYSCALE.
Various public types.