Libraryless. Click here for Pure Java version (6351L/44K/150K).
1 | !7 |
2 | |
3 | static ScreenLens lens; |
4 | static JLabel lblResult; |
5 | static new SingleThread singleThread; |
6 | static long time; |
7 | |
8 | p-substance { |
9 | lens = new ScreenLens().start(); |
10 | lblResult = jMinWidth(50, jlabel()); |
11 | addToWindow(lens.is, withTopMargin(lblResult)); |
12 | lens.onImageChange = r { |
13 | //if (time != 0) print((sysNow()-time) + " ms"); |
14 | //time = sysNow(); |
15 | singleThread.run(r { |
16 | setText(lblResult, 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 "Brightness: " + bw.averageBrightness(); |
25 | } |
Began life as a copy of #1006520
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: | #1006527 |
Snippet name: | Screen Lens With Demo Analyzer |
Eternal ID of this version: | #1006527/1 |
Text MD5: | b6dc2608b0b35108093563fad7bbad16 |
Transpilation MD5: | d3ec111fa39247f6cb4c9e8e9ed83f22 |
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:07:36 |
Source code size: | 627 bytes / 25 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 535 / 700 |
Referenced in: | [show references] |