Package ca.eandb.jmist.framework.color

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


   * @see ca.eandb.jmist.framework.Modifier#modify(ca.eandb.jmist.framework.ShadingContext)
   */
  @Override
  public void modify(ShadingContext context) {
    Basis3 basis = context.getBasis();
    RGB c = painter.getColor(context, WAVELENGTH_PACKET).toRGB();
    Vector3 n = Vector3.unit(c.r() - 0.5, c.g() - 0.5, c.b() - 0.5);
    Vector3 u = basis.u();
    Vector3 v = basis.v();

    basis = Basis3.fromWUV(n, u, v);
    context.setShadingBasis(basis);
View Full Code Here


   * @see ca.eandb.jmist.framework.Modifier#modify(ca.eandb.jmist.framework.ShadingContext)
   */
  @Override
  public void modify(ShadingContext context) {
    Basis3 basis = context.getShadingBasis();
    RGB c = painter.getColor(context, WAVELENGTH_PACKET).toRGB();
    Vector3 n = basis.toStandard(c.r() - 0.5, 0.5 - c.g(), c.b() - 0.5).unit();
    Vector3 u = basis.u();
    Vector3 v = basis.v();

    basis = Basis3.fromWUV(n, u, v);
    context.setShadingBasis(basis);
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.color.ColorModel#fromXYZ(double, double, double)
   */
  @Override
  public Spectrum fromXYZ(double x, double y, double z) {
    RGB rgb = ColorUtil.convertXYZ2RGB(x, y, z);
    return fromRGB(rgb.r(), rgb.g(), rgb.b());
  }
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.color.Color#toRGB()
   */
  public RGB toRGB() {
    return new RGB(r, g, b);
  }
View Full Code Here

   * @param r The value to set the red channel to.
   * @param g The value to set the green channel to.
   * @param b The value to set the blue channel to.
   */
  public void setPixelRGB(int x, int y, double r, double g, double b) {
    setPixelRGB(x, y, new RGB(r, g, b));
  }
View Full Code Here

  public void setTiles(TileDescription value) {
    attributes.put("tiles", value);
  }

  public RGB getRGB(int x, int y) {
    return new RGB(
        getFloat(x, y, "R"),
        getFloat(x, y, "G"),
        getFloat(x, y, "B"));
  }
View Full Code Here

      OpenEXRImage image = new OpenEXRImage(640, 480);
      image.getChannelList().addChannel(new Channel("R", PixelType.FLOAT));
      image.getChannelList().addChannel(new Channel("G", PixelType.FLOAT));
      image.getChannelList().addChannel(new Channel("B", PixelType.FLOAT));
      image.setCompressionMethod(CompressionMethod.ZIP);
      image.setRGB(320, 240, new RGB(1,0,0));
//      image.attributes.put("compression", CompressionMethod.NONE);

//      PrintStream out = new PrintStream(new FileOutputStream("/home/brad/Downloads/openexr-images-1.5.0/ScanLines/Blobbies2.test"));
//      for (int y = -20; y < 1020; y++) {
//        for (int x = -20; x < 1020; x++) {
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.display.visualizer.ColorVisualizer#visualize(ca.eandb.jmist.framework.color.Color)
   */
  @Override
  public RGB visualize(Color color) {
    RGB rgb = inner.visualize(color);
    if (highlightNegativeCheckBox.isSelected()
        && (rgb.r() < 0.0 || rgb.g() < 0.0 || rgb.b() < 0.0)) {
      return negative;
    } else if (highlightUnderCheckBox.isSelected()
        && (rgb.r() < EPSILON && rgb.g() < EPSILON && rgb.b() < EPSILON)) {
      return underexposed;
    } else if (highlightOverCheckBox.isSelected()
        && (rgb.r() >= 1.0 - EPSILON && rgb.g() >= 1.0 - EPSILON && rgb
            .b() >= 1.0 - EPSILON)) {
      return overexposed;
    }
    return rgb;
  }
View Full Code Here

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

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.Display#fill(int, int, int, int, ca.eandb.jmist.framework.color.Color)
   */
  @Override
  public void fill(int x, int y, int w, int h, Color color) {
    RGB rgb = color.toRGB();
    for (int j = y; j < y + h; j++) {
      for (int i = x; i < x + w; i++) {
        picture.setPixelRGB(i, j, rgb);
      }
    }
View Full Code Here

TOP

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

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.