TriangleMesh

class TriangleMesh(val colorSpace: KiteColorSpace, val background: RgbColor?, val bbox: KiteRectangle?, val triangles: List<KiteShading.MeshTriangle>, val colorTable: KiteShading.MeshColorTable? = null) : KiteShading

Types 4/5: a triangle mesh with per-vertex colours (ISO 32000-1, 8.7.4.5.5 and 8.7.4.5.6).

Constructors

Link copied to clipboard
constructor(colorSpace: KiteColorSpace, background: RgbColor?, bbox: KiteRectangle?, triangles: List<KiteShading.MeshTriangle>, colorTable: KiteShading.MeshColorTable? = null)

Properties

Link copied to clipboard
open override val background: RgbColor?

Optional /Background colour, used for regions outside the shading domain when Extend is false on the relevant side. Per spec the background is in colorSpace; we eager-convert to RGB.

Link copied to clipboard
open override val bbox: KiteRectangle?

Optional clipping rectangle (/BBox) in shading-space.

Link copied to clipboard
open override val colorSpace: KiteColorSpace

The shading's colour space (DeviceGray / DeviceRGB / DeviceCMYK / Indexed).

Link copied to clipboard

The colours of t when the mesh has a /Function, or null when its vertices carry colours.

Link copied to clipboard

Functions

Link copied to clipboard

Sample a KiteShading.Axial or KiteShading.Radial at evenly-spaced stops between domain[0] and domain[1]. Returns parallel t and RGB arrays the backend uses to build a gradient brush. The default of 256 matches MuPDF, so a function with many narrow bands keeps them all (#153).

Link copied to clipboard

This axial or radial shading continued past its ends by spread, over a region whose bounds in shading space are region. The result is an ordinary shading that every canvas paints: its geometry grows to cover the region, and a stitching function (ISO 32000-1, 7.10.4) repeats or mirrors the colours once per period.