org.lee.mugen.imageIO
Class Scale2xImageFilter
java.lang.Object
java.awt.image.ImageFilter
java.awt.image.ReplicateScaleFilter
org.lee.mugen.imageIO.Scale2xImageFilter
- All Implemented Interfaces:
- java.awt.image.ImageConsumer, java.lang.Cloneable
public class Scale2xImageFilter
- extends java.awt.image.ReplicateScaleFilter
Field Summary |
static java.lang.String |
version
|
Fields inherited from class java.awt.image.ReplicateScaleFilter |
destHeight, destWidth, outpixbuf, srccols, srcHeight, srcrows, srcWidth |
Fields inherited from class java.awt.image.ImageFilter |
consumer |
Fields inherited from interface java.awt.image.ImageConsumer |
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT |
Method Summary |
void |
setDimensions(int w,
int h)
Override the dimensions of the source image and pass the dimensions
of the new scaled size to the ImageConsumer. |
void |
setPixels(int x,
int y,
int w,
int h,
java.awt.image.ColorModel model,
byte[] pixels,
int off,
int scansize)
Apply Scale2x here. |
void |
setPixels(int x,
int y,
int w,
int h,
java.awt.image.ColorModel model,
int[] pixels,
int off,
int scansize)
This method is where the Scale2x algorithm is applied. |
void |
setProperties(java.util.Hashtable props)
|
Methods inherited from class java.awt.image.ImageFilter |
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setColorModel, setHints |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
version
public static final java.lang.String version
- See Also:
- Constant Field Values
Scale2xImageFilter
public Scale2xImageFilter(int w,
int h)
- Constructor for Scale2xImageFilter.
setDimensions
public void setDimensions(int w,
int h)
- Override the dimensions of the source image and pass the dimensions
of the new scaled size to the ImageConsumer.
Note: This method is intended to be called by the
ImageProducer
of the Image
whose pixels
are being filtered. Developers using
this class to filter pixels from an image should avoid calling
this method directly since that operation could interfere
with the filtering operation.
- Specified by:
setDimensions
in interface java.awt.image.ImageConsumer
- Overrides:
setDimensions
in class java.awt.image.ReplicateScaleFilter
- See Also:
ImageConsumer
setProperties
public void setProperties(java.util.Hashtable props)
- Specified by:
setProperties
in interface java.awt.image.ImageConsumer
- Overrides:
setProperties
in class java.awt.image.ReplicateScaleFilter
setPixels
public void setPixels(int x,
int y,
int w,
int h,
java.awt.image.ColorModel model,
byte[] pixels,
int off,
int scansize)
- Apply Scale2x here.
FIXME: This method (setPixels() with a byte array) has not been
tested, mainly because I don't readily have an ImageProducer which
serves up bytes for the pixels. Also, this method just copies the bytes
to integers and calls the other method, which isn't very efficient. Once
the int method is optimized, this method will be re-written.
Note: This method is intended to be called by the
ImageProducer
of the Image
whose pixels
are being filtered. Developers using
this class to filter pixels from an image should avoid calling
this method directly since that operation could interfere
with the filtering operation.
- Specified by:
setPixels
in interface java.awt.image.ImageConsumer
- Overrides:
setPixels
in class java.awt.image.ReplicateScaleFilter
setPixels
public void setPixels(int x,
int y,
int w,
int h,
java.awt.image.ColorModel model,
int[] pixels,
int off,
int scansize)
- This method is where the Scale2x algorithm is applied.
Note: This method is intended to be called by the
ImageProducer
of the Image
whose pixels
are being filtered. Developers using
this class to filter pixels from an image should avoid calling
this method directly since that operation could interfere
with the filtering operation.
- Specified by:
setPixels
in interface java.awt.image.ImageConsumer
- Overrides:
setPixels
in class java.awt.image.ReplicateScaleFilter