iTextSharp.text.pdf.parser.InlineImageUtils.ComputeBytesPerRow C# (CSharp) Method

ComputeBytesPerRow() private static method

private static ComputeBytesPerRow ( PdfDictionary imageDictionary, PdfDictionary colorSpaceDic ) : int
imageDictionary iTextSharp.text.pdf.PdfDictionary
colorSpaceDic iTextSharp.text.pdf.PdfDictionary
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;
        }