MCPcopy Create free account
hub / github.com/benfry/processing4 / imageImpl

Method imageImpl

core/src/processing/core/PGraphics.java:3992–4042  ·  view source on GitHub ↗

Expects x1, y1, x2, y2 coordinates where (x2 >= x1) and (y2 >= y1). If tint() has been called, the image will be colored. The default implementation draws an image as a textured quad. The (u, v) coordinates are in image space (they're ints, after all..)

(PImage img,
                           float x1, float y1, float x2, float y2,
                           int u1, int v1, int u2, int v2)

Source from the content-addressed store, hash-verified

3990 * The (u, v) coordinates are in image space (they're ints, after all..)
3991 */
3992 protected void imageImpl(PImage img,
3993 float x1, float y1, float x2, float y2,
3994 int u1, int v1, int u2, int v2) {
3995 boolean savedStroke = stroke;
3996// boolean savedFill = fill;
3997 int savedTextureMode = textureMode;
3998
3999 stroke = false;
4000// fill = true;
4001 textureMode = IMAGE;
4002
4003// float savedFillR = fillR;
4004// float savedFillG = fillG;
4005// float savedFillB = fillB;
4006// float savedFillA = fillA;
4007//
4008// if (tint) {
4009// fillR = tintR;
4010// fillG = tintG;
4011// fillB = tintB;
4012// fillA = tintA;
4013//
4014// } else {
4015// fillR = 1;
4016// fillG = 1;
4017// fillB = 1;
4018// fillA = 1;
4019// }
4020
4021 u1 *= img.pixelDensity;
4022 u2 *= img.pixelDensity;
4023 v1 *= img.pixelDensity;
4024 v2 *= img.pixelDensity;
4025
4026 beginShape(QUADS);
4027 texture(img);
4028 vertex(x1, y1, u1, v1);
4029 vertex(x1, y2, u1, v2);
4030 vertex(x2, y2, u2, v2);
4031 vertex(x2, y1, u2, v1);
4032 endShape();
4033
4034 stroke = savedStroke;
4035// fill = savedFill;
4036 textureMode = savedTextureMode;
4037
4038// fillR = savedFillR;
4039// fillG = savedFillG;
4040// fillB = savedFillB;
4041// fillA = savedFillA;
4042 }
4043
4044
4045

Callers 2

imageMethod · 0.95
textCharModelImplMethod · 0.95

Calls 4

beginShapeMethod · 0.95
textureMethod · 0.95
vertexMethod · 0.95
endShapeMethod · 0.95

Tested by

no test coverage detected