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

Comments [hide]

ID Author/Program Comment Date
119 #1000604 (pitcher) 2015-08-18 00:46:46
114 #1000610 (pitcher) Edit suggestion:
!636
!629

main {
static Object androidContext;
static String programID;

public static void main(String[] args) throws Exception {
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
}}
2015-08-18 00:40:49

add comment

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