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
    int getColumn​(double x)
    method for computing the column for a given x-coordinate
    int getColumnOrigin()
    getter for accessing the column of the map coordinate system's origin
    double getM()
    getter for accessing the scale factor
    int getRow​(double y)
    method for computing the row for a given y-coordinate
    int getRowOrigin()
    getter for accessing the row of the map coordinate system's origin
    double getX​(int c)
    method for computing the x-coordinate for a given column
    double getY​(int r)
    method for computing the y-coordinate for a given row
    void setColumnOrigin​(int cOrigin)
    setter for setting the column of the map coordinate system's origin
    void setM​(double myM)
    setter for setting the scale factor
    void setRowOrigin​(int rOrigin)
    setter for setting the row of the map coordinate system's origin

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 factor
      ColumnOrigin - : column of the origin of the map coordinate system
      RowOrigin - : 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