Package com.itextpdf.text.pdf.codec
Class TiffImage
java.lang.Object
com.itextpdf.text.pdf.codec.TiffImage
Reads TIFF images
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyPredictor
(byte[] uncompData, int predictor, int w, int h, int samplesPerPixel) static void
decodePackbits
(byte[] data, byte[] dst) (package private) static long[]
getArrayLongShort
(TIFFDirectory dir, int tag) (package private) static int
static int
Gets the number of pages the TIFF document has.static Image
getTiffImage
(RandomAccessFileOrArray s, boolean recoverFromImageError, int page) static Image
getTiffImage
(RandomAccessFileOrArray s, boolean recoverFromImageError, int page, boolean direct) static Image
getTiffImage
(RandomAccessFileOrArray s, int page) Reads a page from a TIFF image.static Image
getTiffImage
(RandomAccessFileOrArray s, int page, boolean direct) Reads a page from a TIFF image.protected static Image
static void
inflate
(byte[] deflated, byte[] inflated) (package private) static Image
ProcessExtraSamples
(DeflaterOutputStream zip, DeflaterOutputStream mzip, byte[] outBuf, int samplePerPixel, int bitsPerSample, int width, int height)
-
Constructor Details
-
TiffImage
public TiffImage()
-
-
Method Details
-
getNumberOfPages
Gets the number of pages the TIFF document has.- Parameters:
s
- the file source- Returns:
- the number of pages
-
getDpi
-
getTiffImage
public static Image getTiffImage(RandomAccessFileOrArray s, boolean recoverFromImageError, int page, boolean direct) -
getTiffImage
public static Image getTiffImage(RandomAccessFileOrArray s, boolean recoverFromImageError, int page) -
getTiffImage
Reads a page from a TIFF image. Direct mode is not used.- Parameters:
s
- the file sourcepage
- the page to get. The first page is 1- Returns:
- the
Image
-
getTiffImage
Reads a page from a TIFF image.- Parameters:
s
- the file sourcepage
- the page to get. The first page is 1direct
- for single strip, CCITT images, generate the image by direct byte copying. It's faster but may not work every time- Returns:
- the
Image
-
getTiffImageColor
-
ProcessExtraSamples
static Image ProcessExtraSamples(DeflaterOutputStream zip, DeflaterOutputStream mzip, byte[] outBuf, int samplePerPixel, int bitsPerSample, int width, int height) throws IOException - Throws:
IOException
-
getArrayLongShort
-
decodePackbits
public static void decodePackbits(byte[] data, byte[] dst) -
inflate
public static void inflate(byte[] deflated, byte[] inflated) -
applyPredictor
public static void applyPredictor(byte[] uncompData, int predictor, int w, int h, int samplesPerPixel)
-