|
Post by dragonfire on Apr 1, 2016 19:15:14 GMT
Does getColor() take screenshot before comparison?
When and how a screenshot is triggered and been taken?
|
|
|
Post by AnkuLua on Apr 2, 2016 0:13:14 GMT
Does getColor() take screenshot before comparison? When and how a screenshot is triggered and been taken? Sure. screenshot is triggered by related commands.
|
|
|
Post by dragonfire on Apr 2, 2016 2:52:36 GMT
Does getColor() take screenshot before comparison? When and how a screenshot is triggered and been taken? Sure. screenshot is triggered by related commands. Is it possible to implement getColor not take screenshot, directly get the screen location color, when device width == comparison width?
|
|
|
Post by AnkuLua on Apr 2, 2016 2:57:01 GMT
Sure. screenshot is triggered by related commands. Is it possible to implement getColor not take screenshot, directly get the screen location color, when device width == comparison width? Why do you want that? The behavior is the same.
|
|
|
Post by dragonfire on Apr 2, 2016 3:42:43 GMT
Is it possible to implement getColor not take screenshot, directly get the screen location color, when device width == comparison width? Why do you want that? The behavior is the same. This is for the situation that script knows the color at a location or center of a region is going to show up in next 5-30 seconds. If a function can directly match onscreen color, instead of take screenshot and compare, it would perform much faster.
|
|
|
Post by dragonfire on Apr 5, 2016 18:34:03 GMT
I think it is an limitation and every matching logic is based on a snapshot taken first? When I run the scripts, I see a lot of disk activities, on taking snapshots, I am trying to find ways to minimize disk activities. If there is a way of direct compare onscreen color of a pixel, it will be perfect.
Can I have a feature request, for a function like bellow, a pseudo code i just made up.
function findMatchInRegions(regions, image) for i,v in ipairs(regions) do if (regions[v]:find(image) then) return (v) end end return -1 end
function findColorInRegions(regions, color) return first matching handler of the match region. end
Wonders if this is faster to do in the backend, based on the same snapshot, and skip the overhead of loop through in the front end.
|
|
|
Post by AnkuLua on Apr 5, 2016 23:11:11 GMT
I think it is an limitation and every matching logic is based on a snapshot taken first? When I run the scripts, I see a lot of disk activities, on taking snapshots, I am trying to find ways to minimize disk activities. If there is a way of direct compare onscreen color of a pixel, it will be perfect. Can I have a feature request, for a function like bellow, a pseudo code i just made up. function findMatchInRegions(regions, image) for i,v in ipairs(regions) do if (regions[v]:find(image) then) return (v) end end return -1 end
function findColorInRegions(regions, color) return first matching handler of the match region. end Wonders if this is faster to do in the backend, based on the same snapshot, and skip the overhead of loop through in the front end. Use usePreviousSnap() to reuse the same snapshot. ankulua.boards.net/thread/7/settings
|
|
|
Post by dragonfire on Apr 6, 2016 0:21:50 GMT
I think it is an limitation and every matching logic is based on a snapshot taken first? When I run the scripts, I see a lot of disk activities, on taking snapshots, I am trying to find ways to minimize disk activities. If there is a way of direct compare onscreen color of a pixel, it will be perfect. Can I have a feature request, for a function like bellow, a pseudo code i just made up. function findMatchInRegions(regions, image) for i,v in ipairs(regions) do if (regions[v]:find(image) then) return (v) end end return -1 end
function findColorInRegions(regions, color) return first matching handler of the match region. end Wonders if this is faster to do in the backend, based on the same snapshot, and skip the overhead of loop through in the front end. Use usePreviousSnap() to reuse the same snapshot. ankulua.boards.net/thread/7/settingsI am using usePreviousSnap() around it, it is still not fast enough when loop call getColor, wonders if it is the overhead of calling the methods. Wonders if a native support method, load the image once, check each pixel will perform much faster?
|
|