Skip to main content

Crate garnetash

Crate garnetash 

Source

Structs§

Cicp
A CICP color description: primaries, transfer function, matrix coefficients and the full-range flag, exactly as carried by an nclx colr box.
ColorMetadata
How the output color space is described in the file: a CICP code-point set (nclx) and/or an embedded ICC profile (prof). Both may be present.
ContentLightLevel
HDR content light level, written as a ContentLightLevelBox (clli): the maximum content light level and maximum picture-average light level, in nits.
DecodedImage
A decoded still image: cropped 8-bit planar samples plus the geometry.
EncodeConfig
Encoder configuration shared by all entry points.
ImageMetadata
Bundle of image-level metadata written into the meta box.
PlaneView
A read-only view of one plane of a DecodedImage: a tightly packed, row-major slice of the DecodedImage::planes buffer plus its geometry. Samples are one byte each at 8-bit and little-endian u16 pairs at 10/12-bit (bytes_per_sample says which); rows are contiguous, so the sample stride equals width. Use this instead of recomputing plane offsets/strides by hand — see DecodedImage::luma_plane, chroma_planes and alpha_plane.
Yuv

Enums§

BitDepth
Sample bit depth. VVC’s Main 10 profile tops out at 10 bits; 12 is kept for the Main 12 / range extensions and for lossless intra work.
ChromaFormat
Chroma subsampling mode.
EncodeError
Errors returned by the garnetash VVC image encoder.
MatrixCoefficients
Matrix coefficients (CICP MatrixCoefficients, H.273 Table 4).
Orientation
Display orientation, using the eight EXIF orientation values. HEIF expresses orientation with a rotation property (irot, anticlockwise multiples of 90°) and a mirror property (imir); the diagonal EXIF values map to a mirror followed by a rotation.
Primaries
color primaries (CICP colorPrimaries, H.273 Table 2).
TransferFunction
Transfer characteristics (CICP TransferCharacteristics, H.273 Table 3).

Functions§

