private static ComputeBytesPerRow ( |
||
imageDictionary | ||
colorSpaceDic | ||
return | int |
private static int ComputeBytesPerRow(PdfDictionary imageDictionary, PdfDictionary colorSpaceDic)
{
PdfNumber wObj = imageDictionary.GetAsNumber(PdfName.WIDTH);
PdfNumber bpcObj = imageDictionary.GetAsNumber(PdfName.BITSPERCOMPONENT);
int cpp = GetComponentsPerPixel(imageDictionary.GetAsName(PdfName.COLORSPACE), colorSpaceDic);
int w = wObj.IntValue;
int bpc = bpcObj != null ? bpcObj.IntValue : 1;
int bytesPerRow = (w * bpc * cpp + 7) / 8;
return bytesPerRow;
}