rvg.keystone20
Class Keystone20

java.lang.Object
  extended by rvg.keystone20.Keystone20

public class Keystone20
extends java.lang.Object

This class manages the creation and calibration of keystoned surfaces. To move and warp surfaces, place the Keystone20 object in calibrate mode. It catches mouse events and allows you to drag surfaces and control points with the mouse. The Keystone20 object also provides load/save functionality, once you've calibrated the layout to your liking. Version: 003


Field Summary
 java.lang.String VERSION
           
 
Constructor Summary
Keystone20(processing.core.PApplet parent)
           
 
Method Summary
 CornerPinSurface createCornerPinSurface(int w, int h, int res)
          Creates and registers a new corner pin keystone surface.
 boolean isCalibrating()
           
 void load()
          Loads a saved layout from "keystone20.txt"
 void load(java.lang.String filename)
          Loads a saved layout from a given text file
 void mouseEvent(java.awt.event.MouseEvent e)
          Mouse event handler
 void save()
          Saves the current layout to "keystone20.txt"
 void save(java.lang.String filename)
          Saves the layout to a text file.
 void startCalibration()
          Starts the calibration mode.
 void stopCalibration()
          Stops the calibration mode
 void toggleCalibration()
          Toggles the calibration mode
 java.lang.String version()
          Returns the version of the library.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public final java.lang.String VERSION
See Also:
Constant Field Values
Constructor Detail

Keystone20

public Keystone20(processing.core.PApplet parent)
Parameters:
parent - applet
Method Detail

createCornerPinSurface

public CornerPinSurface createCornerPinSurface(int w,
                                               int h,
                                               int res)
Creates and registers a new corner pin keystone surface.

Parameters:
w - width
h - height
res - resolution (number of tiles per axis)
Returns:
CornerPinSurface

startCalibration

public void startCalibration()
Starts the calibration mode. Mouse events will be intercepted to drag surfaces and move control points around.


stopCalibration

public void stopCalibration()
Stops the calibration mode


toggleCalibration

public void toggleCalibration()
Toggles the calibration mode


isCalibrating

public boolean isCalibrating()

version

public java.lang.String version()
Returns the version of the library.

Returns:
String

save

public void save(java.lang.String filename)
Saves the layout to a text file.

Parameters:
filename - of the text file to save to

save

public void save()
Saves the current layout to "keystone20.txt"


load

public void load(java.lang.String filename)
Loads a saved layout from a given text file

Parameters:
filename - of the text file to read from

load

public void load()
Loads a saved layout from "keystone20.txt"


mouseEvent

public void mouseEvent(java.awt.event.MouseEvent e)
Mouse event handler