iccbuild

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package iccbuild assembles minimal ICC profiles, for tests.

It exists for the reason internal/pdfbuild does: a tag table of offsets and sizes, each tag four-byte aligned, is the only real logic in a hand-built profile, and two packages need it — icc, which parses profiles, and render/native, which draws through them and is compared with pdfium. The corpus's own profiles cannot be committed as fixtures, because they come out of PDFs that cannot be redistributed, so every profile a test uses is built here.

Nothing is validated. A fixture's purpose is often to be malformed in one specific way, and a caller that needs one patches the bytes this returns: the header's class is at offset 12, the data colour space at 16, the connection space at 20, and the 'acsp' signature at 36.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Curve

func Curve(table ...uint16) []byte

Curve is a curveType tag holding a sampled table; no entries at all is the identity. #nosec G115 -- a test fixture's table, nowhere near 1<<32 entries

func Gamma

func Gamma(g float64) []byte

Gamma is a curveType tag of one entry, which the ICC specification reads as a gamma in u8Fixed8.

func Gray

func Gray(gamma float64) []byte

Gray is a gray profile whose tone curve is a pure gamma.

func Para

func Para(fn uint16, params ...float64) []byte

Para is a parametricCurveType tag of the function type given, with its parameters in order.

func Profile

func Profile(space string, tags ...Tag) []byte

Profile returns a version 2 display profile for the data colour space given ("GRAY" or "RGB "), with an XYZ connection space and the tags given after a description, a D50 media white point and a copyright, which is what a real profile carries ahead of the tags that matter. #nosec G115 -- every count and offset is a test fixture's, bytes long and nowhere near 1<<32

func RGB

func RGB(gamma float64, r, g, b [3]float64) []byte

RGB is a matrix/TRC profile with one gamma for all three channels, and colorants r, g and b given as D50-relative XYZ.

func XYZ

func XYZ(x, y, z float64) []byte

XYZ is an XYZType tag holding one value.

Types

type Tag

type Tag struct {
	Sig  string
	Data []byte
}

Tag is one tagged element: its signature and its bytes, type signature first.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL