gridSquare(step / 2, 0, step, pixels);
gridSquare(0, step / 2, step, pixels);
- if (step > 2)
+ if (step > 2) {
grid(step / 2, pixels);
+ }
}
public void gridDiagonal(final int offsetX, final int offsetY,
computedRange, computedRangeBitCount);
decodedValue = averageDecodedValue - decodedDifference;
- if (decodedValue > 255)
+ if (decodedValue > 255) {
decodedValue = 255;
- if (decodedValue < 0)
+ }
+ if (decodedValue < 0) {
decodedValue = 0;
+ }
}
} else {
decodedRangeMap[index] = (byte) inheritedRange;
final int colorBufferIndex = index * 3;
int blue = pixels[colorBufferIndex];
- if (blue < 0)
+ if (blue < 0) {
blue = blue + 256;
+ }
int green = pixels[colorBufferIndex + 1];
- if (green < 0)
+ if (green < 0) {
green = green + 256;
+ }
int red = pixels[colorBufferIndex + 2];
- if (red < 0)
+ if (red < 0) {
red = red + 256;
+ }
color.r = red;
color.g = green;
final int decodedDifference = decodeValueFromGivenBits(
bitEncodedDifference, computedRange, computedBitCount);
int decodedValue = averageDecodedValue - decodedDifference;
- if (decodedValue > 255)
+ if (decodedValue > 255) {
decodedValue = 255;
- if (decodedValue < 0)
+ }
+ if (decodedValue < 0) {
decodedValue = 0;
+ }
decodedMap[index] = (byte) decodedValue;
} else {
rangeGridSquare(step / 2, 0, step);
rangeGridSquare(0, step / 2, step);
- if (step > 2)
+ if (step > 2) {
rangeGrid(step / 2);
+ }
}
public void rangeGridDiagonal(final int offsetX, final int offsetY,
rangeRoundGridSquare(step / 2, 0, step);
rangeRoundGridSquare(0, step / 2, step);
- if (step < 1024)
+ if (step < 1024) {
rangeRoundGrid(step * 2);
+ }
}
public void rangeRoundGridDiagonal(final int offsetX, final int offsetY,
saveGridSquare(step / 2, 0, step);
saveGridSquare(0, step / 2, step);
- if (step > 2)
+ if (step > 2) {
saveGrid(step / 2);
+ }
}
public void saveGridDiagonal(final int offsetX, final int offsetY,
public static int byteToInt(final byte input) {
int result = input;
- if (result < 0)
+ if (result < 0) {
result = result + 256;
+ }
return result;
}
int decodedValue = (range * encodedValue)
/ realvalueForThisBitcount;
- if (decodedValue > range)
+ if (decodedValue > range) {
decodedValue = range;
+ }
if (negativeBit == 0) {
return decodedValue;
// still one or more bits left, encode value as precisely as
// possible
- if (value > range)
+ if (value > range) {
value = range;
+ }
final int realvalueForThisBitcount = 1 << remainingBitCount;
// int valueMultiplier = range / realvalueForThisBitcount;
int encodedValue = (value * realvalueForThisBitcount) / range;
- if (encodedValue >= realvalueForThisBitcount)
+ if (encodedValue >= realvalueForThisBitcount) {
encodedValue = realvalueForThisBitcount - 1;
+ }
encodedValue = (encodedValue << 1) + negativeBit;