|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfable.imageviewer.model.ImageModel
public class ImageModel
This class implements a simple image model that stores the the width, height, and the pixel data. The data are stored as a float[index] with index = col + row * width. It calculates the statistics (min, max, and mean) when requested and then stores the values.
Field Summary | |
---|---|
static java.lang.String |
DATA_CHANGED
Denotes that the data and statistics changed but not the other parameters. |
static java.lang.String |
RESET
Denotes the data and parameters changed. |
Method Summary | |
---|---|
void |
addImageModelListener(ImageModelListener l)
Adds the listener. |
float[] |
getData()
|
float |
getData(int row,
int col)
Return the value of the data corresponding to the given row and column of the stored data. |
float |
getData(int row,
int col,
org.eclipse.swt.graphics.Rectangle rect)
return the value of the data corresponding to given row and column of the given Rectangle. |
float[] |
getData(org.eclipse.swt.graphics.Rectangle rect)
Returns a sub array of the data corresponding to the given Rectangle. |
java.lang.String |
getFileName()
|
int |
getHeight()
|
org.eclipse.swt.graphics.Rectangle |
getRect()
|
float[] |
getStatistics()
Get the statistics (min, max, mean) for the whole image. |
float[] |
getStatistics(org.eclipse.swt.graphics.Rectangle rect)
Get the statistics (min, max, mean) for a sub Rectangle. |
long |
getTimeToReadImage()
|
int |
getWidth()
|
void |
removeAllImageModelListeners(ImageModelListener l)
Removes all the listeners. |
void |
removeImageModelListener(ImageModelListener l)
Removes the listener. |
void |
reset(java.lang.String fileName,
int width,
int height,
float[] data)
Resets the model based on the given parameters. |
void |
set(FabioFile fabioFile)
Resets the model based on the given FabioFile; |
void |
setData(float[] data)
Sets a new value for the data and cause a DATA_CHANGED ImageModelEvent to be fired. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DATA_CHANGED
public static final java.lang.String RESET
Method Detail |
---|
public void addImageModelListener(ImageModelListener l)
l
- public void removeImageModelListener(ImageModelListener l)
l
- public void removeAllImageModelListeners(ImageModelListener l)
l
- public void set(FabioFile fabioFile) throws java.lang.Throwable
fabioFile
-
jep.JepException
java.lang.Throwable
public void reset(java.lang.String fileName, int width, int height, float[] data)
fileName
- width
- height
- mean
- data
- public java.lang.String getFileName()
public int getWidth()
public int getHeight()
public org.eclipse.swt.graphics.Rectangle getRect()
public float[] getStatistics()
public float[] getStatistics(org.eclipse.swt.graphics.Rectangle rect)
rect
-
public float[] getData()
public float getData(int row, int col)
row
- col
-
public float getData(int row, int col, org.eclipse.swt.graphics.Rectangle rect)
row
- col
- rect
-
public float[] getData(org.eclipse.swt.graphics.Rectangle rect)
rect
-
public void setData(float[] data)
data
- the data to setpublic long getTimeToReadImage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |