Examples of fromRGB()


Examples of ca.eandb.jmist.framework.color.ColorModel.fromRGB()

    int      y    = MathUtil.clamp((int) Math.floor(v * (double) h), 0, h - 1);
    ColorModel  cm    = lambda.getColorModel();

    switch (picture.getFormat()) {
      case RGBE:
        return cm.fromRGB(picture.getPixelRGB(x, y)).sample(lambda);
      case XYZE:
        return cm.fromXYZ(picture.getPixelXYZ(x, y)).sample(lambda);
      default:
        return cm.getBlack(lambda);
    }
View Full Code Here

Examples of ca.eandb.jmist.framework.color.ColorModel.fromRGB()

    } else {
      switch (pixel.length) {
      case 1:
        return cm.getGray(pixel[0], lambda);
      case 3:
        return cm.fromRGB(pixel[0]/255.0, pixel[1]/255.0, pixel[2]/255.0).sample(lambda);
      case 4:
      {
        double alpha = pixel[3] / 255.0;
        if (MathUtil.equal(alpha, 1.0)) {
          return cm.fromRGB(pixel[0]/255.0, pixel[1]/255.0, pixel[2]/255.0).sample(lambda);
View Full Code Here

Examples of ca.eandb.jmist.framework.color.ColorModel.fromRGB()

        return cm.fromRGB(pixel[0]/255.0, pixel[1]/255.0, pixel[2]/255.0).sample(lambda);
      case 4:
      {
        double alpha = pixel[3] / 255.0;
        if (MathUtil.equal(alpha, 1.0)) {
          return cm.fromRGB(pixel[0]/255.0, pixel[1]/255.0, pixel[2]/255.0).sample(lambda);
        } else if (MathUtil.equal(alpha, 0.0)) {
          return background.evaluate(p, lambda);
        } else {
          Color bg = background.evaluate(p, lambda);
          Color fg = cm.fromRGB(pixel[0]/255.0, pixel[1]/255.0, pixel[2]/255.0).sample(lambda);
View Full Code Here

Examples of ca.eandb.jmist.framework.color.ColorModel.fromRGB()

          return cm.fromRGB(pixel[0]/255.0, pixel[1]/255.0, pixel[2]/255.0).sample(lambda);
        } else if (MathUtil.equal(alpha, 0.0)) {
          return background.evaluate(p, lambda);
        } else {
          Color bg = background.evaluate(p, lambda);
          Color fg = cm.fromRGB(pixel[0]/255.0, pixel[1]/255.0, pixel[2]/255.0).sample(lambda);
          return fg.times(alpha).plus(bg.times(1.0 - alpha));
        }
      }
      default:
        throw new RuntimeException("Raster has unrecognized number of bands.");
View Full Code Here

Examples of com.lightcrafts.mediax.jai.ColorSpaceJAI.fromRGB()

                 WritableRaster dest,
                 ImageParameters dstParam){
  src = convertRasterToUnsigned(src);
  ColorSpaceJAI colorSpaceJAI
      = (ColorSpaceJAI) dstParam.getColorModel().getColorSpace();
        dest = colorSpaceJAI.fromRGB(src, srcParam.getComponentSize(), dest,
             dstParam.getComponentSize());

  dest = convertRasterToSigned(dest);
  return dest;
    }
View Full Code Here

Examples of com.lightcrafts.mediax.jai.ColorSpaceJAI.fromRGB()

                 WritableRaster dest,
                 ImageParameters dstParam){
  src = convertRasterToUnsigned(src);
  ColorSpaceJAI colorSpaceJAI
      = (ColorSpaceJAI) dstParam.getColorModel().getColorSpace();
        dest = colorSpaceJAI.fromRGB(src, srcParam.getComponentSize(), dest,
             dstParam.getComponentSize());
  dest = convertRasterToSigned(dest);
  return dest;
    }
View Full Code Here

Examples of com.lightcrafts.mediax.jai.IHSColorSpace.fromRGB()

    static Color relight(Color color, float amount) {
        IHSColorSpace ihs = IHSColorSpace.getInstance();

        float components[] = new float[3];
        components = ihs.fromRGB(color.getColorComponents(components));
        components[0] *= amount;
        components = ihs.toRGB(components);
        return new Color(components[0], components[1], components[2]);
    }

View Full Code Here

Examples of java.awt.color.ColorSpace.fromRGB()

     *
     */
    public float[] fromRGB(float[] rgbvalue)
    {
        ColorSpace colorspaceXYZ = ColorSpace.getInstance(CS_CIEXYZ);
        return fromCIEXYZ(colorspaceXYZ.fromRGB(rgbvalue));
    }

    /**
     * {@inheritDoc}
     *
 
View Full Code Here

Examples of java.awt.color.ColorSpace.fromRGB()

    for (int i = 0; i < rgb.length; i++) {
      // get the RGB values
      rgbValue[0] = (rgb[i] >> 16) & 0xFF; // RED
      rgbValue[1] = (rgb[i] >> 8) & 0xFF; // GREEN
      rgbValue[2] = (rgb[i] >> 0) & 0xFF; // BLUE
      float[] luv = space.fromRGB(rgbValue);
      double[] arr = new double[luv.length];
      for (int x = 0; x < luv.length; x++) {
        arr[x] = luv[x];
      }
      vectors[currentIndex++] = new DenseDoubleVector(arr);
View Full Code Here

Examples of javax.media.jai.ColorSpaceJAI.fromRGB()

                 WritableRaster dest,
                 ImageParameters dstParam){
  src = convertRasterToUnsigned(src);
  ColorSpaceJAI colorSpaceJAI
      = (ColorSpaceJAI) dstParam.getColorModel().getColorSpace();
        dest = colorSpaceJAI.fromRGB(src, srcParam.getComponentSize(), dest,
             dstParam.getComponentSize());
  dest = convertRasterToSigned(dest);
  return dest;
    }
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.