Crossfire JXClient, Trunk
R20561
|
A simple implementation of the Scale2x algorithm for scaling raw image data. More...
Public Member Functions | |
int [] | getScaledData () |
Gets the scale image data. More... | |
RawScale2x (@NotNull final int[] imageData, final int dataWidth, final int dataHeight) | |
Creates a new scaler based on some raw data. More... | |
Private Member Functions | |
int | getSourcePixel (final int x, final int y) |
Gets a pixel from the source image. More... | |
void | process (final int x, final int y) |
Processes a specific pixel. More... | |
void | setDestPixel (final int x, final int y, final int p) |
Sets a pixel in the destination image data. More... | |
Static Private Member Functions | |
static boolean | different (final int a, final int b) |
Checks if two pixels are different. More... | |
Private Attributes | |
final int [] | dstImage |
The destination image data. More... | |
final int | height |
The height of the source image. More... | |
final int [] | srcImage |
The source image data. More... | |
final int | width |
The width of the source image. More... | |
A simple implementation of the Scale2x algorithm for scaling raw image data.
Definition at line 30 of file RawScale2x.java.
com.realtime.crossfire.jxclient.faces.RawScale2x.RawScale2x | ( | @NotNull final int [] | imageData, |
final int | dataWidth, | ||
final int | dataHeight | ||
) |
Creates a new scaler based on some raw data.
Right now it doesn't matter what order the channels in, just that its an int per pixel
imageData | the source image data |
dataWidth | the width of the source image |
dataHeight | the height of the source image |
Definition at line 61 of file RawScale2x.java.
|
staticprivate |
Checks if two pixels are different.
Place holder for maybe some clever code about tolerance checking.
a | the first pixel value |
b | the second pixel value |
Definition at line 76 of file RawScale2x.java.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.process().
int [] com.realtime.crossfire.jxclient.faces.RawScale2x.getScaledData | ( | ) |
Gets the scale image data.
Note this is the method that does the work so it might take some time to process.
Definition at line 148 of file RawScale2x.java.
References com.realtime.crossfire.jxclient.faces.RawScale2x.dstImage, com.realtime.crossfire.jxclient.faces.RawScale2x.height, com.realtime.crossfire.jxclient.faces.RawScale2x.process(), and com.realtime.crossfire.jxclient.faces.RawScale2x.width.
Referenced by com.realtime.crossfire.jxclient.faces.ImageScale2x.getScaledImage().
|
private |
Gets a pixel from the source image.
This handles bonds checks and resolves to edge pixels.
x | the x location of the pixel to retrieve |
y | the y location of the pixel to retrieve |
Definition at line 97 of file RawScale2x.java.
References com.realtime.crossfire.jxclient.faces.RawScale2x.width.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.process().
|
private |
Processes a specific pixel.
This will generate 4 pixels in the destination image based on the scale2x algorithm.
x | the x location in the source image of the pixel to process |
y | the y location in the source image of the pixel to process |
Definition at line 109 of file RawScale2x.java.
References com.realtime.crossfire.jxclient.faces.RawScale2x.different(), com.realtime.crossfire.jxclient.faces.RawScale2x.getSourcePixel(), and com.realtime.crossfire.jxclient.faces.RawScale2x.setDestPixel().
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.getScaledData().
|
private |
Sets a pixel in the destination image data.
x | the x location of the pixel to set |
y | the y location of the pixel to set |
p | the value of the pixel to set |
Definition at line 86 of file RawScale2x.java.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.process().
|
private |
The destination image data.
Definition at line 42 of file RawScale2x.java.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.getScaledData().
|
private |
The height of the source image.
Definition at line 52 of file RawScale2x.java.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.getScaledData().
|
private |
The source image data.
Definition at line 36 of file RawScale2x.java.
|
private |
The width of the source image.
Definition at line 47 of file RawScale2x.java.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.getScaledData(), and com.realtime.crossfire.jxclient.faces.RawScale2x.getSourcePixel().