function copyRect(from, to, x1, y1, w, h, x2, y2)
local fp, tp = from.pixels, to.pixels
local fw, tw = from.width, to.width
local ww, hh = w-1, h-1
for y=0, hh do
local to, fo = x2+(y2+y)*tw+1, x1+(y1+y)*fw+1
for x=0, ww do
tp[to+x] = fp[fo+x]
end
end
endtest run test run with input download show line numbers
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
2 comment(s) hidden. show
| Recognizer | Recognition Result | Visualize | Recalc |
|---|---|---|---|
| #308 | 293 | [visualize] |
| Snippet ID: | #109 |
| Snippet name: | copyRect |
| Eternal ID of this version: | #109/1 |
| Text MD5: | a601dc47a6059315d5dc49e2c2a08ccd |
| Author: | stefan |
| Category: | image tools |
| Type: | Lua code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2014-01-16 07:09:09 |
| Source code size: | 293 bytes / 11 lines |
| Pitched / IR pitched: | Yes / Yes |
| Views / Downloads: | 1718 / 1188 |
| Referenced in: | [show references] |