Slay some cyclopian variables.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@927 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Dave Hoover
2010-06-15 17:27:02 +00:00
parent 2efa35a62d
commit 25ee5e9134
16 changed files with 48 additions and 48 deletions
@@ -275,8 +275,8 @@ public class ColorPository implements Serializable
// create the array
ColorRecord[] crecs = new ColorRecord[record.colors.size()];
Iterator<ColorRecord> iter = record.colors.values().iterator();
for (int i = 0; iter.hasNext(); i++) {
crecs[i] = iter.next();
for (int ii = 0; iter.hasNext(); ii++) {
crecs[ii] = iter.next();
}
return crecs;
}
@@ -295,8 +295,8 @@ public class ColorPository implements Serializable
int[] cids = new int[record.colors.size()];
Iterator<ColorRecord> crecs = record.colors.values().iterator();
for (int i = 0; crecs.hasNext(); i++) {
cids[i] = crecs.next().colorId;
for (int ii = 0; crecs.hasNext(); ii++) {
cids[ii] = crecs.next().colorId;
}
return cids;
}
@@ -165,9 +165,9 @@ public class Colorization
if (fhsv == null) {
fhsv = new int[hsv.length];
}
for (int i = 0; i < hsv.length; i++) {
for (int ii = 0; ii < hsv.length; ii++) {
// fhsv[i] = (int)(hsv[i]*Integer.MAX_VALUE);
fhsv[i] = (int)(hsv[i]*Short.MAX_VALUE);
fhsv[ii] = (int)(hsv[ii]*Short.MAX_VALUE);
}
return fhsv;
}
@@ -133,8 +133,8 @@ public class ImageUtil
// convert the colors to HSV
float[] hsv = new float[3];
int[] fhsv = new int[3];
for (int i = 0; i < size; i++) {
int value = rgbs[i];
for (int ii = 0; ii < size; ii++) {
int value = rgbs[ii];
// don't fiddle with alpha pixels
if ((value & 0xFF000000) == 0) {
@@ -154,7 +154,7 @@ public class ImageUtil
Colorization cz = zations[z];
if (cz != null && cz.matches(hsv, fhsv)) {
// massage the HSV bands and update the RGBs array
rgbs[i] = cz.recolorColor(hsv);
rgbs[ii] = cz.recolorColor(hsv);
break;
}
}
@@ -296,13 +296,13 @@ public class Quantize {
static {
SQUARES = new int[MAX_RGB + MAX_RGB + 1];
for (int i= -MAX_RGB; i <= MAX_RGB; i++) {
SQUARES[i + MAX_RGB] = i * i;
for (int ii = -MAX_RGB; ii <= MAX_RGB; ii++) {
SQUARES[ii + MAX_RGB] = ii * ii;
}
SHIFT = new int[MAX_TREE_DEPTH + 1];
for (int i = 0; i < MAX_TREE_DEPTH + 1; ++i) {
SHIFT[i] = 1 << (15 - i);
for (int ii = 0; ii < MAX_TREE_DEPTH + 1; ++ii) {
SHIFT[ii] = 1 << (15 - ii);
}
}
@@ -344,11 +344,11 @@ public class Quantize {
this.pixels = pixels;
this.max_colors = max_colors;
int i = max_colors;
int ii = max_colors;
// tree_depth = log max_colors
// 4
for (depth = 1; i != 0; depth++) {
i /= 4;
for (depth = 1; ii != 0; depth++) {
ii /= 4;
}
if (depth > 1) {
--depth;