static BufferedImage cutOutPixelSet_scale(BufferedImage image, BufferedImage bigImg, PixelSet set) { int scale = iround(bigImg.getWidth()/(double) image.getWidth()); Rect r = pixelSetBounds(set); int bw = bigImg.getWidth(), bh = bigImg.getHeight(); BufferedImage img = transparentBufferedImage(r.w*scale, r.h*scale); for (Pixel p : set) { int x1 = (p.x-r.x)*scale, y1 = (p.y-r.y)*scale; int xb = p.x*scale, yb = p.y*scale; for (int y = 0; y < scale; y++) for (int x = 0; x < scale; x++) if (xb+x < bw && yb+y < bh) img.setRGB(x1+x, y1+y, bigImg.getRGB(xb+x, yb+y)); } ret img; }
Began life as a copy of #1010155
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1010173 |
Snippet name: | cutOutPixelSet_scale - make RGBImage with alpha |
Eternal ID of this version: | #1010173/4 |
Text MD5: | 5eeda7487fb184c735f6e15e2908129a |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-09-05 20:06:05 |
Source code size: | 642 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 533 / 550 |
Version history: | 3 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1010174 - cutOutPixelSet_scale with outline [dev.] |