Module gpuFlux

Class SpectralCurve

java.lang.Object
de.grogra.persistence.ShareableBase
de.grogra.gpuflux.imp3d.spectral.SpectralCurve
All Implemented Interfaces:
Manageable, Shareable
Direct Known Subclasses:
BlackbodySpectralCurve, ConstantSpectralCurve, IrregularSpectralCurve, RegularSpectralCurve, RGBSpectralCurve

public abstract class SpectralCurve extends ShareableBase
This class is an abstract interface to sampled or analytic spectral data.
  • Field Details

  • Constructor Details

    • SpectralCurve

      public SpectralCurve()
  • Method Details

    • sample

      public abstract float sample(float lambda)
      This function determines the actual spectral curve data. Note that the lambda parameter is assumed to be in nanometers.
      Parameters:
      lambda - wavelength to sample in nanometers
      Returns:
      the value of the spectral curve at this point
    • toXYZ

      public final XYZColor toXYZ()
      Convert this curve to a tristimulus CIE XYZ color by integrating against the CIE color matching functions.
      Returns:
      XYZColor that represents this spectra
    • clip

      public IrregularSpectralCurve clip(float lambdaMin, float lambdaMax)
      Returns a new IrregularSpectralCurve that represents this curve sampled at 1 nm steps over [lambdaMin, lambdaMax]. This is the default implementation for analytically-defined subclasses (ConstantSpectralCurve, RGBSpectralCurve, etc.) that have no explicit wavelength table to clip.

      IrregularSpectralCurve overrides this method with an exact tabular version that preserves original sample points.

      Parameters:
      lambdaMin - lower wavelength bound (nm), inclusive
      lambdaMax - upper wavelength bound (nm), inclusive
      Returns:
      sampled spectral curve over the requested range
    • toXYZ

      public static final XYZColor toXYZ(float lambda, float amplitude)