Exemple #1
0
 /**
 * returns an Image representing the given page.
 * @param ra    the file or array containing the image
 * @param page  the page number of the image
 * @return  an Image object
 */
 public static Image GetJbig2Image(RandomAccessFileOrArray ra, int page) {
     if (page < 1)
         throw new ArgumentException(MessageLocalization.GetComposedMessage("the.page.number.must.be.gt.eq.1"));
     
     JBIG2SegmentReader sr = new JBIG2SegmentReader(ra);
     sr.Read();
     JBIG2SegmentReader.JBIG2Page p = sr.GetPage(page);
     Image img = new ImgJBIG2(p.pageBitmapWidth, p.pageBitmapHeight, p.GetData(true), sr.GetGlobal(true));
     return img;
 }
Exemple #2
0
 /**
 * Creates a JBIG2 Image.
 * @param   width   the width of the image
 * @param   height  the height of the image
 * @param   data    the raw image data
 * @param   globals JBIG2 globals
 * @since   2.1.5
 */
 public static Image GetInstance(int width, int height, byte[] data, byte[] globals) {
     Image img = new ImgJBIG2(width, height, data, globals);
     return img;
 }
Exemple #3
0
        /**
        * returns an Image representing the given page.
        * @param ra    the file or array containing the image
        * @param page  the page number of the image
        * @return  an Image object
        */
        public static Image GetJbig2Image(RandomAccessFileOrArray ra, int page)
        {
            if (page < 1)
                throw new ArgumentException("The page number must be >= 1.");

            JBIG2SegmentReader sr = new JBIG2SegmentReader(ra);
            sr.Read();
            JBIG2SegmentReader.JBIG2Page p = sr.GetPage(page);
            Image img = new ImgJBIG2(p.pageBitmapWidth, p.pageBitmapHeight, p.GetData(true), sr.GetGlobal(true));
            return img;
        }