java.lang.Object com.realtime.crossfire.jxclient.faces.RawScale2x
public class RawScale2x
A simple implementation of the Scale2x algorithm for scaling raw image data.
Field Summary | |
---|---|
private int[] |
dstImage
The destination image data. |
private int |
height
The height of the source image. |
private int[] |
srcImage
The source image data. |
private int |
width
The width of the source image. |
Constructor Summary | |
---|---|
RawScale2x(int[] imageData,
int dataWidth,
int dataHeight)
Creates a new scaler based on some raw data. |
Method Summary | |
---|---|
private static boolean |
different(int a,
int b)
Checks if two pixels are different. |
int[] |
getScaledData()
Gets the scale image data. |
private int |
getSourcePixel(int x,
int y)
Gets a pixel from the source image. |
private void |
process(int x,
int y)
Processes a specific pixel. |
private void |
setDestPixel(int x,
int y,
int p)
Sets a pixel in the destination image data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private final int[] dstImage
private final int height
@NotNull private final int[] srcImage
private final int width
Constructor Detail |
---|
public RawScale2x(@NotNull int[] imageData, int dataWidth, int dataHeight)
imageData
- the source image datadataWidth
- the width of the source imagedataHeight
- the height of the source imageMethod Detail |
---|
private static boolean different(int a, int b)
a
- the first pixel valueb
- the second pixel value
true
if the pixels are different@NotNull public int[] getScaledData()
private int getSourcePixel(int x, int y)
x
- the x location of the pixel to retrievey
- the y location of the pixel to retrieve
private void process(int x, int y)
x
- the x location in the source image of the pixel to processy
- the y location in the source image of the pixel to processprivate void setDestPixel(int x, int y, int p)
x
- the x location of the pixel to sety
- the y location of the pixel to setp
- the value of the pixel to set