Class TIFFUtilities.TIFFPage

  • Enclosing class:
    TIFFUtilities

    public static class TIFFUtilities.TIFFPage
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Directory IFD  
      private javax.imageio.stream.ImageInputStream stream  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TIFFPage​(Directory IFD, javax.imageio.stream.ImageInputStream stream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private long[] getValueAsLongArray​(Entry entry)  
      private boolean jfifContainsTables​(Entry tableEntry, long[] jpegOffsets, long[] jpegLengths)  
      private Entry mergeTables​(Entry qEntry, Entry dcEntry, Entry acEntry)  
      private byte[] readHUFFTable()  
      void rotate​(int degree)
      Rotates the image by changing TIFF.TAG_ORIENTATION.
      private long write​(javax.imageio.stream.ImageOutputStream outputStream, TIFFWriter tiffWriter)  
      private int[] writeData​(long[] offsets, long[] byteCounts, javax.imageio.stream.ImageOutputStream outputStream)  
      private void writeData​(javax.imageio.stream.ImageInputStream input, javax.imageio.stream.ImageOutputStream output, long offset, long length)  
      private java.util.List<Entry> writeDirectoryData​(Directory IFD, javax.imageio.stream.ImageOutputStream outputStream)  
      private void writeSOF0​(javax.imageio.stream.ImageOutputStream outputStream, int bands, int width, int height, int subsampling)  
      private void writeSOS​(javax.imageio.stream.ImageOutputStream outputStream, int bands)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • stream

        private javax.imageio.stream.ImageInputStream stream
    • Constructor Detail

      • TIFFPage

        private TIFFPage​(Directory IFD,
                         javax.imageio.stream.ImageInputStream stream)
    • Method Detail

      • write

        private long write​(javax.imageio.stream.ImageOutputStream outputStream,
                           TIFFWriter tiffWriter)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • writeDirectoryData

        private java.util.List<Entry> writeDirectoryData​(Directory IFD,
                                                         javax.imageio.stream.ImageOutputStream outputStream)
                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • writeSOF0

        private void writeSOF0​(javax.imageio.stream.ImageOutputStream outputStream,
                               int bands,
                               int width,
                               int height,
                               int subsampling)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • writeSOS

        private void writeSOS​(javax.imageio.stream.ImageOutputStream outputStream,
                              int bands)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • writeData

        private void writeData​(javax.imageio.stream.ImageInputStream input,
                               javax.imageio.stream.ImageOutputStream output,
                               long offset,
                               long length)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • jfifContainsTables

        private boolean jfifContainsTables​(Entry tableEntry,
                                           long[] jpegOffsets,
                                           long[] jpegLengths)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • mergeTables

        private Entry mergeTables​(Entry qEntry,
                                  Entry dcEntry,
                                  Entry acEntry)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • readHUFFTable

        private byte[] readHUFFTable()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • writeData

        private int[] writeData​(long[] offsets,
                                long[] byteCounts,
                                javax.imageio.stream.ImageOutputStream outputStream)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getValueAsLongArray

        private long[] getValueAsLongArray​(Entry entry)
                                    throws javax.imageio.IIOException
        Throws:
        javax.imageio.IIOException
      • rotate

        public void rotate​(int degree)
        Rotates the image by changing TIFF.TAG_ORIENTATION.

        NOTICE: TIFF.TAG_ORIENTATION is an advice how the image is meant do be displayed. Other metadata, such as width and height, relate to the image as how it is stored. The ImageIO TIFF plugin does not handle orientation. Use TIFFUtilities.applyOrientation(BufferedImage, int) for applying TIFF.TAG_ORIENTATION.

        Parameters:
        degree - Rotation amount, supports 90�, 180� and 270�.