Class Data


public class Data
extends java.lang.Object

Wavelet Transformation Demo: Class for storage and access of image data (as a 3-dim double array)

Field Summary

private double[][][]
data
int
numBands
int
numCols
int
numRows

Constructor Summary

Data(int bands)
Constructor - Creates the first (color bands) array dimension.
Data(int bands, int rows)
Constructor - Creates the first (color bands) and second (row size) array dimension.
Data(int bands, int rows, int cols)
Constructor - Creates the first (color bands) second (row size) and third (column size) array dimension.

Method Summary

static void
copy(Data src, Data target)
Copies a source 3-dim array to a target 3-dim array with identical dimensions
double[][][]
get()
Returns the current 3-dim data array
double[][]
get(int band)
Returns the rows and columns in the current double data array for a specified band
double[]
get(int band, int row)
Returns the columns in the current double data array for a specified band and row
double
get(int band, int row, int col)
Returns a single value in the current double data array for a specified band, row and column position
Data
getHighPass()
Get high pass data of the current 3-dim array.
Data
getHighPass(int noOfRows, int noOfCols)
Get high pass data of the current 3-dim array.
Data
getLowPass()
Get low pass data of the current 3-dim array.
Data
getLowPass(int noOfRows, int noOfCols)
Get low pass data of the current 3-dim array.
private int
getNumBands()
Returns the number of color bands of the current 3-dim array.
int
getNumCols()
Returns the number of columns of the current 3-dim array.
int
getNumRows()
Returns the number of rows of the current 3-dim array.
private boolean
isBandArrayCreated()
Checks wether the first array dimension (color bands) is created.
private boolean
isColArrayCreated()
Checks wether the third array dimension (columns) is created.
private boolean
isRowArrayCreated()
Checks wether the second array dimension (rows) is created.
void
set(double newData, int band, int row, int col)
Replaces one single value in the current double data array
void
set(double[] newData, int band, int row)
Replaces the column dimension of the current double data array
void
set(double[][] newData, int band)
Replaces the row and column dimension of the current double data array
void
set(double[][][] newData)
Replaces all 3 dimensions of the current double data array
void
swap()
Swap rows and cols of the array (in place)
Data
swap(Data out)
Swap rows and cols of the array (no array modification)
private void
updateDimensions()
In case of array modifications, update the dimension variables here.

Field Details

data

private double[][][] data

numBands

public int numBands

numCols

public int numCols

numRows

public int numRows

Constructor Details

Data

public Data(int bands)
Constructor - Creates the first (color bands) array dimension.
Parameters:
bands - Number of color bands

Data

public Data(int bands,
            int rows)
Constructor - Creates the first (color bands) and second (row size) array dimension.
Parameters:
bands - Number of color bands
rows - Number of rows

Data

public Data(int bands,
            int rows,
            int cols)
Constructor - Creates the first (color bands) second (row size) and third (column size) array dimension.
Parameters:
bands - Number of color bands
rows - Number of rows

Method Details

copy

public static void copy(Data src,
                        Data target)
Copies a source 3-dim array to a target 3-dim array with identical dimensions
Parameters:
src - Source Data array

get

public double[][][] get()
Returns the current 3-dim data array

get

public double[][] get(int band)
Returns the rows and columns in the current double data array for a specified band
Parameters:
band - The target color band

get

public double[] get(int band,
                    int row)
Returns the columns in the current double data array for a specified band and row
Parameters:
band - The target color band

get

public double get(int band,
                  int row,
                  int col)
Returns a single value in the current double data array for a specified band, row and column position
Parameters:
band - The target color band

getHighPass

public Data getHighPass()
Get high pass data of the current 3-dim array. High pass column length is half of total column length.
Returns:
High pass data

getHighPass

public Data getHighPass(int noOfRows,
                        int noOfCols)
Get high pass data of the current 3-dim array. High pass dimenions (rows and columns) are specified.
Parameters:
noOfRows - High pass number of rows
Returns:
High pass data

getLowPass

public Data getLowPass()
Get low pass data of the current 3-dim array. Low pass column length is half of total column length.
Returns:
Low pass data

getLowPass

public Data getLowPass(int noOfRows,
                       int noOfCols)
Get low pass data of the current 3-dim array. Low pass dimenions (rows and columns) are specified.
Parameters:
noOfRows - Low pass number of rows
Returns:
Low pass data

getNumBands

private int getNumBands()
Returns the number of color bands of the current 3-dim array.

getNumCols

public int getNumCols()
Returns the number of columns of the current 3-dim array.

getNumRows

public int getNumRows()
Returns the number of rows of the current 3-dim array.

isBandArrayCreated

private boolean isBandArrayCreated()
Checks wether the first array dimension (color bands) is created.

isColArrayCreated

private boolean isColArrayCreated()
Checks wether the third array dimension (columns) is created.

isRowArrayCreated

private boolean isRowArrayCreated()
Checks wether the second array dimension (rows) is created.

set

public void set(double newData,
                int band,
                int row,
                int col)
Replaces one single value in the current double data array
Parameters:
newData - The new value
band - The target color band

set

public void set(double[] newData,
                int band,
                int row)
Replaces the column dimension of the current double data array
Parameters:
newData - New 1-dim double data array (columns)
band - The target color band

set

public void set(double[][] newData,
                int band)
Replaces the row and column dimension of the current double data array
Parameters:
newData - New 2-dim double data array (rows and columns)
band - The target 1st dimension

set

public void set(double[][][] newData)
Replaces all 3 dimensions of the current double data array
Parameters:
newData - New 3-dim double data array

swap

public void swap()
Swap rows and cols of the array (in place)

swap

public Data swap(Data out)
Swap rows and cols of the array (no array modification)
Parameters:
out - Swap target Data array
Returns:
Swapped data in a new array

updateDimensions

private void updateDimensions()
In case of array modifications, update the dimension variables here.