|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmarvin.image.MarvinImage
public class MarvinImage
Image object with many operations. This class is the image representation used for the other classes in the framework.
| Field Summary | |
|---|---|
protected int[] |
arrColor
|
protected int |
b
|
protected java.awt.Color |
color
|
protected java.lang.String |
filePath
|
protected java.lang.String |
formatName
|
protected int |
g
|
protected java.awt.image.BufferedImage |
image
|
protected int |
numComponents
|
static int |
PROPORTIONAL
|
protected int |
r
|
protected int |
rgb
|
static int |
TYPE_INT_RGB
|
| Constructor Summary | |
|---|---|
MarvinImage(java.awt.image.BufferedImage img)
Constructor using a image in memory |
|
MarvinImage(java.awt.image.BufferedImage img,
java.lang.String fmtName)
Constructor using a image in memory |
|
MarvinImage(int w,
int h)
Constructor to blank image, passing the size of image |
|
| Method Summary | |
|---|---|
int |
boundRGB(int rgb)
|
void |
clearImage(int color)
|
MarvinImage |
clone()
Clones the MarvinImage |
static void |
copyIntColorArray(MarvinImage imgSource,
MarvinImage imgDestine)
|
MarvinImage |
crop(int x,
int y,
int w,
int h)
|
void |
drawLine(int x0,
int y0,
int x1,
int y1,
java.awt.Color c)
Bresenham´s Line Drawing implementation |
void |
drawRect(int x,
int y,
int w,
int h,
java.awt.Color c)
Draws a rectangle in the image. |
boolean |
equals(java.lang.Object obj)
Compare two MarvinImage objects |
void |
fillRect(int x,
int y,
int w,
int h,
java.awt.Color c)
Fills a rectangle in the image. |
java.awt.image.BufferedImage |
getBufferedImage()
|
java.awt.image.BufferedImage |
getBufferedImage(int width,
int height)
Resize and return the image passing the new height and width |
java.awt.image.BufferedImage |
getBufferedImage(int width,
int height,
int type)
Resize and return the image passing the new height and width, but maintains width/height factor |
int |
getComponents()
|
java.lang.String |
getFilePath()
|
java.lang.String |
getFormatName()
|
int |
getHeight()
Returns the height |
int |
getIntColor(int x,
int y)
Gets the integer color composition for x, y position |
int[] |
getIntColorArray()
|
int |
getIntComponent0(int x,
int y)
Gets the integer color component 0 in the x and y position |
int |
getIntComponent1(int x,
int y)
Gets the integer color component 1 in the x and y position |
int |
getIntComponent2(int x,
int y)
Gets the integer color component 2 in the x and y position |
java.awt.image.BufferedImage |
getNewImageInstance()
Return a new instance of the BufferedImage |
int |
getType()
Gets the type |
int |
getWidth()
Returns the width |
int |
limit8bitsColor(int color)
Limits the color value between 0 and 255. |
double |
multi8p(int x,
int y,
double masc)
Multiple of gradient windwos per masc relation of x y |
int[] |
Multi8p(int x,
int y,
int[][] masc)
Convolution operator |
void |
resize(int w,
int h)
Resize the image passing the new height and width |
void |
setBufferedImage(java.awt.image.BufferedImage img)
Sets a new image |
void |
setDimension(int w,
int h)
|
void |
setFilePath(java.lang.String fp)
|
void |
setIntColor(int x,
int y,
int color)
Sets the integer color composition in X an Y position |
void |
setIntColor(int x,
int y,
int c0,
int c1,
int c2)
Sets the integer color in X an Y position |
void |
setIntColorArray(int[] arr)
Set the integer color array for the entire image. |
void |
update()
|
void |
updateColorArray()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TYPE_INT_RGB
public static final int PROPORTIONAL
protected java.awt.image.BufferedImage image
protected java.lang.String filePath
protected int[] arrColor
protected int rgb
protected int r
protected int b
protected int g
protected java.awt.Color color
protected java.lang.String formatName
protected int numComponents
| Constructor Detail |
|---|
public MarvinImage(java.awt.image.BufferedImage img)
img - Image
public MarvinImage(java.awt.image.BufferedImage img,
java.lang.String fmtName)
img - ImagefmtName - Image format name
public MarvinImage(int w,
int h)
int - widthint - height| Method Detail |
|---|
public int getComponents()
public MarvinImage crop(int x,
int y,
int w,
int h)
public void updateColorArray()
public void update()
public void clearImage(int color)
public int getType()
public java.lang.String getFormatName()
public void setFilePath(java.lang.String fp)
fp - : file path to this MarvinImagepublic java.lang.String getFilePath()
public void setDimension(int w,
int h)
public int[] getIntColorArray()
public void setIntColorArray(int[] arr)
public static void copyIntColorArray(MarvinImage imgSource,
MarvinImage imgDestine)
public int getIntColor(int x,
int y)
int - xint - y
public int getIntComponent0(int x,
int y)
int - xint - y
public int getIntComponent1(int x,
int y)
int - xint - y
public int getIntComponent2(int x,
int y)
int - xint - y
public int getWidth()
public int getHeight()
public void setIntColor(int x,
int y,
int color)
x - positiony - positioncolor - color value
public void setIntColor(int x,
int y,
int c0,
int c1,
int c2)
x - positiony - positionc0 - component 0c1 - component 1c2 - component 2public void setBufferedImage(java.awt.image.BufferedImage img)
BufferedImage - imagempublic java.awt.image.BufferedImage getBufferedImage()
public int limit8bitsColor(int color)
public int[] Multi8p(int x,
int y,
int[][] masc)
public java.awt.image.BufferedImage getNewImageInstance()
public java.awt.image.BufferedImage getBufferedImage(int width,
int height)
height - width -
public java.awt.image.BufferedImage getBufferedImage(int width,
int height,
int type)
height - width -
public void resize(int w,
int h)
height - width - public MarvinImage clone()
MarvinImage
clone in class java.lang.Object
public double multi8p(int x,
int y,
double masc)
public int boundRGB(int rgb)
public void drawLine(int x0,
int y0,
int x1,
int y1,
java.awt.Color c)
public void drawRect(int x,
int y,
int w,
int h,
java.awt.Color c)
x - rect´s start position in x-axisy - rect´s start positioj in y-axisw - rect´s widthh - rect´s heightc - rect´s color
public void fillRect(int x,
int y,
int w,
int h,
java.awt.Color c)
x - rect´s start position in x-axisy - rect´s start positioj in y-axisw - rect´s widthh - rect´s heightc - rect´s colorpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - object to be compared. MarvinImage object is expected.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||