int numComponents = colorMaskArray.length;
if (alphaMask != 0) numComponents++;
int[] bitsPerComponent = new int[numComponents];
BitMaskExtent extent = new BitMaskExtent();
for (int b=0; b<colorMaskArray.length; b++)
{
extent.setMask(colorMaskArray[b]);
bitsPerComponent[b] = extent.bitWidth;
}
if (alphaMask != 0)
{
extent.setMask(alphaMask);
bitsPerComponent[numComponents-1] = extent.bitWidth;
}
return bitsPerComponent;
}