Commit dad743c1 authored by Matija Obreza's avatar Matija Obreza

Merge branch '334-tile-server-alpha-channel' into 'master'

Resolve "Tile server: alpha channel"

Closes #334

See merge request genesys-pgr/genesys-server!379
parents 7fe70f55 a7875d7a
...@@ -51,6 +51,13 @@ public class MapColorsFilter extends PointFilter { ...@@ -51,6 +51,13 @@ public class MapColorsFilter extends PointFilter {
public int filterRGB(int x, int y, int rgb) { public int filterRGB(int x, int y, int rgb) {
if (rgb == oldColor) { if (rgb == oldColor) {
return newColor; return newColor;
} else if (rgb != 0) {
int alpha = (rgb >> 24) & 0xFF; // isolate alpha
alpha &= 0xff; //keeps alpha in 0-255 range
int newRGB = newColor;
newRGB &= 0x00ffffff; //remove old alpha info
newRGB |= (alpha << 24); //add new alpha info
return newRGB;
} }
return rgb; return rgb;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment