Libraryless. Click here for Pure Java version (4973L/32K).
static BWImage img_distanceFromColor_withGain(RGBImage img, RGB color, double gain) { int w = img.getWidth(), h = img.getHeight(); int col = color.getInt(); BWImage bw = new(w, h); for y to h: for x to w: bw.setPixel(x, y, rgbDiff(img.getInt(x, y), col)*(float) gain); ret bw; } static BWImage img_distanceFromColor_withGain(BufferedImage img, RGB color, double gain) { int w = img.getWidth(), h = img.getHeight(); int col = color.getInt(); BWImage bw = new(w, h); for y to h: for x to w: bw.setPixel(x, y, rgbDiff(img.getRGB(x, y), col)*(float) gain); ret bw; } static BWImage img_distanceFromColor_withGain(double gain, BufferedImage img, RGB color) { ret img_distanceFromColor_withGain(img, color, gain); }
Began life as a copy of #1024558
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: | #1024559 |
Snippet name: | img_distanceFromColor_withGain |
Eternal ID of this version: | #1024559/4 |
Text MD5: | ffa97e67266a165a586a2523998dcd0b |
Transpilation MD5: | 47ecb0232074de4520a76b9177c7e12a |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-09-20 18:13:52 |
Source code size: | 775 bytes / 23 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 318 / 384 |
Version history: | 3 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1024725 - img_squaredDistanceFromColor_withGain (gain before squaring) |