decode
Decode a HEIF file produced by garnetash’s *_to_heif entry points. The embedded VVC stream is decoded to YCbCr, and the container is mined for side data: display orientation (irot/imir) and color metadata (CICP nclx and/or an embedded ICC profile) populate the returned image, and if the file carries an alpha auxiliary image it is decoded and attached as DecodedImage::alpha automatically. Hardened for untrusted input like decode_266.
decode_266
Decode a raw Annex-B VVC intra still stream into reconstructed YCbCr samples.
decode_with_alpha
Decode a HEIF file, returning the color image and, separately, any alpha auxiliary image. Retained for explicitness; decode now also attaches the alpha to DecodedImage::alpha, so let img = decode(b)?; followed by img.alpha is the simpler path.
decode_yuv_266
Decode a raw Annex-B VVC intra still stream into reconstructed YCbCr samples. This is the canonical YCbCr decode entry; decode_yuv_266 is a named alias for it, mirroring encode_yuv_266 on the encode side.
encode_gray
Encode grayscale and wrap it in a HEIF container. See encode_gray_266.
encode_gray8
Encode an 8-bit grayscale image to a monochrome HEIF file (see encode_gray8_266).
encode_gray8_266
Encode an 8-bit grayscale image to a raw monochrome VVC stream.
encode_gray10
Encode a 10-bit grayscale image (u16, 0..=1023) to a monochrome HEIF file.
encode_gray12
Encode a 12-bit grayscale image (u16, 0..=4095) to a monochrome HEIF file.
encode_gray10_266
Encode a 10-bit grayscale image (u16, 0..=1023) to a raw monochrome stream.
encode_gray12_266
Encode a 12-bit grayscale image (u16, 0..=4095) to a raw monochrome stream.
encode_gray_266
Encode a single-channel 8-bit grayscale image as a monochrome (4:0:0) VVC still picture. gray must hold exactly width * height bytes.
encode_gray_alpha8
Encode an 8-bit interleaved grayscale+alpha image (Y, A bytes) to a HEIF file, preserving alpha as a monochrome auxiliary image. ya must hold exactly width * height * 2 bytes.
encode_gray_alpha8_266
Encode an 8-bit interleaved grayscale+alpha image (Y, A bytes) to a raw monochrome stream. Alpha is discarded (only the luma is coded).
encode_gray_alpha10
Encode a 10-bit interleaved grayscale+alpha image (u16 Y, A pairs) to a HEIF file, preserving alpha as a 10-bit monochrome auxiliary image.
encode_gray_alpha12
Encode a 12-bit interleaved grayscale+alpha image (u16 Y, A pairs) to a HEIF file, preserving alpha as a 12-bit monochrome auxiliary image.
encode_gray_alpha10_266
Encode a 10-bit interleaved grayscale+alpha image (u16 Y, A pairs) to a raw monochrome stream. Alpha is discarded.
encode_gray_alpha12_266
Encode a 12-bit interleaved grayscale+alpha image (u16 Y, A pairs) to a raw monochrome stream. Alpha is discarded.
encode_rgb
Encode RGB and wrap the result in a HEIF container (ISO/IEC 23008-12), the file form image viewers recognise. The primary item is a single VVC still image (vvc1 / vvcC); see encode_rgb_266 for the encoding parameters.
encode_rgb8
Encode packed 8-bit RGB to a HEIF file (see encode_rgb8_266).
encode_rgb8_266
Encode packed 8-bit RGB to a raw VVC stream (see encode_rgb_266).
encode_rgb10
Encode packed 10-bit RGB (u16, 0..=1023) to a HEIF file.
encode_rgb12
Encode packed 12-bit RGB (u16, 0..=4095) to a HEIF file.
encode_rgb10_266
Encode packed 10-bit RGB (u16, 0..=1023) to a raw VVC stream.
encode_rgb12_266
Encode packed 12-bit RGB (u16, 0..=4095) to a raw VVC stream.
encode_rgb_266
encode_rgba
Encode 8-bit RGBA (alpha discarded) and wrap the result in a HEIF container. See encode_rgb and encode_rgba_266.
encode_rgba8
Encode packed 8-bit RGBA (alpha discarded) to a HEIF file.
encode_rgba8_266
Encode packed 8-bit RGBA (alpha discarded) to a raw VVC stream.
encode_rgba8_with_alpha
Encode packed 8-bit RGBA to a HEIF file, preserving alpha (see encode_rgba_with_alpha).
encode_rgba10
Encode packed 10-bit RGBA (u16, alpha discarded) to a HEIF file.
encode_rgba12
Encode packed 12-bit RGBA (u16, alpha discarded) to a HEIF file.
encode_rgba10_266
Encode packed 10-bit RGBA (u16, alpha discarded) to a raw VVC stream.
encode_rgba10_with_alpha
Encode packed 10-bit RGBA (u16) to a HEIF file, preserving alpha as a 10-bit monochrome auxiliary image.
encode_rgba12_266
Encode packed 12-bit RGBA (u16, alpha discarded) to a raw VVC stream.
encode_rgba12_with_alpha
Encode packed 12-bit RGBA (u16) to a HEIF file, preserving alpha as a 12-bit monochrome auxiliary image.
encode_rgba_266
Encode a packed 8-bit RGBA image to a VVC still picture. Alpha is discarded.
encode_rgba_with_alpha
Encode 8-bit RGBA to a HEIF file
encode_yuv
Encode packed planar YCbCr (see encode_yuv_266) and wrap it in a HEIF file.
encode_yuv8
Encode planar 8-bit YCbCr to a HEIF file (see encode_yuv8_266).
encode_yuv8_266
Encode packed planar 8-bit YCbCr to a raw VVC stream (see encode_yuv_266).
encode_yuv10
Encode planar 10-bit YCbCr (u16, plane order Y, Cb, Cr) to a HEIF file.
encode_yuv12
Encode planar 12-bit YCbCr (u16, plane order Y, Cb, Cr) to a HEIF file.
encode_yuv10_266
Encode planar 10-bit YCbCr (u16 samples in plane order Y, Cb, Cr) to a raw VVC stream.
encode_yuv12_266
Encode planar 12-bit YCbCr (u16 samples in plane order Y, Cb, Cr) to a raw VVC stream.
encode_yuv_266
Encode a packed planar YCbCr image directly to a VVC still
encode_yuva8_with_alpha
Encode planar 8-bit YCbCr plus a separate 8-bit alpha plane (width × height) to a HEIF file, preserving alpha as a monochrome auxiliary image.
encode_yuva10_with_alpha
Encode planar 10-bit YCbCr (u16) plus a separate 10-bit alpha plane to a HEIF file, preserving alpha as a 10-bit monochrome auxiliary image.
encode_yuva12_with_alpha
Encode planar 12-bit YCbCr (u16) plus a separate 12-bit alpha plane to a HEIF file, preserving alpha as a 12-bit monochrome auxiliary image.
wrap_vvc_in_heif
Wrap an already-encoded raw Annex-B VVC still stream (SPS + PPS + IDR slice,