get("#346") -- getcrop
-- works on global "img"
function standardcrop(img)
local x1, y1, x2, y2 = getcrop(img)
-- return cropped image
return {
width = x2-x1,
height = y2-y1,
getInt = function(x, y)
return img.getInt(x+x1, y+y1)
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
No comments. add comment
| Snippet ID: | #347 |
| Snippet name: | Embeddable standard cropper |
| Eternal ID of this version: | #347/1 |
| Text MD5: | 2bff6f48ec45d7ce1e3438b86743cd1e |
| Author: | stefan |
| Category: | |
| Type: | Lua code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-01-26 00:24:10 |
| Source code size: | 288 bytes / 16 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 894 / 234 |
| Referenced in: | [show references] |