private static void putRGBUAseparate16bittile(
TiffRgbaImage img, int[] raster, int rasterOffset, int rasterShift,
int x, int y, int width, int height,
byte[] buffer, int offset1, int offset2, int offset3, int offset4, int bufferShift)
{
short[] wrgba = Tiff.ByteArrayToShorts(buffer, 0, buffer.Length);
offset1 /= sizeof(short);
offset2 /= sizeof(short);
offset3 /= sizeof(short);
offset4 /= sizeof(short);
while (height-- > 0)
{
for (x = width; x-- > 0; )
{
int a = W2B(wrgba[offset4]);
int r = (W2B(wrgba[offset1]) * a + 127) / 255;
int g = (W2B(wrgba[offset2]) * a + 127) / 255;
int b = (W2B(wrgba[offset3]) * a + 127) / 255;
raster[rasterOffset] = PACK4(r, g, b, a);
rasterOffset++;
offset1++;
offset2++;
offset3++;
offset4++;
}
offset1 += bufferShift;
offset2 += bufferShift;
offset3 += bufferShift;
offset4 += bufferShift;
rasterOffset += rasterShift;
}
}