=== blend() ===
coming soon p.blend = function blend(src, sx, sy, sw, sh, dx, dy, dw, dh, mode){ if(arguments.length==9){ p.blend(this, src, sx, sy, sw, sh, dx, dy, dw, dh); } else if (arguments.length==10){ var sx2 = sx + sw; var sy2 = sy + sh; var dx2 = dx + dw; var dy2 = dy + dh; p.loadPixels(); if (src == this) { if (p.intersect(sx, sy, sx2, sy2, dx, dy, dx2, dy2)) { p.blit_resize(p.get(sx, sy, sx2 - sx, sy2 - sy), // 4 argument get doesnt exist i think 0, 0, sx2 - sx - 1, sy2 - sy - 1, pixels, width, height, dx, dy, dx2, dy2, mode); } else { // same as below, except skip the loadPixels() because it'd be redundant p.blit_resize(src, sx, sy, sx2, sy2, pixels, width, height, dx, dy, dx2, dy2, mode); } } else { src.loadPixels(); p.blit_resize(src, sx, sy, sx2, sy2, pixels, width, height, dx, dy, dx2, dy2, mode); } p.updatePixels(); } };
=== blend() helper functions===
intersect, filter_new_scanline, filter_bilinear coming soon