Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

Protected _maxDistance

_maxDistance: number

Protected _whitePoint

_whitePoint: { a: number; b: number; g: number; r: number }

Type declaration

  • a: number
  • b: number
  • g: number
  • r: number

Methods

Protected _setDefaults

  • _setDefaults(): void

calculateNormalized

  • calculateNormalized(colorA: PointRGBA, colorB: PointRGBA): number

calculateRaw

  • calculateRaw(r1: number, g1: number, b1: number, a1: number, r2: number, g2: number, b2: number, a2: number): number
  • Author's comments px_b.rgb = px.rgb + 0*(1-px.a) // blend px on black px_b.a = px.a + 1*(1-px.a) px_w.rgb = px.rgb + 1*(1-px.a) // blend px on white px_w.a = px.a + 1*(1-px.a)

    px_b.rgb = px.rgb // difference same as in opaque RGB px_b.a = 1 px_w.rgb = px.rgb - px.a // difference simplifies to formula below px_w.a = 1

    (px.rgb - px.a) - (py.rgb - py.a) (px.rgb - py.rgb) + (py.a - px.a)

    Parameters

    • r1: number
    • g1: number
    • b1: number
    • a1: number
    • r2: number
    • g2: number
    • b2: number
    • a2: number

    Returns number

setWhitePoint

  • setWhitePoint(r: number, g: number, b: number, a: number): void

Generated using TypeDoc