Package processing.core

Examples of processing.core.PGraphics.translate()


    //saveImg.hint(PApplet.DISABLE_STROKE_PERSPECTIVE);

    saveImg.smooth(8);
    saveImg.pushMatrix();

    saveImg.translate(-minX + border, -minY + border);
    this.renderSilhouette(saveImg);

    saveImg.popMatrix();
    saveImg.endDraw();
    return saveImg;
View Full Code Here


    // Transforms (outer) map pane, and draws inner map + marker onto canvas
    // This cuts off marker at the border.
    PGraphics canvasPG = papplet.g;
    canvasPG.pushMatrix();
    canvasPG.translate(offsetX, offsetY);
    canvasPG.applyMatrix(matrix);
   
    textureDistorter.draw(canvasPG, offscreenPG);
    //canvasPG.image(offscreenCutoffPG.getTexture(), 0, 0);
    canvasPG.popMatrix();
View Full Code Here

      pg.background(bgColor);
    }

    // translate and scale, from the middle
    pg.pushMatrix();
    pg.translate((float) innerOffsetX, (float) innerOffsetY);
    if (pg.is3D()) {
      pg.applyMatrix(innerMatrix);
    } else {
      pg.applyMatrix(innerMatrix.m00, innerMatrix.m01, innerMatrix.m03, innerMatrix.m10, innerMatrix.m11,
          innerMatrix.m13);
View Full Code Here

    // Transforms (outer) map pane, and draws inner map + marker onto canvas
    // This cuts off marker at the border.
    PGraphics canvasPG = papplet.g;
    canvasPG.pushMatrix();
    canvasPG.translate(offsetX, offsetY);
    if (canvasPG.is3D()) {
      canvasPG.applyMatrix(matrix);
    } else {
      canvasPG.applyMatrix(matrix.m00, matrix.m01, matrix.m03, matrix.m10, matrix.m11, matrix.m13);
    }
View Full Code Here

  // By amnon.owed, http://forum.processing.org/topic/extract-circle-texture-from-background-with-alpha-channel
  public PImage getCircularImage(PImage img, int radius, int feather) {
    PGraphics temp = p.createGraphics(img.width, img.height, PConstants.JAVA2D);
    temp.beginDraw();
    temp.smooth();
    temp.translate(temp.width / 2, temp.height / 2);
    temp.imageMode(PConstants.CENTER);
    temp.image(img, 0, 0);
    temp.endDraw();
    PImage saveArea = p.createImage(temp.width, temp.height, PConstants.ARGB);
    for (int y = 0; y < saveArea.height; y++) {
View Full Code Here

  // By amnon.owed, http://forum.processing.org/topic/extract-circle-texture-from-background-with-alpha-channel
  public PImage getCircularImage(PImage img, int radius, int feather) {
    PGraphics temp = p.createGraphics(img.width, img.height, PConstants.JAVA2D);
    temp.beginDraw();
    temp.smooth();
    temp.translate(temp.width / 2, temp.height / 2);
    temp.imageMode(PConstants.CENTER);
    temp.image(img, 0, 0);
    temp.endDraw();
    PImage saveArea = p.createImage(temp.width, temp.height, PConstants.ARGB);
    for (int y = 0; y < saveArea.height; y++) {
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.