Class DataInterpreterJpeg

java.lang.Object
org.apache.commons.imaging.formats.tiff.datareaders.DataInterpreterJpeg

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

    • DataInterpreterJpeg

      DataInterpreterJpeg()
  • Method Details

    • intepretBlock

      static void intepretBlock(TiffDirectory directory, ImageBuilder workingBuilder, int xBlock, int yBlock, int blockWidth, int blockHeight, byte[] compressed) throws ImagingException, 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
      IOException - in the event of an unrecoverable I/O error