Examples of Pixel


Examples of org.jwildfire.image.Pixel

    double rZoom = 1.0 / this.zoom;
    int width = pImg.getImageWidth();
    int height = pImg.getImageHeight();
    SimpleImage xMap = (displaceXMap != null) ? displaceXMap.getImage() : null;
    SimpleImage yMap = (displaceYMap != null) ? displaceYMap.getImage() : null;
    Pixel pPixel = new Pixel();
    double w1 = (double) width - 1.0;
    double h1 = (double) height - 1.0;
    double cx = (double) width / 2.0;
    double cy = (double) height / 2.0;
    for (int pY = 0; pY < height; pY++) {
View Full Code Here

Examples of org.jwildfire.image.Pixel

  @Override
  protected void performPixelTransformation(WFImage pImg) {
    SimpleImage img = (SimpleImage) pImg;
    int width = pImg.getImageWidth();
    int height = pImg.getImageHeight();
    Pixel rgbPixel = new Pixel();
    HSLPixel hslPixel = new HSLPixel();

    double phue = (double) (this.hue) / 255.0;
    if (phue < (-1.0))
      phue = -1;
    else if (phue > 1.0)
      phue = 1.0;
    double psaturation = (double) (this.saturation) / 255.0;
    if (psaturation < (-1.0))
      psaturation = -1.0;
    else if (psaturation > 1.0)
      psaturation = 1.0;
    double pluminosity = (double) (this.luminosity) / 255.0;
    if (pluminosity < (-1.0))
      pluminosity = -1;
    else if (pluminosity > 1.0)
      pluminosity = 1.0;
    for (int i = 0; i < height; i++) {
      for (int j = 0; j < width; j++) {
        rgbPixel.setARGBValue(img.getARGBValue(j, i));
        rgb2hsl(rgbPixel, hslPixel);
        hslPixel.luminosity += pluminosity;
        if (hslPixel.luminosity < 0.0)
          hslPixel.luminosity = 0.0;
        else if (hslPixel.luminosity > 1.0)
View Full Code Here

Examples of org.jwildfire.image.Pixel

    double t = this.frames != 0 ? (double) this.frame / (double) this.frames : 0.0;
    shift = 2.0 * shift / (double) (width - 1);
    double w1 = (double) width - 1.0;
    double h1 = (double) height - 1.0;

    Pixel pPixel = new Pixel();
    for (int pY = 0; pY < height; pY++) {
      for (int pX = 0; pX < width; pX++) {
        pPixel.setARGBValue(pImg.getARGBValue(pX, pY));

        double x0 = (double) pX - cx;
        double y0 = (double) pY - cy;
        double sangle = shift * pX;
        double dl = (y0 - sangle) / wavelength;
View Full Code Here

Examples of org.jwildfire.image.Pixel

    double t = this.frames != 0 ? (double) this.frame / (double) this.frames : 0.0;
    shift = 2.0 * shift / (double) (height - 1);
    double w1 = (double) width - 1.0;
    double h1 = (double) height - 1.0;

    Pixel pPixel = new Pixel();
    for (int pY = 0; pY < height; pY++) {
      for (int pX = 0; pX < width; pX++) {
        pPixel.setARGBValue(pImg.getARGBValue(pX, pY));
        /* transform the point */
        double x0 = (double) pX - cx;
        double y0 = (double) pY - cy;
        double sangle = shift * pY;
        double dl = (x0 - sangle) / wavelength;
View Full Code Here

Examples of org.jwildfire.image.Pixel

    shift = 2.0 * shift / (double) (width - 1);
    double amp = amplitude;
    double t = this.frames != 0 ? (double) this.frame / (double) this.frames : 0.0;
    double w1 = (double) width - 1.0;
    double h1 = (double) height - 1.0;
    Pixel pPixel = new Pixel();
    for (int pY = 0; pY < height; pY++) {
      for (int pX = 0; pX < width; pX++) {
        pPixel.setARGBValue(pImg.getARGBValue(pX, pY));
        /* transform the point */
        double x0 = (double) pX - cx;
        double y0 = (double) pY - cy;
        double dl = (y0 - shift * pX) / wavelength;
        double zz = amp * Math.sin((PI2 * (t - dl)) + phase);
View Full Code Here

Examples of org.jwildfire.image.Pixel

    shift = 2.0 * shift / (double) (height - 1);
    double amp = amplitude;
    double t = this.frames != 0 ? (double) this.frame / (double) this.frames : 0.0;
    double w1 = (double) width - 1.0;
    double h1 = (double) height - 1.0;
    Pixel pPixel = new Pixel();
    for (int pY = 0; pY < height; pY++) {
      for (int pX = 0; pX < width; pX++) {
        pPixel.setARGBValue(pImg.getARGBValue(pX, pY));
        /* transform the point */
        double x0 = (double) pX - cx;
        double y0 = (double) pY - cy;
        double dl = (x0 - shift * pY) / wavelength;
        double zz = amp * Math.sin((PI2 * (t - dl)) + phase);
View Full Code Here

Examples of org.jwildfire.image.Pixel

        if (x1 < 0)
          x1 = 0;
        int x2 = col - dx + blockWidth;
        if (x2 > imgWidth - dx)
          x2 = imgWidth - dx;
        Pixel p = block.computeAVGColor(pImg, x1, x2, y1, y2);
        if (!filteredByGenlock(p)) {
          block.prepareTransformation(blockScale, blockScaleVariance, blockAngleAlpha, blockAngleBeta, blockAngleVariance);
          block.createBlock(pImg, x1, x2, y1, y2, zsize2, p.getARGBValue());
          block.transformBlock(x1, x2, y1, y2, xMin, yMin);
          block.addToMainStructure(x, y, z, pp1, pp2, pp3, color, currP, currF);
          currF += block.getFCount();
          currP += block.getPCount();
        }
View Full Code Here

Examples of org.jwildfire.image.Pixel

        z[i] = z[i] * scale;
      }
    }

    protected Pixel computeAVGColor(SimpleImage pImg, int pX1, int pX2, int pY1, int pY2) {
      Pixel p = new Pixel();
      double red = 0.0;
      double green = 0.0;
      double blue = 0.0;
      int count = 0;
      for (int i = pX1; i < pX2; i++) {
        for (int j = pY1; j < pY2; j++) {
          p.setARGBValue(pImg.getARGBValue(i, j));
          red += p.r;
          green += p.g;
          blue += p.b;
          count++;
        }
View Full Code Here

Examples of org.jwildfire.image.Pixel

  @Override
  protected void performPixelTransformation(WFImage pImg) {
    SimpleImage img = (SimpleImage) pImg;
    int width = pImg.getImageWidth();
    int height = pImg.getImageHeight();
    Pixel pixel = new Pixel();
    if (axis == Axis.X) {
      for (int i = 0; i < height; i++) {
        for (int j = 0; j < width; j++) {
          pixel.setARGBValue(srcImg.getARGBValue(width - j - 1, i));
          img.setRGB(j, i, pixel);
        }
      }
    }
    else if (axis == Axis.Y) {
      for (int i = 0; i < height; i++) {
        for (int j = 0; j < width; j++) {
          pixel.setARGBValue(srcImg.getARGBValue(j, height - i - 1));
          img.setRGB(j, i, pixel);
        }
      }
    }
    else if (axis == Axis.XY) {
      for (int i = 0; i < height; i++) {
        for (int j = 0; j < width; j++) {
          pixel.setARGBValue(srcImg.getARGBValue(width - j - 1, height - i - 1));
          img.setRGB(j, i, pixel);
        }
      }
    }
  }
View Full Code Here

Examples of org.jwildfire.image.Pixel

            maxIdx = idx;
          colorMap.put(idx, Integer.parseInt(matcher.group(6)));
        }
      }
      Integer lastColor = 0;
      Pixel toolPixel = new Pixel();
      for (int i = 0; i < maxIdx; i++) {
        if (i < width) {
          Integer color = colorMap.get(i);
          if (color == null) {
            color = lastColor;
          }
          else {
            lastColor = color;
          }
          toolPixel.setARGBValue(color);
          for (int j = 0; j < height; j++) {
            // is bgr, not rgb
            res.setRGB(i, j, toolPixel.b, toolPixel.g, toolPixel.r);
          }
        }
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.