|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectSciLib.SP.IP.Picture
public class Picture
This class contains some useful methods to handle bitmap file.
| Field Summary | |
|---|---|
protected java.awt.Component |
c
|
java.awt.image.ColorModel |
cm
|
protected int |
height
|
protected java.awt.Image |
image
|
protected double[] |
intensities
|
protected int[] |
pixels
|
protected int |
width
|
| Constructor Summary | |
|---|---|
Picture()
make an emty constructor |
|
Picture(java.awt.Image img,
java.awt.Component c)
make a Pict object with a specific Image img |
|
Picture(java.lang.String fileName,
java.awt.Component c)
make a Pict object from a bitmap file |
|
| Method Summary | |
|---|---|
Picture |
blackWhite()
make a lack and white picture |
Picture |
changeIntensities(int p)
change intensities |
Picture |
contrast(int t,
int t2,
java.lang.String color)
make a contrast picture |
Picture |
crop(int x,
int y,
int w,
int h)
crop an image with a specific rectangle |
Picture |
crop(java.awt.Rectangle rect)
crop an image with a specific rectangle |
Picture |
dissolve(int alpha)
Alpha filter an image with a media tracker in a component c |
void |
drawImage(java.awt.Graphics g)
draw image |
void |
drawImage(java.awt.Graphics g,
int w,
int h)
draw image |
Picture |
edge()
make an edge picture |
int[] |
getColors(java.lang.String color)
get color components of a picture |
int |
getHeight()
get height |
java.awt.Image |
getImage()
get image |
double[] |
getIntensities()
get intensities |
double |
getIntensity(int rgb)
get Intensity |
int |
getPixel(int i)
get pixel at index i |
int |
getPixel(int x,
int y)
gets a pixel at (x,y) |
int[] |
getPixels()
get pixels |
int |
getWidth()
get width |
int[] |
iHistogram()
intenisty histogram |
static int[] |
makeHistogram(int[] col)
make histogram |
Picture |
makePicture(int width,
int height,
int[] pixels)
make a picture from an array of pixels |
Picture |
negative()
make a negative picture |
Picture |
scale(double ws,
double hs)
scale an image with with a media tracker in a component c |
Picture |
scaleColor(int r,
int g,
int b)
scale all colors in the picture |
Picture |
scaleColor(int p,
java.lang.String color)
scale one or all color components in the picture |
void |
setHeight(int h)
set heigth |
void |
setPixels(int[] p)
set pixels |
void |
setWidth(int w)
set width |
Picture |
shadow()
make a shadow picture |
Picture |
waveFilter(int amplitude,
int frequency)
make a wave filter picture |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int[] pixels
protected double[] intensities
protected java.awt.Image image
protected int width
protected int height
public java.awt.image.ColorModel cm
protected java.awt.Component c
| Constructor Detail |
|---|
public Picture()
public Picture(java.awt.Image img,
java.awt.Component c)
public Picture(java.lang.String fileName,
java.awt.Component c)
| Method Detail |
|---|
public int getWidth()
public int getHeight()
public java.awt.Image getImage()
public int getPixel(int i)
i - An integer value
public int getPixel(int x,
int y)
x - An integer valuey - An integer value
public int[] getPixels()
public void setWidth(int w)
public void setHeight(int h)
public void setPixels(int[] p)
public void drawImage(java.awt.Graphics g)
public void drawImage(java.awt.Graphics g,
int w,
int h)
public Picture crop(int x,
int y,
int w,
int h)
x - An integer, x positiony - An integer, y positionw - An integer, the width of the rectangleh - An integer, the height of the rectangle
public Picture crop(java.awt.Rectangle rect)
rect - A Rectabgle area
public Picture scale(double ws,
double hs)
ws - A double value, the horizontal scale factorhs - A double value, the vertical scale factor
public Picture dissolve(int alpha)
alpha - An integer value, the alpha value between 0 and 255
public Picture blackWhite()
public Picture negative()
public Picture contrast(int t,
int t2,
java.lang.String color)
t - An integer value, a threshold
public Picture scaleColor(int r,
int g,
int b)
r - An integer value, the percentage of the red componentg - An integer value, the percentage of the green componentb - An integer value, the percentage of the blue component
public Picture scaleColor(int p,
java.lang.String color)
p - An integer value, the percentage of the color componentcolor - A String, the color component, "red", "green", "blue" or "all"
public Picture makePicture(int width,
int height,
int[] pixels)
width - An integer, the width of the pictureheight - An integer, the height of the picturepixels - An integer array
public Picture waveFilter(int amplitude,
int frequency)
amplitude - An integer valuefrequency - An integer value
public Picture shadow()
public double getIntensity(int rgb)
public double[] getIntensities()
public Picture edge()
public int[] iHistogram()
public int[] getColors(java.lang.String color)
public static int[] makeHistogram(int[] col)
public Picture changeIntensities(int p)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||