Package viewer.base
Class Transformation
java.lang.Object
viewer.base.Transformation
public class Transformation
extends java.lang.Object
a transformation between image coordinates (row, column) and map coordinates
(x, y)
- Author:
- haunert
-
Constructor Summary
Constructors Constructor Description Transformation()standard constructor setting scale to 1 and origin to (0,0)Transformation(double m, int ColumnOrigin, int RowOrigin)constructor setting transformation parameters as specified -
Method Summary
Modifier and Type Method Description intgetColumn(double x)method for computing the column for a given x-coordinateintgetColumnOrigin()getter for accessing the column of the map coordinate system's origindoublegetM()getter for accessing the scale factorintgetRow(double y)method for computing the row for a given y-coordinateintgetRowOrigin()getter for accessing the row of the map coordinate system's origindoublegetX(int c)method for computing the x-coordinate for a given columndoublegetY(int r)method for computing the y-coordinate for a given rowvoidsetColumnOrigin(int cOrigin)setter for setting the column of the map coordinate system's originvoidsetM(double myM)setter for setting the scale factorvoidsetRowOrigin(int rOrigin)setter for setting the row of the map coordinate system's origin
-
Constructor Details
-
Transformation
public Transformation()standard constructor setting scale to 1 and origin to (0,0) -
Transformation
public Transformation(double m, int ColumnOrigin, int RowOrigin)constructor setting transformation parameters as specified- Parameters:
m- : the scale factorColumnOrigin- : column of the origin of the map coordinate systemRowOrigin- : row of the origin of the map coordinate system
-
-
Method Details
-
getM
public double getM()getter for accessing the scale factor- Returns:
- the scale factor
-
setM
public void setM(double myM)setter for setting the scale factor- Parameters:
myM- : the scale factor
-
getColumnOrigin
public int getColumnOrigin()getter for accessing the column of the map coordinate system's origin- Returns:
- the column
-
setColumnOrigin
public void setColumnOrigin(int cOrigin)setter for setting the column of the map coordinate system's origin- Parameters:
cOrigin- : the column
-
getRowOrigin
public int getRowOrigin()getter for accessing the row of the map coordinate system's origin- Returns:
- the row
-
setRowOrigin
public void setRowOrigin(int rOrigin)setter for setting the row of the map coordinate system's origin- Parameters:
rOrigin- : the row
-
getRow
public int getRow(double y)method for computing the row for a given y-coordinate- Parameters:
y- : the y-coordinate- Returns:
- the row
-
getColumn
public int getColumn(double x)method for computing the column for a given x-coordinate- Parameters:
x- : the x-coordinate- Returns:
- the column
-
getX
public double getX(int c)method for computing the x-coordinate for a given column- Parameters:
c- : the column- Returns:
- the x-coordinate
-
getY
public double getY(int r)method for computing the y-coordinate for a given row- Parameters:
r- : the row- Returns:
- the y-coordinate
-