<<>> <> <> <> <> DIRECTORY G2dBasic, G2dMatrix, ImagerColor; G3dSpectrum: CEDAR DEFINITIONS ~ BEGIN <> RealSequence: TYPE ~ G2dBasic.RealSequence; RealSequenceRep: TYPE ~ G2dBasic.RealSequenceRep; Matrix: TYPE ~ G2dMatrix.Matrix; RGB: TYPE ~ ImagerColor.RGB; -- unscaled RGB: Reals [0-1] XYZ: TYPE ~ RECORD [x, y, z: REAL]; -- unscaled XYZ: Reals [0-1] Triple: TYPE ~ G2dBasic.Triple; SpectralSample: TYPE ~ RECORD [ wavelength: REAL, amplitude: REAL ]; Spectrum: TYPE ~ REF SpectrumRep; SpectrumRep: TYPE ~ RECORD [ length: CARDINAL, element: SEQUENCE maxlength: CARDINAL OF SpectralSample ]; <> ntscXYZtoRGBMatrix: Matrix; <> <> <<[0.670, 0.330, 0.000], [0.210, 0.720, .080], [0.140, 0.080, 0.780], [0.313, 0.329, 0.358]];>> ntscRGBtoSpectrumMatrix: Matrix; <> <> New: PUBLIC PROC [firstWavelength: REAL ¬ 380.0, deltaWavelength: REAL ¬ 30.0, numSamples: INT ¬ 16, amplitudes: RealSequence ¬ NIL] RETURNS [new: Spectrum]; <> Flatten: PUBLIC PROC [s: Spectrum, amplitude: REAL] RETURNS [Spectrum]; <> Normalize: PUBLIC PROC [s: Spectrum, totalEnergy: REAL ¬ 1.0] RETURNS [Spectrum]; <> Integrate: PUBLIC PROC [s: Spectrum] RETURNS [energy: REAL]; <> Scale: PUBLIC PROC [s: Spectrum, scale: REAL] RETURNS [Spectrum]; <> Offset: PUBLIC PROC [s: Spectrum, offset: REAL] RETURNS [Spectrum]; <> Duplicate: PUBLIC PROC [s: Spectrum] RETURNS [new: Spectrum]; <> Sample: PUBLIC PROC [s: Spectrum, wavelength: REAL] RETURNS [REAL]; <> <> SetTransformMatrix: PUBLIC PROC [transform: Matrix ¬ ntscXYZtoRGBMatrix]; <> TransformFromChromaticities: PUBLIC PROC [r, g, b, w: Triple] RETURNS [transform: Matrix]; <> SpectrumToRGB: PUBLIC PROC [s: Spectrum] RETURNS [rgb: RGB]; <> RGBToSpectrum: PUBLIC PROC [rgb: RGB] RETURNS [Spectrum]; <> <> Union: PUBLIC PROC [a, b: Spectrum] RETURNS [newa, newb: Spectrum]; <> Conform: PUBLIC PROC [a, b: Spectrum] RETURNS [newa: Spectrum]; <> <> Add: PUBLIC PROC [a, b: Spectrum] RETURNS [c: Spectrum]; <> Sub: PUBLIC PROC [a, b: Spectrum] RETURNS [c: Spectrum]; <> Lerp: PUBLIC PROC [a, b: Spectrum, alpha: REAL] RETURNS [c: Spectrum]; <> Blend: PUBLIC PROC [a, b: Spectrum, aScl, bScl: REAL] RETURNS [c: Spectrum]; <> Filter: PUBLIC PROC [a, b: Spectrum] RETURNS [c: Spectrum]; <> Damp: PUBLIC PROC [a, b: Spectrum] RETURNS [c: Spectrum]; <> <<>> END.