1 | static BWImage img_squaredDistanceFromColor_withGain(RGBImage img, RGB color, double gain) {
|
2 | int w = img.getWidth(), h = img.getHeight(); |
3 | int col = color.getInt(); |
4 | BWImage bw = new(w, h); |
5 | for y to h: |
6 | for x to w: |
7 | bw.setPixel(x, y, sqr(rgbDiff(img.getInt(x, y), col)*(float) gain)); |
8 | ret bw; |
9 | } |
10 | |
11 | static BWImage img_squaredDistanceFromColor_withGain(BufferedImage img, RGB color, double gain) {
|
12 | ret img_squaredDistanceFromColor_withGain(RGBImage(img), color, gain); |
13 | } |
Began life as a copy of #1024559
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1024725 |
| Snippet name: | img_squaredDistanceFromColor_withGain (gain before squaring) |
| Eternal ID of this version: | #1024725/1 |
| Text MD5: | 784e10d90e6d109bc695cf2788e4d9ca |
| Author: | stefan |
| Category: | javax / imaging |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-08-24 14:32:33 |
| Source code size: | 496 bytes / 13 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 469 / 491 |
| Referenced in: | [show references] |