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)
| 3896 | * The (u, v) coordinates are in image space (they're ints, after all..) |
| 3897 | */ |
| 3898 | protected void imageImpl(PImage img, |
| 3899 | float x1, float y1, float x2, float y2, |
| 3900 | int u1, int v1, int u2, int v2) { |
| 3901 | boolean savedStroke = stroke; |
| 3902 | // boolean savedFill = fill; |
| 3903 | int savedTextureMode = textureMode; |
| 3904 | |
| 3905 | stroke = false; |
| 3906 | // fill = true; |
| 3907 | textureMode = IMAGE; |
| 3908 | |
| 3909 | // float savedFillR = fillR; |
| 3910 | // float savedFillG = fillG; |
| 3911 | // float savedFillB = fillB; |
| 3912 | // float savedFillA = fillA; |
| 3913 | // |
| 3914 | // if (tint) { |
| 3915 | // fillR = tintR; |
| 3916 | // fillG = tintG; |
| 3917 | // fillB = tintB; |
| 3918 | // fillA = tintA; |
| 3919 | // |
| 3920 | // } else { |
| 3921 | // fillR = 1; |
| 3922 | // fillG = 1; |
| 3923 | // fillB = 1; |
| 3924 | // fillA = 1; |
| 3925 | // } |
| 3926 | |
| 3927 | u1 *= img.pixelDensity; |
| 3928 | u2 *= img.pixelDensity; |
| 3929 | v1 *= img.pixelDensity; |
| 3930 | v2 *= img.pixelDensity; |
| 3931 | |
| 3932 | beginShape(QUADS); |
| 3933 | texture(img); |
| 3934 | vertex(x1, y1, u1, v1); |
| 3935 | vertex(x1, y2, u1, v2); |
| 3936 | vertex(x2, y2, u2, v2); |
| 3937 | vertex(x2, y1, u2, v1); |
| 3938 | endShape(); |
| 3939 | |
| 3940 | stroke = savedStroke; |
| 3941 | // fill = savedFill; |
| 3942 | textureMode = savedTextureMode; |
| 3943 | |
| 3944 | // fillR = savedFillR; |
| 3945 | // fillG = savedFillG; |
| 3946 | // fillB = savedFillB; |
| 3947 | // fillA = savedFillA; |
| 3948 | } |
| 3949 | |
| 3950 | |
| 3951 |
no test coverage detected