|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--TwoDArray
TwoDArray is a data structure to represent a two-dimensional array of complex numbers. ie The result of applying the 2D FFT to an image.
Field Summary | |
int |
height
The actual height of the image represented by the TwoDArray. |
int |
size
Smallest value of 2^n such that the 2^n > width and 2^n > height. |
ComplexNumber[][] |
values
The 2D array of complex numbers padded out with (0,0) to 2^n width and height. |
int |
width
The actual width of the image represented by the TwoDArray. |
Constructor Summary | |
TwoDArray()
Default no-arg constructor. |
|
TwoDArray(ComplexNumber[][] v,
int w,
int h)
Constructor taking 2D array of complex numbers, width and height. |
|
TwoDArray(int s)
Constructor that takes a single dimension, generates an appropriate size and sets up a size x size array of (0,0) complex numbers. |
|
TwoDArray(int[][] v,
int w,
int h)
Constructor taking 2D int array of pixels values, width and height, sets values to (x,0) for each pixel x. |
|
TwoDArray(int[] p,
int w,
int h)
Constructor taking int array of pixel values and width and height of the image represented by the array of pixels, sets values to (x,0) for each pixel x. |
|
TwoDArray(int w,
int h)
Constructor that takes a width and a height, generates the appropriate size values and then sets up an array of (0,0) complex numbers. |
|
TwoDArray(TwoDArray a)
Constructor that takes a TwoDArray and duplicates it exactly. |
Method Summary | |
double[] |
DCToCentre(double[] input)
Takes an array of doubles representing an image and translates and wraps the image to put (0,0) the DC value in the centre of the image. |
double[][] |
DCToCentre(double[][] input)
Takes a 2D array of doubles representing an image and translates and wraps the image to put (0,0) the DC value in the centre of the image. |
ComplexNumber[][] |
DCToTopLeft(ComplexNumber[][] input)
|
double[][] |
DCToTopLeft(double[][] input)
Takes a 2D array of doubles representing an image and translates and wraps the image to put the centre pixel at (0,0). |
ComplexNumber[] |
getColumn(int n)
Takes a column number and returns an array containing the complex numbers in that column. |
double[] |
getImaginary()
Method to extract the imaginary parts from a TwoDArray. |
double[] |
getMagnitude()
Method to extract the magnitude of each element from a TwoDArray. |
double[] |
getPhase()
Method to extract the phase angle of each element from a TwoDArray. |
double[] |
getReal()
Method to extract the real parts from a TwoDArray. |
ComplexNumber[] |
getRow(int n)
Takes a row number and returns an array containing the complex numbers in that row. |
void |
putColumn(int n,
ComplexNumber[] c)
Takes a column number and an array of complex numbers and replaces that column with the new data. |
void |
putRow(int n,
ComplexNumber[] c)
Takes a row number and an array of complex numbers and replaces that row with the new data. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public int width
public int height
public int size
public ComplexNumber[][] values
Constructor Detail |
public TwoDArray()
public TwoDArray(TwoDArray a)
a
- TwoDArray to be duplicated.public TwoDArray(int w, int h)
w
- Width of the new TwoDArray.h
- Height of the new TwoDArray.public TwoDArray(int s)
s
- Width or height of new TwoDArray.public TwoDArray(int[] p, int w, int h)
p
- int array of pixel values.w
- Width of image.h
- Height of image.public TwoDArray(int[][] v, int w, int h)
v
- 2D array of pixel values.w
- Width of image.h
- Height of image.public TwoDArray(ComplexNumber[][] v, int w, int h)
v
- 2D array of complex numbers.w
- Width of image.h
- Height of image.Method Detail |
public ComplexNumber[] getColumn(int n)
n
- int column number (0 is first column).public void putColumn(int n, ComplexNumber[] c)
n
- int column number (0 is first column).Array
- of complex numbers representing the new data.public void putRow(int n, ComplexNumber[] c)
n
- int row number (0 is first row).c
- Array of complex numbers representing the new data.public ComplexNumber[] getRow(int n)
n
- int row number (0 is first row).public double[][] DCToCentre(double[][] input)
input
- 2D array of doubles.public double[][] DCToTopLeft(double[][] input)
input
- 2D array of doubles.public ComplexNumber[][] DCToTopLeft(ComplexNumber[][] input)
public double[] DCToCentre(double[] input)
input
- array of doubles.public double[] getReal()
public double[] getImaginary()
public double[] getMagnitude()
public double[] getPhase()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |