Examples of CIExyY


Examples of ca.eandb.jmist.framework.color.CIExyY

   */
  @Override
  public Color evaluate(Point2 p, WavelengthPacket lambda) {
    ColorModel cm = lambda.getColorModel();
    if (gamutMask.opacity(p) > 0.5) {
      CIEXYZ xyz = new CIExyY(p.x(), p.y(), p.y()).toXYZ();
      return cm.fromXYZ(xyz).sample(lambda);
    } else {
      return cm.getBlack(lambda);
    }
  }
View Full Code Here

Examples of ca.eandb.jmist.framework.color.CIExyY

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.tone.ToneMapperFactory#createToneMapper(java.lang.Iterable)
   */
  @Override
  public ToneMapper createToneMapper(Iterable<CIEXYZ> samples) {
    CIExyY white;

    if (autoCheckBox.isSelected()) {
      double Yavg = 0.0;
      double Ymax = 0.0;
      int n = 0;
      for (CIEXYZ sample : samples) {
        if (sample != null) {
          double Y = Math.abs(sample.Y());
          if (Y > Ymax) {
            Ymax = Y;
          }
          Yavg += Math.log(DELTA + Y);
          n++;
        }
      }
      Yavg /= (double) n;
      Yavg = Math.exp(Yavg) - DELTA;

      double Ymid = 1.03 - 2.0 / (2.0 + Math.log10(Yavg + 1.0));
      white = new CIExyY(1.0 / 3.0, 1.0 / 3.0, Yavg / Ymid);

      double ySliderValue = Math.log(white.Y()) / Math.log(2.0);

      suspendChangeEvents = true;
      whiteLuminanceSlider.setValue(ySliderValue);
      whiteXChromaticitySlider.setValue(MAX_CHROMATICITY_SLIDER_VALUE / 3);
      whiteYChromaticitySlider.setValue(MAX_CHROMATICITY_SLIDER_VALUE / 3);
      suspendChangeEvents = false;
    } else {
      white = new CIExyY(
          ((double) whiteXChromaticitySlider.getValue()) / (double) MAX_CHROMATICITY_SLIDER_VALUE,
          ((double) whiteYChromaticitySlider.getValue()) / (double) MAX_CHROMATICITY_SLIDER_VALUE,
          Math.pow(2.0, whiteLuminanceSlider.getValue()));
    }

    return new LinearToneMapper(white.toXYZ());
  }
View Full Code Here

Examples of ca.eandb.jmist.framework.color.CIExyY

    }
    Yavg /= (double) n;
    Yavg = Math.exp(Yavg) - delta;

    double Ymid = 1.03 - 2.0 / (2.0 + Math.log10(Yavg + 1.0));
    CIExyY white = new CIExyY(1.0 / 3.0, 1.0 / 3.0, Yavg / Ymid);
    return new LinearToneMapper(white.toXYZ());
  }
View Full Code Here

Examples of ca.eandb.jmist.framework.color.CIExyY

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.color.ToneMapper#apply(ca.eandb.jmist.framework.color.CIEXYZ)
   */
  public CIEXYZ apply(CIEXYZ hdr) {
    CIExyY xyY = CIExyY.fromXYZ(hdr);
    double Y = xyY.Y() * yScale;
    if (yWhiteSquared < Double.POSITIVE_INFINITY) {
      Y = Y * (1.0 + Y / yWhiteSquared) / (1.0 + Y);
    } else {
      Y = Y / (1.0 + Y);
    }
    return ColorUtil.convertxyY2XYZ(xyY.x(), xyY.y(), Y);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.