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

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

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

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

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

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

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

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

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

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

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

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

      private byte[][] icc
  • Constructor Details

  • Method Details

    • getShort

      private static final 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 final 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.
      Throws:
      BadElementException - on error
      IOException - on error