Class JBIG2ImageReader
java.lang.Object
javax.imageio.ImageReader
org.apache.pdfbox.jbig2.JBIG2ImageReader
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JBIG2DocumentJBIG2 document to which we delegate current work.private JBIG2GlobalsGlobals are JBIG2 segments for PDF wide use.Fields inherited from class ImageReader
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprivate JBIG2ReadParamgetDefaultReadParam(int imageIndex) Returns a default ImageReadParam object for a specific page.private JBIG2DocumentReturns decoded segments that has been set as globals.intgetHeight(int imageIndex) Calculates the height of the specified page.getImageMetadata(int imageIndex) Simply returns theJBIG2ImageMetadata.getImageTypes(int imageIndex) Returns the iterator for available image types.intgetNumImages(boolean allowSearch) private JBIG2PagegetPage(int imageIndex) This ImageIO plugin doesn't recordIIOMetadata.intgetWidth(int imageIndex) Calculates the width of the specified page.processGlobals(ImageInputStream globalsInputStream) Decodes and returns the global segments.read(int imageIndex, ImageReadParam param) Returns the decoded image of specified page considering the givenJBIG2ReadParams.readRaster(int imageIndex, ImageReadParam param) voidsetGlobals(JBIG2Globals globals) Simply sets the globals.voidMethods inherited from class ImageReader
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, checkReadParamBandSettings, clearAbortRequest, computeRegions, dispose, getAspectRatio, getAvailableLocales, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, reset, setInput, setInput, setLocale
-
Field Details
-
document
JBIG2 document to which we delegate current work. -
globals
Globals are JBIG2 segments for PDF wide use.
-
-
Constructor Details
-
JBIG2ImageReader
- Parameters:
originatingProvider- - TheImageReaderSpithat is invoking this constructor, ornull.- Throws:
IOException- if something went wrong while reading the provided stream.- See Also:
-
-
Method Details
-
getDefaultReadParam
- Overrides:
getDefaultReadParamin classImageReader- See Also:
-
getDefaultReadParam
Returns a default ImageReadParam object for a specific page.- Parameters:
imageIndex- - The page number.- Returns:
-
getWidth
Calculates the width of the specified page.- Specified by:
getWidthin classImageReader- Parameters:
imageIndex- - The image index. In this case it is the page number.- Returns:
- The width of the specified page.
- Throws:
IOException- if an error occurs reading the width information from the input source.
-
getHeight
Calculates the height of the specified page.- Specified by:
getHeightin classImageReader- Parameters:
imageIndex- - The image index. In this case it is the page number.- Returns:
- The height of the specified page or
0if an error occurred. - Throws:
IOException- if an error occurs reading the height information from the input source.
-
getImageMetadata
Simply returns theJBIG2ImageMetadata.- Specified by:
getImageMetadatain classImageReader- Returns:
- The associated
JBIG2ImageMetadata. - Throws:
IOException- if an error occurs reading the height information from the input source.
-
getImageTypes
Returns the iterator for available image types.- Specified by:
getImageTypesin classImageReader- Parameters:
imageIndex- - The page number.- Returns:
- An
Iteratorfor available image types. - Throws:
IOException- if an error occurs reading the height information from the input source.
-
getNumImages
- Specified by:
getNumImagesin classImageReader- Throws:
IOException- See Also:
-
getStreamMetadata
This ImageIO plugin doesn't recordIIOMetadata.- Specified by:
getStreamMetadatain classImageReader- Returns:
nullat every call.
-
getGlobals
Returns decoded segments that has been set as globals. Globals are jbig2 segments that are used in embedded case for file wide access. They are not assigned to a specific page.- Returns:
- Decoded global segments.
- Throws:
IOException- if an error occurs reading the height information from the input source.
-
read
Returns the decoded image of specified page considering the givenJBIG2ReadParams.- Specified by:
readin classImageReader- Throws:
IOException- See Also:
-
canReadRaster
public boolean canReadRaster()- Overrides:
canReadRasterin classImageReader
-
readRaster
- Overrides:
readRasterin classImageReader- Throws:
IOException
-
processGlobals
Decodes and returns the global segments.- Parameters:
globalsInputStream- - The input stream of globals data.- Returns:
- The decoded
JBIG2Globals. - Throws:
IOException- if an error occurs reading the height information from the input source.
-
setGlobals
Simply sets the globals.- Parameters:
globals- - The globals to set.- Throws:
IOException- if an error occurs
-
setInput
- Overrides:
setInputin classImageReader- See Also:
-
getDocument
- Throws:
IOException
-
getPage
- Throws:
IOException
-