22 package com.realtime.crossfire.jxclient.faces;
24 import org.jetbrains.annotations.NotNull;
61 public RawScale2x(@NotNull
final int[] imageData,
final int dataWidth,
final int dataHeight) {
66 dstImage =
new int[imageData.length*4];
76 private static boolean different(
final int a,
final int b) {
87 dstImage[x+y*width*2] = p;
98 final int xx = Math.min(width-1, Math.max(0, x));
99 final int yy = Math.min(height-1, Math.max(0, y));
100 return srcImage[xx+yy*
width];
109 private void process(
final int x,
final int y) {
149 for (
int x = 0; x <
width; x++) {
150 for (
int y = 0; y <
height; y++) {
final int width
The width of the source image.
RawScale2x(@NotNull final int[] imageData, final int dataWidth, final int dataHeight)
Creates a new scaler based on some raw data.
A simple implementation of the Scale2x algorithm for scaling raw image data.
int getSourcePixel(final int x, final int y)
Gets a pixel from the source image.
void process(final int x, final int y)
Processes a specific pixel.
int [] getScaledData()
Gets the scale image data.
final int height
The height of the source image.
void setDestPixel(final int x, final int y, final int p)
Sets a pixel in the destination image data.
final int [] dstImage
The destination image data.
static boolean different(final int a, final int b)
Checks if two pixels are different.
final int [] srcImage
The source image data.