Libraryless. Click here for Pure Java version (6394L/44K/151K).
1 | !7 |
2 | |
3 | static ScreenLens lens; |
4 | static JTextArea taResult; |
5 | static new SingleThread singleThread; |
6 | static long time; |
7 | |
8 | p-substance { |
9 | lens = new ScreenLens().start(); |
10 | taResult = jTextArea(); |
11 | addToWindow(lens.is, withTopMargin(jMinHeight(100, wrap(taResult)))); |
12 | lens.onImageChange = r { |
13 | //if (time != 0) print((sysNow()-time) + " ms"); |
14 | //time = sysNow(); |
15 | singleThread.run(r { |
16 | setText(taResult, analyze(lens.is.getImage())) |
17 | }); |
18 | }; |
19 | } |
20 | |
21 | static S analyze(BufferedImage img) { |
22 | //RGBImage rgb = new RGBImage(img); |
23 | BWImage bw = new BWImage(img); |
24 | ret "Color at pointer: " + colorAtMousePointer() |
25 | + "\nBrightness: " + bw.averageBrightness(); |
26 | } |
Began life as a copy of #1006527
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006531 |
Snippet name: | Screen Lens With Demo Analyzers |
Eternal ID of this version: | #1006531/1 |
Text MD5: | 17b44379c4df7d3fc2f0b7f375ae364b |
Transpilation MD5: | 62e74ac170e6901038b1336a9db6de0a |
Author: | stefan |
Category: | javax / gui / ocr |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-01-15 16:12:36 |
Source code size: | 691 bytes / 26 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 528 / 608 |
Referenced in: | [show references] |