|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhpotsdam.unfolding.utils.LargeMapImageUtils
public class LargeMapImageUtils
Utility class to save large map images. Can be used to create high resolution screenshots for print. Everything currently visible on the map (tiles and markers) will be in the image. This process happens on-screen, thus the map can not be used while this tool is running. It will automatically pan to different areas of the map, stitch them together, and save them in one single image. To customize, set location, zoomLevel, and totalWidth and totalHeight. The latter two should be multiples of xStep and yStep. You can also set file name, or file prefix and file suffix of the large image to be saved. Please note the respective terms of service of the map provider!
Field Summary | |
---|---|
protected processing.core.PApplet |
p
|
protected int |
totalHeight
|
protected int |
totalWidth
|
protected int |
xStep
|
protected int |
yStep
|
Constructor Summary | |
---|---|
LargeMapImageUtils(processing.core.PApplet p,
UnfoldingMap map)
Creates a new LargeMapImageUtils which stores a large image double the size of the canvas. |
|
LargeMapImageUtils(processing.core.PApplet p,
UnfoldingMap map,
int stitchNumber)
|
|
LargeMapImageUtils(processing.core.PApplet p,
UnfoldingMap map,
int xStep,
int yStep,
int totalWidth,
int totalHeight)
|
|
LargeMapImageUtils(processing.core.PApplet p,
UnfoldingMap map,
Location location,
int zoomLevel)
|
|
LargeMapImageUtils(processing.core.PApplet p,
UnfoldingMap map,
Location location,
int zoomLevel,
int stitchNumber)
|
|
LargeMapImageUtils(processing.core.PApplet p,
UnfoldingMap map,
Location location,
int zoomLevel,
int xStep,
int yStep,
int totalWidth,
int totalHeight)
|
Method Summary | |
---|---|
void |
init()
Initializes a new large map image around the current map center. |
void |
init(Location location,
int zoomLevel)
Initializes a new large map image around the location. |
processing.core.PImage |
makeSnapshot()
|
protected void |
renderAndMakeSnapshot(int shotX,
int shotY)
Internal method to get the current map canvas (incl markers) and stores it in an buffer image. |
void |
run()
Runs the recording process. |
protected void |
saveLargeImage()
Internal method to save the actual large stitched-together image in one file. |
void |
setImageFileName(java.lang.String imageFileName)
The full name of the final large image. |
void |
setImageFilePrefix(java.lang.String imageFilePrefix)
Sets the prefix of the final large image file. |
void |
setImageFileSuffix(java.lang.String imageFileSuffix)
Sets the suffix of the final large image file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected processing.core.PApplet p
protected int xStep
protected int yStep
protected int totalWidth
protected int totalHeight
Constructor Detail |
---|
public LargeMapImageUtils(processing.core.PApplet p, UnfoldingMap map)
p
- The PAppletmap
- The map to take screenshots from.public LargeMapImageUtils(processing.core.PApplet p, UnfoldingMap map, int stitchNumber)
public LargeMapImageUtils(processing.core.PApplet p, UnfoldingMap map, Location location, int zoomLevel)
public LargeMapImageUtils(processing.core.PApplet p, UnfoldingMap map, Location location, int zoomLevel, int stitchNumber)
public LargeMapImageUtils(processing.core.PApplet p, UnfoldingMap map, Location location, int zoomLevel, int xStep, int yStep, int totalWidth, int totalHeight)
public LargeMapImageUtils(processing.core.PApplet p, UnfoldingMap map, int xStep, int yStep, int totalWidth, int totalHeight)
Method Detail |
---|
public void init()
public void init(Location location, int zoomLevel)
location
- The location to center around.zoomLevel
- The zoom level to use.public void run()
protected void saveLargeImage()
protected void renderAndMakeSnapshot(int shotX, int shotY)
shotX
- Current x position of the large image to store the current screenshot to.shotY
- Current y position of the large image to store the current screenshot to.public processing.core.PImage makeSnapshot()
public void setImageFilePrefix(java.lang.String imageFilePrefix)
imageFilePrefix
- A image file prefix (supported by Processing, i.e. '.tif', '.png', '.jpg').public void setImageFileSuffix(java.lang.String imageFileSuffix)
imageFileSuffix
- A image file suffix, e.g. 'largeImage-'.public void setImageFileName(java.lang.String imageFileName)
imageFileName
- A file name.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |