setImage(pimage);
}
else
{
}
GrayIntegerImage image = (GrayIntegerImage)pimage;
int[] buffer = new int[width];
for (int y = 0, destY = -getBoundsY1(); destY < getBoundsHeight(); y++, destY++)
{
if (getAscii().booleanValue())
{
for (int x = 0; x < width; x++)
{
buffer[x] = loadAsciiNumber();
}
}
else
{
if (maxSample < 256)
{
for (int x = 0; x < width; x++)
{
buffer[x] = in.read();
}
}
else
{
for (int x = 0; x < width; x++)
{
int msb = in.read();
int lsb = in.read();
buffer[x] = (msb << 8) | lsb;
}
}
}
if (destY >= 0 && destY < getBoundsHeight())
{
image.putSamples(0, 0, destY, getBoundsWidth(), 1, buffer, getBoundsX1());
}
setProgress(y, getBoundsY2() + 1);
}
}