Package processing.core

Examples of processing.core.PImage


    }
    map.addMarkers(markers);

    if (useShaderWithMarker) {
      // Mask shader also shades markers
      PImage maskImage = loadImage("test/mask-circular.png");
      shader = new MaskedMapDisplayShader(this, 400, 400, maskImage);
    } else {
      // Blur shader does not shade marker
      shader = new BlurredMapDisplayShader(this);
    }
View Full Code Here


  public void setup() {
    size(400, 400, OPENGL);
    map = new UnfoldingMap(this);
    MapUtils.createDefaultEventDispatcher(this, map);

    PImage maskImage = loadImage("test/mask-circular.png");
    mapDisplayShader = new MaskedMapDisplayShader(this, 400, 400, maskImage);
    ((OpenGLMapDisplay) map.mapDisplay).setMapDisplayShader(mapDisplayShader);
  }
View Full Code Here

          tracker.waitForAll();
        } catch (InterruptedException e) {
          // e.printStackTrace(); // non-fatal, right?
        }

        image = new PImage(awtImage);
      }
    } catch (Exception e) {
      println(e);
    }
  }
View Full Code Here

    // If the palettes have not been created then create them
    // otherwise do nothing
    if(palettes != null)
      return;
    // Load the image
    PImage image = null;;
    InputStream is = app.createInput("user_gui_palette.png");
    if(is != null){
      try {
        is.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
      image = app.loadImage("user_gui_palette.png");
      GMessenger.message(USER_COL_SCHEME, null);
    }
    else {
      // User image not provided
      image = app.loadImage("default_gui_palette.png");
    }
    // Now make the palletes
    palettes = new int[16][16];
    jpalettes = new Color[16][16];
    for(int p = 0; p <16; p++)
      for(int c = 0; c < 16; c++){
        int col =  image.get(c * 16 + 8, p * 16 + 8);
        palettes[p][c] = col;
        jpalettes[p][c] = new Color((col >> 16) & 0xff, (col >> 8) & 0xff, col & 0xff);
      }
  }
View Full Code Here

    // If the palettes have not been created then create them
    // otherwise do nothing
    if(palettes != null)
      return;
    // Load the image
    PImage image = new PImage((new javax.swing.ImageIcon(new GCScheme().getClass().getResource("/data/default_gui_palette.png"))).getImage());
    // Now make the palletes
    palettes = new int[16][16];
    jpalettes = new Color[16][16];
    for(int p = 0; p <16; p++)
      for(int c = 0; c < 16; c++){
        int col =  image.get(c * 16 + 8, p * 16 + 8);
        palettes[p][c] = col;
        jpalettes[p][c] = new Color((col >> 16) & 0xff, (col >> 8) & 0xff, col & 0xff);
      }
  }
View Full Code Here

   * @param nbrRows number of tiles vertically
   */
  public GImageToggleButton(PApplet theApplet, float p0, float p1, String offPicture, String overPicture, int nbrCols, int nbrRows){
    super(theApplet, p0, p1, 0, 0);
    // Attempt to get off-control image data
    PImage temp = null;
    if(nbrCols < 1 || nbrRows < 1 || offPicture == null || null == (temp = ImageManager.loadImage(winApp, offPicture))){
      // Invalid data use default
      nbrStates = 2;
      if(toggle == null)
        toggle = ImageManager.loadImage(winApp, TOGGLE);
View Full Code Here

   */
  public static PImage loadImage(PApplet app, String filename){
    if(textures.containsKey(filename)){
      return textures.get(filename);
    }
    PImage image = app.loadImage(filename);
    if(image != null){
      textures.put(filename, image);
    }
    else
      PApplet.println("Unable to load image from file '" + filename+"'");
View Full Code Here

   * @param nbrImages number of tiled images in the icon
   * @param horz LEFT or RIGHT
   * @param vert TOP, MIDDLE, BOTTOM
   */
  public void setIcon(String fname, int nbrImages, GAlign horz, GAlign vert){
    PImage iconImage = ImageManager.loadImage(winApp, fname);
    setIcon(iconImage, nbrImages, horz, vert);
  }
View Full Code Here

      prettyHints(canvas);
      canvas.background(255);
      r.render(canvas, 0, 0, canvas.width, canvas.height,true);
      canvas.endDraw();
      canvas.loadPixels();
      PImage img = canvas.get();
      canvas.dispose();
      img.loadPixels();
      img.save(f.getAbsolutePath());
    } catch (RuntimeException e)
    {
    } finally
    {
      p.loop();
View Full Code Here

    camera = c;
  }

  public Cursor createCursor(String filename, int offsetX, int offsetY)
  {
    PImage img = p.loadImage(filename);
    Dimension d = Toolkit.getDefaultToolkit().getBestCursorSize(img.width,
        img.height);
    PImage resized = p.createImage(d.width, d.height, PImage.ARGB);
    resized.copy(img, 0, 0, img.width, img.height, 0, 0, img.width,
        img.height);
    Image image = UIUtils.PImageToImage(resized);
    return Toolkit.getDefaultToolkit().createCustomCursor(image,
        new java.awt.Point(offsetX, offsetY), "asdf");
  }
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.