Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/jfree/ColorMapper.java @ 9576:c5c53e52f190
area pattern transparency sinfo tkh
author | gernotbelger |
---|---|
date | Wed, 07 Nov 2018 14:23:47 +0100 |
parents | 5dacb6ea75a1 |
children |
comparison
equal
deleted
inserted
replaced
9575:cff7636035ce | 9576:c5c53e52f190 |
---|---|
26 | 26 |
27 @Override | 27 @Override |
28 public int[] lookupPixel(final int[] src, final int[] dest) { | 28 public int[] lookupPixel(final int[] src, final int[] dest) { |
29 final int[] out = dest == null ? new int[src.length] : dest; | 29 final int[] out = dest == null ? new int[src.length] : dest; |
30 | 30 |
31 // REMARK: only compare rgb, so we even keep the transparency level | 31 // REMARK: only check opacity, because the transparency of the pattern-images is not 100% good |
32 if (src[0] == this.from[0] && src[1] == this.from[1] && src[2] == this.from[2]) { | 32 if (src[3] > 128) { |
33 out[0] = this.to[0]; | 33 out[0] = this.to[0]; |
34 out[1] = this.to[1]; | 34 out[1] = this.to[1]; |
35 out[2] = this.to[2]; | 35 out[2] = this.to[2]; |
36 out[3] = src[3]; | 36 out[3] = this.to[3]; |
37 } else { | 37 } else { |
38 System.arraycopy(src, 0, out, 0, src.length); | 38 out[0] = 0; |
39 out[1] = 0; | |
40 out[2] = 0; | |
41 out[3] = 0; | |
39 } | 42 } |
40 | 43 |
41 return out; | 44 return out; |
42 } | 45 } |
43 } | 46 } |