Package ch.sahits.game.graphic.image
Interface IImageUtilities
-
- All Known Implementing Classes:
ImageUtil
public interface IImageUtilities
Interface defining the capabilities of the image utilities- Author:
- Andi Hotz, (c) Sahits GmbH, 2012 Created on Jun 20, 2012
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javafx.scene.image.Image
addCityNames(IMap map, javafx.scene.image.Image image, javafx.scene.text.Font font)
Add the city names to an existing map image.javafx.scene.image.Image
createMapWithCities(IMap map, IPlayer player)
Create the map image with all the cities.javafx.scene.image.Image
createMediterraneanMap(IPlayer player, IMediterreanMap map)
Create the mediterrean image map with all the discovered cities and the explored loacations for a player.javafx.scene.image.ImageView
cropAndScale(java.lang.String imageName, ImageScaleState scaleState)
Apply proper scaling to the image as defined in the state.javafx.scene.image.Image
scale(javafx.scene.image.Image input, javafx.geometry.Dimension2D destDim, double scale)
Scale an image.
-
-
-
Method Detail
-
cropAndScale
javafx.scene.image.ImageView cropAndScale(java.lang.String imageName, ImageScaleState scaleState)
Apply proper scaling to the image as defined in the state. If possible the image is cropped to provided optimal scaling- Parameters:
imageName
- name of the Image to be scaledscaleState
- current state of the image- Returns:
- Scaled/cropped/bordered image
-
createMapWithCities
javafx.scene.image.Image createMapWithCities(IMap map, IPlayer player)
Create the map image with all the cities. Cities differentiate between normal city, home town and city with trading office.- Parameters:
map
- model.player
- to which the map belongs- Returns:
- Image of the Map
-
addCityNames
javafx.scene.image.Image addCityNames(IMap map, javafx.scene.image.Image image, javafx.scene.text.Font font)
Add the city names to an existing map image.- Parameters:
map
- modelimage
- base image of the mapfont
- to be used for the city names.- Returns:
- Image with the localized city names added.
-
createMediterraneanMap
javafx.scene.image.Image createMediterraneanMap(IPlayer player, IMediterreanMap map)
Create the mediterrean image map with all the discovered cities and the explored loacations for a player.- Parameters:
player
- for which the mag should be created.map
- model of the map.- Returns:
- JavaFX image of the map.
-
scale
javafx.scene.image.Image scale(javafx.scene.image.Image input, javafx.geometry.Dimension2D destDim, double scale)
Scale an image.- Parameters:
input
- image that is to be scaleddestDim
- dimension of the target imagescale
- factor- Returns:
- scaled instance of the image.
-
-