Module raytracer

Class SpectralCurve

java.lang.Object
org.sunflow.image.SpectralCurve
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BlackbodySpectrum, ChromaticitySpectrum, ConstantSpectralCurve, IrregularSpectralCurve, RegularSpectralCurve

public abstract class SpectralCurve extends Object implements Serializable
This class is an abstract interface to sampled or analytic spectral data.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract float
    sample(float lambda)
    This function determines the actual spectral curve data.
    final XYZColor
    Convert this curve to a tristimulus CIE XYZ color by integrating against the CIE color matching functions.
    static final XYZColor
    toXYZ(float lambda, float amplitude)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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
    • toXYZ

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