ColorMatrix

class ColorMatrix(val rr: Float = 1.0f, val rg: Float = 0.0f, val rb: Float = 0.0f, val rBias: Float = 0.0f, val gr: Float = 0.0f, val gg: Float = 1.0f, val gb: Float = 0.0f, val gBias: Float = 0.0f, val br: Float = 0.0f, val bg: Float = 0.0f, val bb: Float = 1.0f, val bBias: Float = 0.0f) : EffectSpec(source)

Recombine the color channels of every pixel through a 3x3 matrix and an offset.

Each output channel is a weighted sum of the three input channels plus a bias, so red comes out as rr * r + rg * g + rb * b + rBias and the other two rows read the same way. Channels are the encoded signal in the range zero to one, the same domain Brightness multiplies, and the result is clamped back into that range once the whole matrix has been applied. Alpha is never touched.

Every other color effect in this package is one of these under the hood, and a run of them is folded into a single matrix before any backend clamps, so an effect that pushes a channel past white and one that pulls it back again cancel out rather than saturating in between.

On an export that keeps an HDR grade the frame holds light rather than a signal, so the light is read as the signal an SDR display at reference white would have been fed, the matrix runs on that as written, and the result goes back to light. The ceiling is the format's peak rather than white, so a channel pushed past 1f keeps going where an SDR export saturates, and a channel pulled below zero is black on both. Only a bias depends on where white sits.

The defaults are the identity, so a caller names only the entries that change.

Throws

when any entry is not a finite number.

Constructors

Link copied to clipboard
constructor(rr: Float = 1.0f, rg: Float = 0.0f, rb: Float = 0.0f, rBias: Float = 0.0f, gr: Float = 0.0f, gg: Float = 1.0f, gb: Float = 0.0f, gBias: Float = 0.0f, br: Float = 0.0f, bg: Float = 0.0f, bb: Float = 1.0f, bBias: Float = 0.0f)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val bb: Float

How much input blue contributes to output blue.

Link copied to clipboard

What is added to output blue.

Link copied to clipboard
Link copied to clipboard
val bg: Float

How much input green contributes to output blue.

Link copied to clipboard
val br: Float

How much input red contributes to output blue.

Link copied to clipboard
val gb: Float

How much input blue contributes to output green.

Link copied to clipboard

What is added to output green.

Link copied to clipboard
val gg: Float

How much input green contributes to output green.

Link copied to clipboard
val gr: Float

How much input red contributes to output green.

Link copied to clipboard
open override val id: String
Link copied to clipboard
open val isInert: Boolean
Link copied to clipboard
val rb: Float

How much input blue contributes to output red.

Link copied to clipboard

What is added to output red.

Link copied to clipboard
Link copied to clipboard
val rg: Float

How much input green contributes to output red.

Link copied to clipboard
val rr: Float

How much input red contributes to output red.

Link copied to clipboard
open val scope: EffectScope
Link copied to clipboard
open override val stage: EffectStage