Class Jpeg

All Implemented Interfaces:
Element

public class Jpeg extends Image
An Jpeg is the representation of a graphic element (JPEG) that has to be inserted into the document
See Also:
  • Field Details

    • NOT_A_MARKER

      public static final int NOT_A_MARKER
      This is a type of marker.
      See Also:
    • VALID_MARKER

      public static final int VALID_MARKER
      This is a type of marker.
      See Also:
    • VALID_MARKERS

      public static final int[] VALID_MARKERS
      Acceptable Jpeg markers.
    • UNSUPPORTED_MARKER

      public static final int UNSUPPORTED_MARKER
      This is a type of marker.
      See Also:
    • UNSUPPORTED_MARKERS

      public static final int[] UNSUPPORTED_MARKERS
      Unsupported Jpeg markers.
    • NOPARAM_MARKER

      public static final int NOPARAM_MARKER
      This is a type of marker.
      See Also:
    • NOPARAM_MARKERS

      public static final int[] NOPARAM_MARKERS
      Jpeg markers without additional parameters.
    • M_APP0

      public static final int M_APP0
      Marker value
      See Also:
    • M_APP2

      public static final int M_APP2
      Marker value
      See Also:
    • M_APPE

      public static final int M_APPE
      Marker value
      See Also:
    • JFIF_ID

      public static final byte[] JFIF_ID
      sequence that is used in all Jpeg files
    • icc

      private byte[][] icc
  • Constructor Details

  • Method Details

    • getShort

      private static int getShort(InputStream is) throws IOException
      Reads a short from the InputStream.
      Parameters:
      is - the InputStream
      Returns:
      an int
      Throws:
      IOException - on error
    • marker

      private static int marker(int marker)
      Returns a type of marker.
      Parameters:
      marker - an int
      Returns:
      a type: VALID_MARKER, UNSUPPORTED_MARKER or NOPARAM_MARKER
    • processParameters

      private void processParameters() throws BadElementException, IOException
      This method checks if the image is a valid JPEG and processes some parameters.

      TODO: Use Apache Commons Imaging to parse these parameters instead.

      Throws:
      BadElementException
      IOException