static IBWImage clipIBWImage(IBWImage img, int x1, int y1, int w, int h) { if (x1 == 0 && y1 == 0 && w == img.getWidth() && h == img.getHeight()) ret img; ret new IBWImage { public int getWidth() { ret w; } public int getHeight() { ret h; } public float getFloatPixel(int x, int y) { ret img.getFloatPixel(x+x1, y+y1); } }; } static IBWImage clipIBWImage(IBWImage img, Rect r) { ret clipIBWImage(img, r.x, r.y, r.w, r.h); }
Began life as a copy of #1018779
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1022982 |
| Snippet name: | clipIBWImage (virtual clip) |
| Eternal ID of this version: | #1022982/2 |
| Text MD5: | 1da929b878021f20e5334f48197a23b4 |
| Author: | stefan |
| Category: | javax / imaging |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-04-17 08:03:58 |
| Source code size: | 473 bytes / 15 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 502 / 552 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |