![]() |
Crossfire JXClient, Trunk
|
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 (final int @NotNull[] 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 31 of file RawScale2x.java.
com.realtime.crossfire.jxclient.faces.RawScale2x.RawScale2x | ( | final int @NotNull[] | 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 have, just that it's 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 60 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.srcImage, and com.realtime.crossfire.jxclient.faces.RawScale2x.width.
|
staticprivate |
Checks if two pixels are different.
Placeholder for maybe some clever code about tolerance checking.
a | the first pixel value |
b | the second pixel value |
Definition at line 75 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 146 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 96 of file RawScale2x.java.
References com.realtime.crossfire.jxclient.faces.RawScale2x.height, com.realtime.crossfire.jxclient.faces.RawScale2x.srcImage, and 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 108 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 85 of file RawScale2x.java.
References com.realtime.crossfire.jxclient.faces.RawScale2x.dstImage, and com.realtime.crossfire.jxclient.faces.RawScale2x.width.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.process().
|
private |
The destination image data.
Definition at line 41 of file RawScale2x.java.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.getScaledData(), com.realtime.crossfire.jxclient.faces.RawScale2x.RawScale2x(), and com.realtime.crossfire.jxclient.faces.RawScale2x.setDestPixel().
|
private |
The height of the source image.
Definition at line 51 of file RawScale2x.java.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.getScaledData(), com.realtime.crossfire.jxclient.faces.RawScale2x.getSourcePixel(), and com.realtime.crossfire.jxclient.faces.RawScale2x.RawScale2x().
|
private |
The source image data.
Definition at line 36 of file RawScale2x.java.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.getSourcePixel(), and com.realtime.crossfire.jxclient.faces.RawScale2x.RawScale2x().
|
private |
The width of the source image.
Definition at line 46 of file RawScale2x.java.
Referenced by com.realtime.crossfire.jxclient.faces.RawScale2x.getScaledData(), com.realtime.crossfire.jxclient.faces.RawScale2x.getSourcePixel(), com.realtime.crossfire.jxclient.faces.RawScale2x.RawScale2x(), and com.realtime.crossfire.jxclient.faces.RawScale2x.setDestPixel().