 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.faces;
25 import java.util.HashMap;
27 import java.util.Map.Entry;
28 import org.jetbrains.annotations.NotNull;
60 private final Map<Integer, Integer>
pixels =
new HashMap<>();
68 public RawScale8d(
final int @NotNull [] imageData,
final int dataWidth,
final int dataHeight) {
73 dstImage =
new int[imageData.length*4];
101 private void process(
final int x,
final int y) {
103 for (
int dx = 0; dx < 8; dx++) {
104 for (
int dy = 0; dy < 8; dy++) {
107 final Integer count =
pixels.get(value);
108 pixels.put(value, count ==
null ? 1 : count+1);
114 for (Entry<Integer, Integer> e :
pixels.entrySet()) {
115 final int thisCount = e.getValue();
116 if (thisCount > maxCount) {
117 maxCount = thisCount;
118 maxPixel = e.getKey();
133 for (
int x = 0; x <
width/8; x++) {
134 for (
int y = 0; y <
height/8; y++) {
int[] getScaledData()
Returns the scale image data.
final int[] srcImage
The source image data.
RawScale8d(final int @NotNull[] imageData, final int dataWidth, final int dataHeight)
Creates a new instance.
final int height
The height of the source image.
final int width
The width of the source image.
void process(final int x, final int y)
Processes a specific destination pixel.
final int[] dstImage
The destination image data.
Scales down a raw image to an eighth in both dimensions.
void setDestPixel(final int x, final int y, final int p)
Sets a pixel in the destination image data.
final Map< Integer, Integer > pixels
Maps pixel value to number of pixels.
int getSourcePixel(final int x, final int y)
Gets a pixel from the source image.