|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.hiof.imagepr.IntensityImage
IntensityImage is a class for intensity images (gray scale images) which is supposed to be easier to use than the classes for image processing in the Java SDK API. The IntensityImage class contains one two-dimensional short array for the intensity values.
In order to be viewed properly, the intensity values must be set in the interval from 0 to 255. As default an IntensityImage is shown with a gray scale colormap, which means that an intensity of 0 is shown as black and an intensity of 255 is shown as white. It is possible to change which colormap to use. Several predifined colormaps are defined as static matrices.
RGBImage
,
BinaryImage
,
HSIImage
,
Serialized FormField Summary | |
static short[][] |
BLUE
Colormap which shows the image in shades of blue. |
protected short[][] |
colormap
The current mapping between intensity values and RGB colors |
static short[][] |
COOL
Colormap which shows an intensity of 0 as blue and an intensity of 255 as white. |
protected short[][] |
data
The matrix with pixel values |
static short[][] |
GRAY
Colormap which shows the image as gray. |
static short[][] |
GREEN
Colormap which shows the image in shades of green. |
static short[][] |
HSI
Colormap which uses the HSI color model. |
static short[][] |
INVGRAY
Colormap which shows the image as an inverted gray image. |
static short[][] |
RED
Colormap which shows the image in shades of red. |
static short[][] |
TEMP
Colormap which shows an intensity of 0 as blue and an intensity of 255 as red. |
Constructor Summary | |
IntensityImage()
Constructor that creates an empty IntensityImage. |
|
IntensityImage(IntensityImage otherImage)
Constructor that copies another IntensityImage. |
|
IntensityImage(int height,
int width)
Constructor that creates an IntensityImage with all pixel values set to zero. |
|
IntensityImage(RGBImage rgbImage)
A constructor that creates an IntensityImage from a RGBImage by letting the gray scale intensity be the average of the red, green and blue intensities. |
|
IntensityImage(short[][] data)
Constructor that creates an IntensityImage with given intensity data. |
|
IntensityImage(java.lang.String filename)
Constructor that creates an IntensityImage by reading data from a file. |
Method Summary | |
Image |
createScaledImage(double scale,
int interpolType)
Creates a scaled image. |
void |
draw(java.awt.Graphics g,
int x,
int y)
Draws the image to a Graphics object at a given position. |
void |
draw(java.awt.Graphics g,
int x,
int y,
double scaleX,
double scaleY,
double rotateAngle)
Draws the image to a Graphics object at a given position with a given scale and rotation. |
short[][] |
getData()
Returns the matrix of intensity data. |
int |
getHeight()
The height of the image. |
int |
getWidth()
The width of the image. |
void |
load(java.lang.String filename)
Loads the image from a file. |
java.awt.image.BufferedImage |
makeBufferedImage()
Creates a bufferedImage of the intensityImage using the current colormap. |
static short[][] |
makeColormap(java.awt.Color minColor,
java.awt.Color maxColor)
Calculates a linear colormap. |
RGBImage |
makeRGBImage()
Makes a RGBImage of the IntensityImage using the current colormap. |
void |
save(java.lang.String filename)
Saves the image to a binary file. |
void |
setColormap(java.awt.Color minColor,
java.awt.Color maxColor)
Calculates and sets the colormap of the IntensityImage. |
void |
setColormap(short[][] colormap)
Sets the current colormap of the IntensityImage. |
void |
setData(short[][] data)
Sets the matrix of intensity data. |
void |
show()
Shows the HSIImage in a modal window. |
void |
show(java.lang.String title)
Shows the IntensityImage in a modal window. |
void |
show(java.lang.String title,
double scale)
Shows the IntensityImage scaled with use of nearest neighbor interpolation. |
void |
showBL(double scale,
java.lang.String title)
Shows the IntensityImage scaled with use of bilinear interpolation. |
java.lang.String |
toString()
Returns a description of the image. |
boolean |
withColors()
Returns true if the image uses a colormap which uses other colors than gray. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected short[][] data
protected short[][] colormap
public static short[][] GRAY
public static short[][] INVGRAY
public static short[][] RED
public static short[][] GREEN
public static short[][] BLUE
public static short[][] HSI
public static short[][] TEMP
public static short[][] COOL
Constructor Detail |
public IntensityImage()
public IntensityImage(short[][] data)
data
- Matrix of intensity data.public IntensityImage(int height, int width)
height
- The height of the imagewidth
- The width of the imagepublic IntensityImage(java.lang.String filename) throws java.io.IOException
filename
- The name of the file.public IntensityImage(IntensityImage otherImage)
otherImage
- Original image.public IntensityImage(RGBImage rgbImage)
rgbImage
- Original image.Method Detail |
public java.awt.image.BufferedImage makeBufferedImage()
makeBufferedImage
in interface Image
public void show(java.lang.String title)
show
in interface Image
title
- The title on top of the window.public void show()
public void show(java.lang.String title, double scale)
show
in interface Image
scale
- The scale.title
- The title on top of the window.public void showBL(double scale, java.lang.String title)
scale
- The scale.title
- The title on top of the window.public void draw(java.awt.Graphics g, int x, int y)
draw
in interface Image
g
- The Graphics object to draw on.x
- The horizontal position of the image.y
- The vertical position of the image.public void draw(java.awt.Graphics g, int x, int y, double scaleX, double scaleY, double rotateAngle)
draw
in interface Image
g
- The Graphics object to draw on.x
- The horizontal position of the image.y
- The vertical position of the image.scaleX
- The scale in x-direction. 1.0 means unscaled.scaleY
- The scale in y-direction. 1.0 means unscaled.rotateAngle
- Rotation of the image in degrees (0-360).public RGBImage makeRGBImage()
public void setColormap(short[][] colormap)
colormap
- The colormap.public void setColormap(java.awt.Color minColor, java.awt.Color maxColor)
minColor
- Color which represent 0.maxColor
- Color which represent 255.public static short[][] makeColormap(java.awt.Color minColor, java.awt.Color maxColor)
minColor
- Color which represent 0.maxColor
- Color which represent 255.
public short[][] getData()
public void setData(short[][] data)
data
- The matrix of intensity data.public int getWidth()
getWidth
in interface Image
public int getHeight()
getHeight
in interface Image
public void save(java.lang.String filename) throws java.io.IOException
filename
- The filename.
java.io.IOException
public void load(java.lang.String filename) throws java.io.IOException
filename
- The filename.
java.io.IOException
public boolean withColors()
public java.lang.String toString()
public Image createScaledImage(double scale, int interpolType)
createScaledImage
in interface Image
scale
- The scaleinterpolType
- The type of interpolation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |