Libraryless. Click here for Pure Java version (12590L/73K).
1 | sclass IIBWVirtualClip extends Meta implements IBWIntegralImage {
|
2 | IBWIntegralImage fullImage; |
3 | int x1, y1, w, h; |
4 | |
5 | *() {}
|
6 | *(IBWIntegralImage fullImage, Rect r) {
|
7 | this(fullImage, r.x, r.y, r.w, r.h); |
8 | } |
9 | *(IBWIntegralImage *fullImage, int *x1, int *y1, int *w, int *h) {
|
10 | optimize(); |
11 | } |
12 | |
13 | public int getWidth() { ret w; }
|
14 | public int getHeight() { ret h; }
|
15 | |
16 | public int getIIValue(int x, int y) {
|
17 | ret fullImage.getIIValue(x+x1, y+y1); |
18 | } |
19 | |
20 | public double getIIValue(double x, double y) {
|
21 | ret fullImage.getIIValue(x+x1, y+y1); |
22 | } |
23 | |
24 | public BufferedImage getBufferedImage() {
|
25 | ret clipBufferedImage(fullImage.getBufferedImage(), x1, y1, w, h); |
26 | } |
27 | |
28 | void optimize {
|
29 | if (fullImage cast IIBWVirtualClip) {
|
30 | x1 += fullImage.x1; |
31 | y1 += fullImage.y1; |
32 | fullImage = fullImage.fullImage; |
33 | } |
34 | } |
35 | } |
Began life as a copy of #1031960
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1033764 |
| Snippet name: | IIBWVirtualClip |
| Eternal ID of this version: | #1033764/5 |
| Text MD5: | f19c53c501c03de407638c329ef63db8 |
| Transpilation MD5: | 36f5f1b5c4e16c72cd462548bf02776d |
| Author: | stefan |
| Category: | javax / image recognition |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-01-02 20:14:18 |
| Source code size: | 884 bytes / 35 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 360 / 519 |
| Version history: | 4 change(s) |
| Referenced in: | [show references] |