|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFacemorph.mask.BitmapMask
public class BitmapMask
Extends the MaskInterface class to allow for bitmap based masking
Constructor Summary | |
---|---|
BitmapMask()
|
Method Summary | |
---|---|
MaskInterface |
clone()
Creates and returns a copy of this object. |
protected java.awt.Image |
convertToImagePlusAlpha(FloatImage mask)
|
FloatImage |
getAsFloatImage(Template tem,
int w,
int h,
float min,
float max)
Constructs a FloatImage with values of 0 (masked) and max (not masked) |
double |
getBlur()
Gets the size of the Gaussian (or implementation specific) blur to apply to the mask |
javax.swing.filechooser.FileNameExtensionFilter |
getExt()
|
FloatImage |
maskImage(FloatImage img,
Template tem,
java.awt.Color col,
boolean reverse)
Masks an image using the template object specified/ |
java.awt.Image |
maskImage(java.awt.Image img,
Template tem,
java.awt.Color col,
boolean reverse)
Masks an image using the template object specified/ |
void |
paint(Template tem,
java.awt.Graphics g,
java.awt.Color col,
int xoff,
int yoff,
int width,
int height,
float zoom)
Paint the mask using the supplied Graphics component |
void |
paint(Template tem,
java.awt.Graphics g,
java.awt.Color col,
int xoff,
int yoff,
int width,
int height,
float zoom,
boolean invert)
Paint the mask using the supplied Graphics component, with option to invert the mask |
void |
read(java.io.File file)
Reads a mask from a file |
void |
read(java.io.Reader r)
Reads a mask from a Reader (e.g. |
void |
setBlur(double blurLevel)
Sets the size of the Gaussian (or implementation specific) blur to apply to the mask The size specified as multiple applications of a Gaussian blur function |
void |
setFloatImage(FloatImage img)
Sets the floatimage to be used as a mask |
void |
write(java.io.File file)
Writes the mask to a file |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BitmapMask()
Method Detail |
---|
public void setFloatImage(FloatImage img)
img
- public void read(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
read
in interface MaskInterface
file
- The name of the mask file
java.io.FileNotFoundException
- thrown if file not found
java.io.IOException
- thrown if some other I/O errorpublic MaskInterface clone()
MaskInterface
clone
in interface MaskInterface
clone
in class java.lang.Object
public void read(java.io.Reader r) throws java.io.IOException
r
- The Reader to read from
java.io.IOException
- if an IOException occurspublic void write(java.io.File file) throws java.io.IOException
write
in interface MaskInterface
file
- the name of the file to write to
java.io.IOException
public FloatImage getAsFloatImage(Template tem, int w, int h, float min, float max)
MaskInterface
getAsFloatImage
in interface MaskInterface
tem
- the template to apply the mask tow
- The width of the output mask imageh
- The height of the output mask imagemin
- The values to draw outside the masked regionsmax
- The values to draw in the masked regions
public void paint(Template tem, java.awt.Graphics g, java.awt.Color col, int xoff, int yoff, int width, int height, float zoom)
MaskInterface
paint
in interface MaskInterface
tem
- Template to form mask aroundg
- Graphics object to paint ontocol
- Colour to paint the maskxoff
- the x-offsetyoff
- the y-offsetzoom
- the zoompublic void paint(Template tem, java.awt.Graphics g, java.awt.Color col, int xoff, int yoff, int width, int height, float zoom, boolean invert)
MaskInterface
paint
in interface MaskInterface
tem
- Template to form mask aroundg
- Graphics object to paint ontocol
- Colour to paint the maskxoff
- the x-offsetyoff
- the y-offsetzoom
- the zoominvert
- will invert the mask if true.public java.awt.Image maskImage(java.awt.Image img, Template tem, java.awt.Color col, boolean reverse)
MaskInterface
maskImage
in interface MaskInterface
img
- The image to masktem
- The template to usecol
- The colour to draw in the masked regionsreverse
- If true draw outside the polygon defined by the mask, otherwise draw inside
public FloatImage maskImage(FloatImage img, Template tem, java.awt.Color col, boolean reverse)
MaskInterface
maskImage
in interface MaskInterface
img
- The floating point image to masktem
- The template to usecol
- The colour to draw in the masked regionsreverse
- If true draw outside the polygon defined by the mask, otherwise draw inside
protected java.awt.Image convertToImagePlusAlpha(FloatImage mask)
public javax.swing.filechooser.FileNameExtensionFilter getExt()
getExt
in interface MaskInterface
public void setBlur(double blurLevel)
MaskInterface
setBlur
in interface MaskInterface
public double getBlur()
MaskInterface
getBlur
in interface MaskInterface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |