## com.lowagie.text.pdf.codec
Class TiffImage

    java.lang.Object
      com.lowagie.text.pdf.codec.TiffImage

    public class TiffImage

extends java.lang.Object

Reads TIFF images

Author:
  Paulo Soares (psoares@consiste.pt)

Constructor Summary
`TiffImage()`

Method Summary
`static void` `decodePackbits(byte[] data, byte[] dst)`
`(package private) static long[]` `getArrayLongShort(TIFFDirectory dir, int tag)`
`(package private) static int` `getDpi(TIFFField fd, int resolutionUnit)`
`static int` `getNumberOfPages(RandomAccessFileOrArray s)` Gets the number of pages the TIFF document has.
`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` `getTiffImageColor(TIFFDirectory dir, RandomAccessFileOrArray s)`
`static void` `inflate(byte[] deflated, byte[] inflated)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TiffImage

    public TiffImage()

Method Detail

### getNumberOfPages

    public static int getNumberOfPages(RandomAccessFileOrArray s)

  Gets the number of pages the TIFF document has.

  Parameters:
    `s` - the file source
  Returns:
    the number of pages

### getDpi

    static int getDpi(TIFFField fd,
                      int resolutionUnit)

### getTiffImage

    public static Image getTiffImage(RandomAccessFileOrArray s,
                                     int page)

  Reads a page from a TIFF image. Direct mode is not used.

  Parameters:
    `s` - the file source
    `page` - the page to get. The first page is 1
  Returns:
    the `Image`

### getTiffImage

    public static Image getTiffImage(RandomAccessFileOrArray s,
                                     int page,
                                     boolean direct)

  Reads a page from a TIFF image.

  Parameters:
    `s` - the file source
    `page` - the page to get. The first page is 1
    `direct` - 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

    protected static Image getTiffImageColor(TIFFDirectory dir,
                                             RandomAccessFileOrArray s)

### getArrayLongShort

    static long[] getArrayLongShort(TIFFDirectory dir,
                                    int tag)

### decodePackbits

    public static void decodePackbits(byte[] data,
                                      byte[] dst)

### inflate

    public static void inflate(byte[] deflated,
                               byte[] inflated)

Hosted by Hostbasket