mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 17:40:48 +01:00
getting PGraphics.java ironed out
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -496,51 +496,39 @@ public class PGraphics2 extends PGraphics {
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// IMAGES
|
||||
|
||||
|
||||
protected void draw_image(PImage image,
|
||||
float x1, float y1, float x2, float y2,
|
||||
int u1, int v1, int u2, int v2) {
|
||||
graphics.drawImage((Image) image.cache,
|
||||
(int) x1, (int) y1, (int) x2, (int) y2,
|
||||
u1, v1, u2, v2, null);
|
||||
}
|
||||
|
||||
|
||||
public void image(PImage image, float x1, float y1) {
|
||||
image(image, x1, y1, image.width, image.height);
|
||||
}
|
||||
|
||||
|
||||
public void image(PImage image,
|
||||
float x1, float y1, float x2, float y2) {
|
||||
if (imageMode == CORNER) {
|
||||
x2 += x1; // x2 is width, need to add x1
|
||||
y2 += y1;
|
||||
|
||||
} else if ((imageMode == CENTER) ||
|
||||
(imageMode == CENTER_RADIUS)) {
|
||||
x1 -= image.width /2f;
|
||||
y1 -= image.height / 2f;
|
||||
}
|
||||
check_image_cache(image);
|
||||
//graphics.drawImage((Image) image.cache, x1, y1, x2, y2, null);
|
||||
graphics.drawImage((Image) image.cache,
|
||||
(int)x1, (int)y1, (int)x2, (int)y2, null);
|
||||
super.image(image, x1, y1);
|
||||
}
|
||||
|
||||
|
||||
public void image(PImage image,
|
||||
float x1, float y1, float x2, float y2,
|
||||
float a, float b, float c, float d) {
|
||||
check_image_cache(image);
|
||||
super.image(image, a, b, c, d);
|
||||
}
|
||||
|
||||
|
||||
public void image(PImage image,
|
||||
float a, float b, float c, float d,
|
||||
float u1, float v1, float u2, float v2) {
|
||||
if (imageMode == CORNER) {
|
||||
x2 += x1; // x2 is width, need to add x1
|
||||
y2 += y1;
|
||||
|
||||
} else if ((imageMode == CENTER) ||
|
||||
(imageMode == CENTER_RADIUS)) {
|
||||
x1 -= image.width /2f;
|
||||
y1 -= image.height / 2f;
|
||||
}
|
||||
check_image_cache(image);
|
||||
graphics.drawImage((Image) image.cache,
|
||||
(int)x1, (int)y1, (int)x2, (int)y2,
|
||||
(int)u1, (int)v1, (int)u2, (int)v2,
|
||||
null);
|
||||
super.image(image, a, b, c, d, u1, v1, u2, v2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1415,6 +1415,58 @@ public class PGraphics3 extends PGraphics {
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// SHAPES
|
||||
|
||||
public void point(float x, float y) {
|
||||
point(x, y, 0);
|
||||
}
|
||||
|
||||
public void point(float x, float y, float z) {
|
||||
}
|
||||
|
||||
public void line(float x1, float y1, float x2, float y2) {
|
||||
line(x1, y1, 0, x2, y2, 0);
|
||||
}
|
||||
|
||||
public void line(float x1, float y1, float z1,
|
||||
float x2, float y2, float z2) {
|
||||
}
|
||||
|
||||
public void triangle(float x1, float y1, float x2, float y2,
|
||||
float x3, float y3) {
|
||||
}
|
||||
|
||||
//public void rectMode(int mode)
|
||||
|
||||
public void rect(float x1, float y1, float x2, float y2) {
|
||||
}
|
||||
|
||||
public void quad(float x1, float y1, float x2, float y2,
|
||||
float x3, float y3, float x4, float y4) {
|
||||
}
|
||||
|
||||
public void circle(float x, float y, float radius) {
|
||||
}
|
||||
|
||||
public void ellipseMode(int mode) {
|
||||
}
|
||||
|
||||
public void ellipse(float x, float y, float hradius, float vradius) {
|
||||
}
|
||||
|
||||
//public void arcMode(int mode)
|
||||
|
||||
public void arc(float start, float stop,
|
||||
float x, float y, float radius) {
|
||||
}
|
||||
|
||||
public void arc(float start, float stop,
|
||||
float x, float y, float hr, float vr) {
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
// CURVES
|
||||
|
||||
@@ -147,13 +147,13 @@ public interface PMethods {
|
||||
public void quad(float x1, float y1, float x2, float y2,
|
||||
float x3, float y3, float x4, float y4);
|
||||
|
||||
public void circle(float x, float y, float radius);
|
||||
//public void circle(float x, float y, float radius);
|
||||
|
||||
public void ellipseMode(int mode);
|
||||
|
||||
public void ellipse(float x, float y, float hradius, float vradius);
|
||||
|
||||
public void arcMode(int mode);
|
||||
//public void arcMode(int mode);
|
||||
|
||||
public void arc(float start, float stop,
|
||||
float x, float y, float radius);
|
||||
@@ -175,21 +175,6 @@ public interface PMethods {
|
||||
|
||||
//
|
||||
|
||||
public void image(PImage image, float x1, float y1);
|
||||
|
||||
public void image(PImage image,
|
||||
float x1, float y1, float x2, float y2);
|
||||
|
||||
public void image(PImage image,
|
||||
float x1, float y1, float x2, float y2,
|
||||
float u1, float v1, float u2, float v2);
|
||||
|
||||
//public void cache(PImage image);
|
||||
|
||||
//public void cache(PImage images[]);
|
||||
|
||||
//
|
||||
|
||||
public float bezierPoint(float a, float b, float c, float d,
|
||||
float t);
|
||||
|
||||
@@ -227,15 +212,29 @@ public interface PMethods {
|
||||
float x2, float y2, float z2,
|
||||
float x3, float y3, float z3,
|
||||
float x4, float y4, float z4);
|
||||
//
|
||||
|
||||
public void image(PImage image, float x1, float y1);
|
||||
|
||||
public void image(PImage image,
|
||||
float x1, float y1, float x2, float y2);
|
||||
|
||||
public void image(PImage image,
|
||||
float x1, float y1, float x2, float y2,
|
||||
int u1, int v1, int u2, int v2);
|
||||
|
||||
//public void cache(PImage image);
|
||||
|
||||
//public void cache(PImage images[]);
|
||||
|
||||
//
|
||||
|
||||
public void textFont(PFont which);
|
||||
|
||||
public void textSize(float size);
|
||||
|
||||
public void textFont(PFont which, float size);
|
||||
|
||||
public void textSize(float size);
|
||||
|
||||
public void textLeading(float leading);
|
||||
|
||||
public void textMode(int mode);
|
||||
@@ -274,10 +273,10 @@ public interface PMethods {
|
||||
|
||||
public void rotateY(float angle);
|
||||
|
||||
public void rotate(float angle);
|
||||
|
||||
public void rotateZ(float angle);
|
||||
|
||||
public void rotate(float angle);
|
||||
|
||||
public void rotate(float angle, float v0, float v1, float v2);
|
||||
|
||||
public void scale(float s);
|
||||
@@ -286,11 +285,6 @@ public interface PMethods {
|
||||
|
||||
public void scale(float x, float y, float z);
|
||||
|
||||
public void transform(float n00, float n01, float n02, float n03,
|
||||
float n10, float n11, float n12, float n13,
|
||||
float n20, float n21, float n22, float n23,
|
||||
float n30, float n31, float n32, float n33);
|
||||
|
||||
public void push();
|
||||
|
||||
public void pop();
|
||||
@@ -432,4 +426,9 @@ public interface PMethods {
|
||||
public void background(PImage image);
|
||||
|
||||
public void clear();
|
||||
|
||||
//
|
||||
|
||||
// color(), alpha(), red(), green(), blue(),
|
||||
// hue(), saturation(), brightness()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user