Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ColorSpaceConverter"/> class.
        /// </summary>
        /// <param name="options">The configuration options.</param>
        public ColorSpaceConverter(ColorSpaceConverterOptions options)
        {
            Guard.NotNull(options, nameof(options));
            this.whitePoint                 = options.WhitePoint;
            this.targetLuvWhitePoint        = options.TargetLuvWhitePoint;
            this.targetLabWhitePoint        = options.TargetLabWhitePoint;
            this.targetHunterLabWhitePoint  = options.TargetHunterLabWhitePoint;
            this.targetRgbWorkingSpace      = options.TargetRgbWorkingSpace;
            this.chromaticAdaptation        = options.ChromaticAdaptation;
            this.performChromaticAdaptation = this.chromaticAdaptation != null;
            this.lmsAdaptationMatrix        = options.LmsAdaptationMatrix;

            this.cieXyzAndLmsConverter      = new CieXyzAndLmsConverter(this.lmsAdaptationMatrix);
            this.cieXyzToCieLabConverter    = new CieXyzToCieLabConverter(this.targetLabWhitePoint);
            this.cieXyzToCieLuvConverter    = new CieXyzToCieLuvConverter(this.targetLuvWhitePoint);
            this.cieXyzToHunterLabConverter = new CieXyzToHunterLabConverter(this.targetHunterLabWhitePoint);
            this.cieXyzToLinearRgbConverter = new CieXyzToLinearRgbConverter(this.targetRgbWorkingSpace);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="VonKriesChromaticAdaptation"/> class.
 /// </summary>
 /// <param name="converter">The color converter</param>
 public VonKriesChromaticAdaptation(CieXyzAndLmsConverter converter)
 {
     this.converter = converter;
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VonKriesChromaticAdaptation"/> class.
 /// </summary>
 /// <param name="converter">The color converter</param>
 internal VonKriesChromaticAdaptation(CieXyzAndLmsConverter converter) => this.converter = converter;