de.fhpotsdam.unfolding.mapdisplay.shaders
Class MaskedMapDisplayShader

java.lang.Object
  extended by de.fhpotsdam.unfolding.mapdisplay.shaders.MapDisplayShader
      extended by de.fhpotsdam.unfolding.mapdisplay.shaders.MaskedMapDisplayShader

public class MaskedMapDisplayShader
extends MapDisplayShader

This shader masks a map. The offscreen graphic canvas as mask


Field Summary
protected  processing.core.PGraphics mask
          The mask canvas.
 
Fields inherited from class de.fhpotsdam.unfolding.mapdisplay.shaders.MapDisplayShader
p, shader
 
Constructor Summary
MaskedMapDisplayShader(processing.core.PApplet p, float width, float height)
          Creates a MaskedMapDisplayShader to draw the mask dynamically.
MaskedMapDisplayShader(processing.core.PApplet p, float width, float height, processing.core.PImage maskImage)
          Creates a MaskedMapDisplayShader with the given mask image.
 
Method Summary
 processing.core.PGraphics getMask()
          Returns the mask canvas to dynamically create or update the mask.
 void resize(float width, float height)
          Resizes the shader.
 void shadeWithMarkers(processing.core.PGraphics mapDisplayCanvas)
           
 
Methods inherited from class de.fhpotsdam.unfolding.mapdisplay.shaders.MapDisplayShader
getShader, shadeWithoutMarkers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mask

protected processing.core.PGraphics mask
The mask canvas.

Constructor Detail

MaskedMapDisplayShader

public MaskedMapDisplayShader(processing.core.PApplet p,
                              float width,
                              float height)
Creates a MaskedMapDisplayShader to draw the mask dynamically. Call getMask() to get the mask canvas to draw on.

Parameters:
p - The PApplet.
width - The width of the mask.
height - The height of the mask.

MaskedMapDisplayShader

public MaskedMapDisplayShader(processing.core.PApplet p,
                              float width,
                              float height,
                              processing.core.PImage maskImage)
Creates a MaskedMapDisplayShader with the given mask image.

Parameters:
p - The PApplet.
width - The width of the mask.
height - The height of the mask.
maskImage - An image to be used as mask.
Method Detail

resize

public void resize(float width,
                   float height)
Description copied from class: MapDisplayShader
Resizes the shader. Optional, only implement if needed.

Overrides:
resize in class MapDisplayShader
Parameters:
width - The new width of the canvas.
height - The new height of the canvas.

getMask

public processing.core.PGraphics getMask()
Returns the mask canvas to dynamically create or update the mask.

Returns:
The mask.

shadeWithMarkers

public void shadeWithMarkers(processing.core.PGraphics mapDisplayCanvas)
Overrides:
shadeWithMarkers in class MapDisplayShader