Package processing.core

Examples of processing.core.PImage


    }
    img.loadPixels();
    return img;
  }
  public PImage getImage(int nX, int nY, double[] brightness) {
    PImage img = parent.createImage(nX, nY, PApplet.RGB);
    for (int i = 0; i < brightness.length; i++) {
      float b=Math.abs((int) brightness[i]);
      if (b<0)b=0;
      img.pixels[i] = parent.color(b);
    }
    img.loadPixels();
    return img;
  }
View Full Code Here


    img.loadPixels();
    return img;
  }

  public PImage getNormalizedImage(int nX, int nY,float goalMin,float goalMax, double[] brightness) {
    PImage img = parent.createImage(nX, nY, PApplet.RGB);
    double min = MatrixMath.min(brightness);
    double max = MatrixMath.max(brightness);
    for (int i = 0; i < brightness.length; i++) {
      float cB = PApplet.map((float) brightness[i], (float) min,
          (float) max, goalMin, goalMax);
      img.pixels[i] = parent.color(cB);
    }
    img.loadPixels();
    return img;
  }
View Full Code Here

     * @return filtered version of the image (with alpha channel set to full
     *         opacity)
     */

    public static PImage adaptiveThreshold(PImage img, int ks, int c) {
        PImage img2 = new PImage(img.width, img.height);
        img2.format = img.format;
        img2.pixels = adaptiveThreshold(img.pixels, img.width, img.height, ks,
                c);
        return img2;
    }
View Full Code Here

     * @param img
     * @param isInverted
     * @return filtered result as new image
     */
    public static PImage erodePixels(PImage img, boolean isInverted) {
        PImage img2 = new PImage(img.width, img.height);
        img2.format = img.format;
        img2.pixels = erodePixels(img.pixels, img.width, img.height, isInverted);
        return img2;
    }
View Full Code Here

     * @return filtered version of the image (with alpha channel set to full
     *         opacity)
     */

    public static PImage stretchLevels(PImage img, int lolim, int uplim) {
        PImage img2 = new PImage(img.width, img.height);
        img2.format = img.format;
        img2.pixels = stretchLevels(img.pixels, lolim, uplim);
        return img2;
    }
View Full Code Here

    private String fileName;

    TiledFrameExporter(PApplet p, int n) {
        parent = p;
        numTiles = n;
        buffer = new PImage(p.width * n, p.height * n);
        offsets = new Vec3D[numTiles * numTiles];
        normTileSize = 2.0 / numTiles;
        aspect = (double) p.height / p.width;
        int idx = 0;
        double y = 1 - normTileSize;
View Full Code Here

  public static PImage imgResize(PImage img,float w) {
    BufferedImage tmp=(BufferedImage )img.getImage();
    float mod=w/(float)tmp.getWidth();
//    log("mod "+mod+" dim "+tmp.getWidth()+" "+tmp.getHeight());
   
    PImage tmp2=new PImage(tmp.getScaledInstance(
        (int)w, (int)Math.round((float)tmp.getHeight()*mod),  
        java.awt.Image.SCALE_SMOOTH));
   
//    log("mod "+mod+" dim "+tmp2.width+" "+tmp2.height);

View Full Code Here

  public static PImage imgResize(PImage img,float w) {
    BufferedImage tmp=(BufferedImage )img.getImage();
    float mod=w/(float)tmp.getWidth();
//    log("mod "+mod+" dim "+tmp.getWidth()+" "+tmp.getHeight());
   
    PImage tmp2=new PImage(tmp.getScaledInstance(
        (int)w, (int)Math.round((float)tmp.getHeight()*mod),  
        java.awt.Image.SCALE_SMOOTH));
   
//    log("mod "+mod+" dim "+tmp2.width+" "+tmp2.height);

View Full Code Here

  public static PImage imgResize(PImage img,float w) {
    BufferedImage tmp=(BufferedImage )img.getImage();
    float mod=w/(float)tmp.getWidth();
//    log("mod "+mod+" dim "+tmp.getWidth()+" "+tmp.getHeight());
   
    PImage tmp2=new PImage(tmp.getScaledInstance(
        (int)w, (int)Math.round((float)tmp.getHeight()*mod),  
        java.awt.Image.SCALE_SMOOTH));
   
//    log("mod "+mod+" dim "+tmp2.width+" "+tmp2.height);

View Full Code Here

  public static PImage imgResize(PImage img,float w) {
    BufferedImage tmp=(BufferedImage )img.getImage();
    float mod=w/(float)tmp.getWidth();
//    log("mod "+mod+" dim "+tmp.getWidth()+" "+tmp.getHeight());
   
    PImage tmp2=new PImage(tmp.getScaledInstance(
        (int)w, (int)Math.round((float)tmp.getHeight()*mod),  
        java.awt.Image.SCALE_SMOOTH));
   
//    log("mod "+mod+" dim "+tmp2.width+" "+tmp2.height);

View Full Code Here

TOP

Related Classes of processing.core.PImage

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.