Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void blendLinGrad(PImage pg, Gradient gradient, float blend,
- int orx, int ory, int dex, int dey) {
- color clr;
- int w = pg.width;
- int h = pg.height;
- pg.loadPixels();
- for (int y = 0, x, i = 0; y < h; ++y) {
- for (x = 0; x < w; ++x, ++i) {
- clr = gradient.evaluate(
- project(orx, ory, dex, dey, x, y));
- pg.pixels[i] = lerpColor(pg.pixels[i], clr, blend);
- }
- }
- pg.updatePixels();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement