|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.claudio.pen.calibrate.Scaler
public final class Scaler
Transform event coordinates from input device to screen coordinates.
This scaler needs as input three points which are not on a line and for which
input coordinates as well as screen coordinates are known. If these are fed
the setCoefficients(Point[], Point[]) method it will compute the
necessary coefficients which are then used in scale(Event) to adjust
the event.
Copyright (C) 2008 Claudio Nieder <private@claudio.ch>, CH-8610 Uster
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
| Constructor Summary | |
|---|---|
Scaler()
|
|
| Method Summary | |
|---|---|
static Scaler |
createFromFile(java.io.File f)
Create a scaler using data from given file. |
static void |
main(java.lang.String[] args)
Print license. |
void |
resetCoefficients()
Set the coefficients so that event x and y remain unchanged. |
void |
scale(Event event)
Scale an event using the currently set coefficients. |
void |
setCoefficients(java.awt.Point[] screenDots,
java.awt.Point[] events)
Given three measurements sets the coefficients for translating event coordinates to screen coordinates. |
void |
storeToFile(java.io.File f)
Store this instance content to given file. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Scaler()
| Method Detail |
|---|
public void setCoefficients(java.awt.Point[] screenDots,
java.awt.Point[] events)
screenDots - screen pointsevents - corresponding positions returned in input events.public void resetCoefficients()
public void scale(Event event)
event - public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public static final Scaler createFromFile(java.io.File f)
f - existing file
public final void storeToFile(java.io.File f)
f - public static void main(java.lang.String[] args)
args - ignored
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||