|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.hiof.imagepr.HSIImage
An HSIImage is an image using the HSI colour model, which means that each pixel has hue, saturation and intensity components. This class contains methods for setting and getting the HSI components, for transformation between HSI and RGB colour models and for displaying the image and it's HSI components.
All of the components (hue, saturation and intensity) must be in the interval 0 to 255. The hue component is circular, which means that the hue value for 0 and 255 is identical.
RGBImage
,
IntensityImage
,
BinaryImage
,
Serialized FormField Summary | |
protected short[][] |
hue
The Matrix with the hue component of the image. |
protected short[][] |
intensity
The Matrix with the intensity component of the image. |
static int |
L
The maximum number of levels in each matrix. |
protected short[][] |
saturation
The Matrix with the saturation component of the image. |
Fields inherited from interface no.hiof.imagepr.Image |
BLUE, GREEN, RED |
Constructor Summary | |
HSIImage()
Creates an empty HSIImage object. |
|
HSIImage(HSIImage otherImage)
A copy constructor which copies another HSIImage. |
|
HSIImage(RGBImage image)
Creates an HSIImage by converting a RGBImage. |
|
HSIImage(short[][] hue,
short[][] saturation,
short[][] intensity)
A constructor that sets the HSI matrices |
Method Summary | |
void |
adjustIntensity()
Adjust the intensity, so that it doesn't have impossible values. |
Image |
createScaledImage(double scale,
int interpolType)
Creates a scaled image. |
void |
draw(java.awt.Graphics g,
int x,
int y)
Draw 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)
Draw the image to a Graphics object at a given position with a given scale and rotation. |
void |
fromRGBImage(RGBImage image)
calculats the HSI components from the RGB components of a RGBImage. |
int |
getHeight()
The height of the image. |
short[][] |
getHue()
Gets the reference to the matrix with the hue component of the image. |
short[][] |
getIntensity()
Gets the reference to the matrix with the intensity component of the image. |
short[][] |
getSaturation()
Gets the reference to the matrix with the saturation component of the image. |
int |
getWidth()
The width of the image. |
java.awt.image.BufferedImage |
makeBufferedImage()
Creates a bufferedImage of the HSIImage. |
RGBImage |
makeRGBImage()
Makes a RGBImage of the HSIImage. |
void |
maximizeIntensity()
Set the intensity to its maximum possible value while maintaining hue and saturation |
static double |
maxIntensity(double hue,
double sat)
Find the maximum intensity possible given a hue and saturation, all in the interval [0,1]. |
void |
setHue(short[][] hue)
Sets the hue component of the image. |
void |
setIntensity(short[][] intensity)
Sets the intensity component of the image. |
void |
setSaturation(short[][] saturation)
Sets the saturation component of the image. |
void |
show()
Shows the HSIImage in a modal window. |
void |
show(java.lang.String title)
Shows the HSIImage in a modal window. |
void |
show(java.lang.String title,
double scale)
Shows the HSIImage scaled with use of nearest neighbor interpolation. |
void |
showBL(double scale,
java.lang.String title)
Shows the HSIImage scaled with use of bilinear interpolation. |
void |
showHue()
Shows the hue component as an intensity image. |
void |
showHue(java.lang.String title)
Shows the hue component as an intensity image. |
void |
showIntensity()
Shows the Intensity component as an intensity image. |
void |
showIntensity(java.lang.String title)
Shows the Intensity component as an intensity image. |
void |
showSaturation()
Shows the saturation component as an intensity image. |
void |
showSaturation(java.lang.String title)
Shows the saturation component as an intensity image. |
java.lang.String |
toString()
Returns a description of the image. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int L
protected short[][] hue
protected short[][] saturation
protected short[][] intensity
Constructor Detail |
public HSIImage()
public HSIImage(RGBImage image)
image
- RGBImage to be converted.public HSIImage(short[][] hue, short[][] saturation, short[][] intensity)
hue
- The hue component of the image.saturation
- The saturation component of the image.intensity
- The intensity component of the image.public HSIImage(HSIImage otherImage)
otherImage
- Another HSIImage.Method Detail |
public short[][] getHue()
public short[][] getSaturation()
public short[][] getIntensity()
public void setHue(short[][] hue)
hue
- Matrix with the hue values.public void setSaturation(short[][] saturation)
saturation
- Matrix with the saturation values.public void setIntensity(short[][] intensity)
intensity
- Matrix with the intensity colour values.public int getWidth()
getWidth
in interface Image
public int getHeight()
getHeight
in interface Image
public void fromRGBImage(RGBImage image)
image
- The RGB source image.public RGBImage makeRGBImage()
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
title
- The title on top of the window.scale
- The scale.public void showBL(double scale, java.lang.String title)
scale
- The scale.title
- The title on top of the window.public void showHue()
public void showSaturation()
public void showIntensity()
public void showHue(java.lang.String title)
public void showSaturation(java.lang.String title)
public void showIntensity(java.lang.String title)
public Image createScaledImage(double scale, int interpolType)
createScaledImage
in interface Image
scale
- The scale.interpolType
- The type of interpolationpublic 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 java.awt.image.BufferedImage makeBufferedImage()
makeBufferedImage
in interface Image
public java.lang.String toString()
public static double maxIntensity(double hue, double sat)
hue
- Huesat
- Saturation
public void adjustIntensity()
public void maximizeIntensity()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |