public class RawScale8d
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int[] |
dstImage
The destination image data.
|
private int |
height
The height of the source image.
|
private java.util.Map<java.lang.Integer,java.lang.Integer> |
pixels
Maps pixel value to number of pixels.
|
private int[] |
srcImage
The source image data.
|
private int |
width
The width of the source image.
|
Constructor and Description |
---|
RawScale8d(int[] imageData,
int dataWidth,
int dataHeight)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
int[] |
getScaledData()
Returns 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 destination pixel.
|
private void |
setDestPixel(int x,
int y,
int p)
Sets a pixel in the destination image data.
|
@NotNull private final int[] dstImage
private final int height
@NotNull private final java.util.Map<java.lang.Integer,java.lang.Integer> pixels
@NotNull private final int[] srcImage
private final int width
public RawScale8d(@NotNull int[] imageData, int dataWidth, int dataHeight)
imageData
- the source image data to processdataWidth
- the width of the source imagedataHeight
- the height of the source image@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 retrieveprivate 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