Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #109 // copyRect

Lua code

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
end

test 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

Image recognition results

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: 1212 / 1100
Referenced in: [show references]