Package ca.eandb.jmist.framework.color

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


  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.color.Color#toXYZ()
   */
  public CIEXYZ toXYZ() {
    return new CIEXYZ(x, y, z);
  }
View Full Code Here


  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.color.ColorModel#fromRGB(double, double, double)
   */
  @Override
  public Spectrum fromRGB(double r, double g, double b) {
    CIEXYZ xyz = ColorUtil.convertRGB2XYZ(r, g, b);
    return new XYZColor(xyz.X(), xyz.Y(), xyz.Z(), null);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.color.ColorModel#fromRGB(double, double, double)
   */
  @Override
  public Spectrum fromRGB(double r, double g, double b) {
    CIEXYZ c = ColorUtil.convertRGB2XYZ(r, g, b);
    return fromXYZ(c.X(), c.Y(), c.Z());
  }
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.color.Color#toXYZ()
   */
  @Override
  public CIEXYZ toXYZ() {
    return new CIEXYZ(x, y, z);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.color.xyz.single.SingleXYZColor#toXYZColor()
   */
  @Override
  public XYZColor toXYZColor() {
    CIEXYZ c = ColorUtil.convertSample2XYZ(lambda.getWavelength(), value);
    return new XYZColor(c.X(), c.Y(), c.Z());
  }
View Full Code Here

   * @param X The value to set the X channel to.
   * @param Y The value to set the Y channel to.
   * @param Z The value to set the Z channel to.
   */
  public void setPixelXYZ(int x, int y, double X, double Y, double Z) {
    setPixelXYZ(x, y, new CIEXYZ(X, Y, Z));
  }
View Full Code Here

   */
  @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

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.color.Color#toXYZ()
   */
  public CIEXYZ toXYZ() {
    return new CIEXYZ(value, value, value);
  }
View Full Code Here

  private void reapplyToneMapper() {
    int w = ldrImage.getWidth();
    int h = ldrImage.getHeight();
    for (int y = 0; y < h; y++) {
      for (int x = 0; x < w; x++) {
        CIEXYZ xyz = hdrImage.get(x, y);
        if (xyz != null) {
          xyz = toneMapper.apply(xyz);
          int rgb = xyz.toRGB().toR8G8B8();
          ldrImage.setRGB(x, y, rgb);
        }
      }
    }
    super.repaint();
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.Display#fill(int, int, int, int, ca.eandb.jmist.framework.color.Color)
   */
  public void fill(int x, int y, int w, int h, Color color) {
    CIEXYZ xyz = color.toXYZ();
    hdrImage.slice(x, y, w, h).setAll(xyz);

    if (!prepareToneMapper(w * h)) {
      int rgb = toneMapper.apply(xyz).toRGB().toR8G8B8();

View Full Code Here

TOP

Related Classes of ca.eandb.jmist.framework.color.CIEXYZ

Copyright © 2018 www.massapicom. 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.