Class JBIG2ImageReader
java.lang.Object
javax.imageio.ImageReader
org.apache.pdfbox.jbig2.JBIG2ImageReader
-
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) getImageMetadata(int imageIndex) getImageTypes(int imageIndex) intgetNumImages(boolean allowSearch) private JBIG2PagegetPage(int imageIndex) Return the page.This ImageIO plugin doesn't recordIIOMetadata.intgetWidth(int imageIndex) processGlobals(ImageInputStream globalsInputStream) Decodes and returns the global segments.read(int imageIndex, ImageReadParam param) 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
- Throws:
IOException- if something went wrong while reading the provided stream.
-
-
Method Details
-
getDefaultReadParam
- Overrides:
getDefaultReadParamin classImageReader
-
getDefaultReadParam
Returns a default ImageReadParam object for a specific page.- Parameters:
imageIndex- - The page number.- Returns:
-
getWidth
- Specified by:
getWidthin classImageReader- Throws:
IOException
-
getHeight
- Specified by:
getHeightin classImageReader- Throws:
IOException
-
getImageMetadata
- Specified by:
getImageMetadatain classImageReader- Throws:
IOException
-
getImageTypes
- Specified by:
getImageTypesin classImageReader- Throws:
IOException
-
getNumImages
- Specified by:
getNumImagesin classImageReader- Throws:
IOException
-
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
- Specified by:
readin classImageReader- Throws:
IOException
-
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
-
getDocument
- Throws:
IOException
-
getPage
Return the page.- Parameters:
imageIndex- 0 based page index.- Returns:
- The page.
- Throws:
IOException- if the input wasn't set.IndexOutOfBoundsException- if the page doesn't exist at that index.
-