Methods Summary |
---|
void | addRLERun(byte val, int runLen)
reallocRowAARLE(alphaRLELength + 2);
rowAARLE[alphaRLELength++] = val;
rowAARLE[alphaRLELength++] = (byte)runLen;
|
void | addRow(int minX, int offset)
reallocRowInfo(alphaHeight + 1);
minTouched[alphaHeight] = minX;
rowOffsetsRLE[alphaHeight] = offset;
++alphaHeight;
|
public static com.sun.pisces.PiscesCache | createInstance()
return new PiscesCache();
|
public synchronized void | dispose()
alphaWidth = alphaHeight = 0;
rowAARLE = null;
alphaRLELength = 0;
minTouched = null;
rowOffsetsRLE = null;
isValid = false;
|
public synchronized boolean | isValid()
return isValid;
|
private void | reallocRowAARLE(int newLength)
if (rowAARLE == null) {
rowAARLE = new byte[newLength];
} else if (rowAARLE.length < newLength) {
int len = Math.max(newLength,
(int)(rowAARLE.length*ROWAA_RLE_FACTOR));
byte[] newRowAARLE = new byte[len];
System.arraycopy(rowAARLE, 0, newRowAARLE, 0, rowAARLE.length);
rowAARLE = newRowAARLE;
}
|
private void | reallocRowInfo(int newHeight)
if (minTouched == null) {
int len = Math.max(newHeight, MIN_TOUCHED_LEN);
minTouched = new int[len];
rowOffsetsRLE = new int[len];
} else if (minTouched.length < newHeight) {
int len = Math.max(newHeight,
(int)(minTouched.length*TOUCHED_FACTOR));
int[] newMinTouched = new int[len];
int[] newRowOffsetsRLE = new int[len];
System.arraycopy(minTouched, 0, newMinTouched, 0,
minTouched.length);
System.arraycopy(rowOffsetsRLE, 0, newRowOffsetsRLE, 0,
rowOffsetsRLE.length);
minTouched = newMinTouched;
rowOffsetsRLE = newRowOffsetsRLE;
}
|