1 | static BWImage img_cubedDistanceFromColor_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, pow(rgbDiff(img.getInt(x, y), col)*(float) gain, 3)); |
8 | ret bw; |
9 | } |
10 | |
11 | static BWImage img_cubedDistanceFromColor_withGain(BufferedImage img, RGB color, double gain) {
|
12 | ret img_cubedDistanceFromColor_withGain(RGBImage(img), color, gain); |
13 | } |
14 | |
15 | static BWImage img_cubedDistanceFromColor_withGain(RGB color, double gain, BufferedImage img) {
|
16 | ret img_cubedDistanceFromColor_withGain(img, color, gain); |
17 | } |
Began life as a copy of #1024725
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: | #1024729 |
| Snippet name: | img_cubedDistanceFromColor_withGain (gain before cubing) |
| Eternal ID of this version: | #1024729/3 |
| Text MD5: | 8adbbf07e185c6f18afd129166fae648 |
| 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 15:14:01 |
| Source code size: | 657 bytes / 17 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 461 / 486 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |