Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
45
Issues
45
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
3b854ef8
Commit
3b854ef8
authored
Aug 06, 2014
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tile colors with alpha
parent
9624b929
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
src/main/java/org/genesys2/server/service/impl/MappingServiceImpl.java
.../org/genesys2/server/service/impl/MappingServiceImpl.java
+4
-1
src/main/java/org/genesys2/server/servlet/controller/ExplorerController.java
...enesys2/server/servlet/controller/ExplorerController.java
+9
-1
No files found.
src/main/java/org/genesys2/server/service/impl/MappingServiceImpl.java
View file @
3b854ef8
...
...
@@ -187,6 +187,9 @@ public class MappingServiceImpl implements MappingService {
// bi.setRGB(i, 255, Color.red.getRGB());
// }
Color
color
=
new
Color
(
Color
.
yellow
.
getRed
(),
Color
.
yellow
.
getGreen
(),
Color
.
yellow
.
getBlue
(),
170
)
;
final
int
colorWithAlpha
=
color
.
getRGB
();
filterService
.
listGeoTile
(
true
,
jsonTree
,
null
,
zoom
,
xtile
,
ytile
,
new
RowCallbackHandler
()
{
@Override
public
void
processRow
(
ResultSet
rs
)
throws
SQLException
{
...
...
@@ -202,7 +205,7 @@ public class MappingServiceImpl implements MappingService {
for
(
int
i
=
-
pixelSize
/
2
;
i
<=
pixelSize
/
2
;
i
++)
{
for
(
int
j
=
-
pixelSize
/
2
;
j
<=
pixelSize
/
2
;
j
++)
{
if
(
longitude
+
i
>=
0
&&
latitude
+
j
>=
0
&&
longitude
+
i
<
256
&&
latitude
+
j
<
256
)
{
bi
.
setRGB
(
longitude
+
i
,
latitude
+
j
,
Color
.
yellow
.
getRGB
()
);
bi
.
setRGB
(
longitude
+
i
,
latitude
+
j
,
colorWithAlpha
);
}
}
}
...
...
src/main/java/org/genesys2/server/servlet/controller/ExplorerController.java
View file @
3b854ef8
...
...
@@ -367,8 +367,16 @@ public class ExplorerController extends BaseController {
if
(
newColor
.
equals
(
Color
.
yellow
))
{
return
imageBytes
;
}
final
MapColorsFilter
mcf
=
new
MapColorsFilter
(
Color
.
yellow
.
getRGB
(),
newColor
.
getRGB
());
Color
origColor
=
new
Color
(
Color
.
yellow
.
getRed
(),
Color
.
yellow
.
getGreen
(),
Color
.
yellow
.
getBlue
(),
170
)
;
final
int
originalColor
=
origColor
.
getRGB
();
Color
alphaColor
=
new
Color
(
newColor
.
getRed
(),
newColor
.
getGreen
(),
newColor
.
getBlue
(),
170
);
final
int
updatedColor
=
alphaColor
.
getRGB
();
final
MapColorsFilter
mcf
=
new
MapColorsFilter
(
originalColor
,
updatedColor
);
final
ByteArrayInputStream
bios
=
new
ByteArrayInputStream
(
imageBytes
);
final
BufferedImage
image
=
mcf
.
filter
(
ImageIO
.
read
(
bios
),
null
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment