Package org.jpedal.jbig2
Class JBIG2Decoder
java.lang.Object
org.jpedal.jbig2.JBIG2Decoder
JBIG2Decoder class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecodeJBIG2(byte[] data) Decodes a JBIG2 image from a byte arrayvoiddecodeJBIG2(File file) Decodes a JBIG2 image from a File objectvoiddecodeJBIG2(InputStream inputStream) Decodes a JBIG2 image from an InputStreamvoiddecodeJBIG2(String file) Decodes a JBIG2 image from a String pathfindPageSegement(int page) findPageSegement.findSegment(int segmentNumber) findSegment.getAllSegments.intgetNumberOfPages.getPageAsBufferedImage(int page) getPageAsBufferedImage.getPageAsJBIG2Bitmap(int page) getPageAsJBIG2Bitmap.booleanisNumberOfPagesKnown.booleanisRandomAccessOrganisationUsed.voidsetGlobalData(byte[] data) If the data stream is taken from a PDF, there may be some global data.
-
Constructor Details
-
JBIG2Decoder
public JBIG2Decoder()Constructor
-
-
Method Details
-
setGlobalData
If the data stream is taken from a PDF, there may be some global data. Pass any global data in here. Call this method before decodeJBIG2(...)- Parameters:
data- global data- Throws:
JBIG2Exception- if any.
-
decodeJBIG2
Decodes a JBIG2 image from a File object- Parameters:
file- File to decode- Throws:
IOException- if any.JBIG2Exception- if any.
-
decodeJBIG2
Decodes a JBIG2 image from a String path- Parameters:
file- Must be the full path to the image- Throws:
IOException- if any.JBIG2Exception- if any.
-
decodeJBIG2
Decodes a JBIG2 image from an InputStream- Parameters:
inputStream- InputStream- Throws:
IOException- if any.JBIG2Exception- if any.
-
decodeJBIG2
Decodes a JBIG2 image from a byte array- Parameters:
data- the raw data stream- Throws:
IOException- if any.JBIG2Exception- if any.
-
getPageAsBufferedImage
getPageAsBufferedImage.
- Parameters:
page- aIntegerobject.- Returns:
- a
BufferedImageobject.
-
isNumberOfPagesKnown
public boolean isNumberOfPagesKnown()isNumberOfPagesKnown.
- Returns:
- a boolean.
-
getNumberOfPages
public int getNumberOfPages()getNumberOfPages.
- Returns:
- a
Integerobject.
-
getAllSegments
getAllSegments.
- Returns:
- a
Listobject.
-
findPageSegement
findPageSegement.
- Parameters:
page- aIntegerobject.- Returns:
- a
PageInformationSegmentobject.
-
findSegment
findSegment.
-
getPageAsJBIG2Bitmap
getPageAsJBIG2Bitmap.
- Parameters:
page- aIntegerobject.- Returns:
- a
JBIG2Bitmapobject.
-
isRandomAccessOrganisationUsed
public boolean isRandomAccessOrganisationUsed()isRandomAccessOrganisationUsed.
- Returns:
- a boolean.
-