Class DataInterpreterJpeg


  • final class DataInterpreterJpeg
    extends java.lang.Object
    Provides logic for obtaining image data from a JPEG-encoded TIFF strip or tile (the "block") from the source file.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void intepretBlock​(TiffDirectory directory, ImageBuilder workingBuilder, int xBlock, int yBlock, int blockWidth, int blockHeight, byte[] compressed)
      Interpret the content of a TIFF strip or tile obtained from the source file.
      • Methods inherited from class java.lang.Object

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

      • DataInterpreterJpeg

        DataInterpreterJpeg()
    • Method Detail

      • intepretBlock

        static void intepretBlock​(TiffDirectory directory,
                                  ImageBuilder workingBuilder,
                                  int xBlock,
                                  int yBlock,
                                  int blockWidth,
                                  int blockHeight,
                                  byte[] compressed)
                           throws ImagingException,
                                  java.io.IOException
        Interpret the content of a TIFF strip or tile obtained from the source file. The workingBuilder is an image builder that is configured to receive the extracted data.

        The dimensions of the workingBuilder may or may not be identical to those of the source image. If the calling module is extracting a partial image, the workingBuilder will be sized so that its upper-left corner coordinate (row and column) and width and height are all even multiples of the dimensions of the tile or strip definition from the source. The reason for that approach is to simplify some of the logic in the legacy code by eliminating bounds-checking in the transfer loops.

        Parameters:
        directory - the source directory containing JPEG tables
        workingBuilder - the output image-builder to receive pixels.
        xBlock - column offset of the block within the workingBuilder
        yBlock - row offset of the block within the workingBuilder
        blockWidth - the width of the block (may be smaller than the full width of the JPEG image obtained from the source data)
        blockHeight - the height of the block (may be smaller than the full height of the JPEG image obtained from the source data)
        compressed - the raw bytes from the TIFF source file
        Throws:
        ImagingException - in the event of an unsupported feature or JPEG-specific encoding error
        java.io.IOException - in the event of an unrecoverable I/O error