|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.hiof.imagepr.HSVImage
An HSVImage is an image using the HSV colour model, which means that each pixel has hue, saturation and value components. This class contains methods for setting and getting the HSV components, for transformation between HSV and RGB colour models and for displaying the image and it's HSV components.
All of the components (hue, saturation and value) must be in the interval 0 to 255.
Transforming formulas between the RGB and HSV color models are obtained from www.easyrgb.com/math.html
RGBImage
,
IntensityImage
,
BinaryImage
,
HSIImage
,
Serialized FormField Summary | |
protected short[][] |
hue
The Matrix with the hue 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. |
protected short[][] |
value
The Matrix with the value component of the image. |
Fields inherited from interface no.hiof.imagepr.Image |
BLUE, GREEN, RED |
Constructor Summary | |
HSVImage()
Creates an empty HSVImage object. |
|
HSVImage(HSVImage otherImage)
A copy constructor which copies another HSVImage. |
|
HSVImage(RGBImage image)
Creates an HSVImage by converting a RGBImage. |
|
HSVImage(short[][] hue,
short[][] saturation,
short[][] value)
A constructor that sets the HSV matrices |
Method Summary | |
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 HSV 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[][] |
getSaturation()
Gets the reference to the matrix with the saturation component of the image. |
short[][] |
getValue()
Gets the reference to the matrix with the value component of the image. |
int |
getWidth()
The width of the image. |
static int[] |
hsv2rgb(double hue,
double saturation,
double value,
int depth)
|
java.awt.image.BufferedImage |
makeBufferedImage()
Creates a bufferedImage of the HSVImage. |
RGBImage |
makeRGBImage()
Makes a RGBImage of the HSVImage. |
static double[] |
rgb2hsv(int red,
int green,
int blue,
int depth)
|
void |
setHue(short[][] hue)
Sets the hue component of the image. |
void |
setSaturation(short[][] saturation)
Sets the saturation component of the image. |
void |
setValue(short[][] value)
Sets the value component of the image. |
void |
show()
Shows the HSVImage in a modal window. |
void |
show(java.lang.String title)
Shows the HSVImage in a modal window. |
void |
show(java.lang.String title,
double scale)
Shows the HSVImage scaled with use of nearest neighbor interpolation. |
void |
showBL(double scale,
java.lang.String title)
Shows the HSVImage scaled with use of bilinear interpolation. |
void |
showHue()
Shows the hue component as an value image. |
void |
showHue(java.lang.String title)
Shows the hue component as an value image. |
void |
showSaturation()
Shows the saturation component as an value image. |
void |
showSaturation(java.lang.String title)
Shows the saturation component as an value image. |
void |
showValue()
Shows the Value component as an value image. |
void |
showValue(java.lang.String title)
Shows the Value component as an value 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[][] value
Constructor Detail |
public HSVImage()
public HSVImage(RGBImage image)
image
- RGBImage to be converted.public HSVImage(short[][] hue, short[][] saturation, short[][] value)
hue
- The hue component of the image.saturation
- The saturation component of the image.value
- The value component of the image.public HSVImage(HSVImage otherImage)
otherImage
- Another HSVImage.Method Detail |
public short[][] getHue()
public short[][] getSaturation()
public short[][] getValue()
public void setHue(short[][] hue)
hue
- Matrix with the hue values.public void setSaturation(short[][] saturation)
saturation
- Matrix with the saturation values.public void setValue(short[][] value)
value
- Matrix with the value 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 static double[] rgb2hsv(int red, int green, int blue, int depth)
public RGBImage makeRGBImage()
public static int[] hsv2rgb(double hue, double saturation, double value, int depth)
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 showValue()
public void showHue(java.lang.String title)
public void showSaturation(java.lang.String title)
public void showValue(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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |