org.apache.xmlgraphics.image.loader.impl

## Class ImageRawJPEG

- java.lang.Object
- - org.apache.xmlgraphics.image.loader.impl.AbstractImage
  - - org.apache.xmlgraphics.image.loader.impl.ImageRawStream
    - - org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG

- All Implemented Interfaces:
    Image

      public class ImageRawJPEG
      extends ImageRawStream

  This class is an implementation of the Image interface exposing a JPEG file. It provides an InputStream to access the JPEG content and some additional information on the image.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.xmlgraphics.image.loader.impl.ImageRawStream

      `ImageRawStream.ByteArrayStreamFactory, ImageRawStream.InputStreamFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ImageRawJPEG(ImageInfo info, java.io.InputStream in, int sofType, java.awt.color.ColorSpace colorSpace, java.awt.color.ICC_Profile iccProfile, boolean invertImage)` Main constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.awt.color.ColorSpace` | `getColorSpace()` Returns the image's color space
    `java.awt.color.ICC_Profile` | `getICCProfile()` Returns the ICC color profile if one is associated with the JPEG image.
    `int` | `getSOFType()` Returns the SOFn identifier of the image which describes the coding format of the image.
    `boolean` | `isInverted()` Indicates whether the image should be inverted when interpreting it.

    - ### Methods inherited from class org.apache.xmlgraphics.image.loader.impl.ImageRawStream

      `createInputStream, getFlavor, getMimeType, isCacheable, setInputStreamFactory, writeTo`

    - ### Methods inherited from class org.apache.xmlgraphics.image.loader.impl.AbstractImage

      `getInfo, getSize, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ImageRawJPEG

          public ImageRawJPEG(ImageInfo info,
                              java.io.InputStream in,
                              int sofType,
                              java.awt.color.ColorSpace colorSpace,
                              java.awt.color.ICC_Profile iccProfile,
                              boolean invertImage)

      Main constructor.
      Parameters:
        `info` - the image info object
        `in` - the ImageInputStream with the raw content
        `sofType` - the SOFn identifier
        `colorSpace` - the color space
        `iccProfile` - an ICC color profile or null if no profile is associated
        `invertImage` - true if the image should be inverted when painting it

  - ### Method Detail

    - #### getSOFType

          public int getSOFType()

      Returns the SOFn identifier of the image which describes the coding format of the image.
      Returns:
        the SOFn identifier

    - #### getICCProfile

          public java.awt.color.ICC_Profile getICCProfile()

      Returns the ICC color profile if one is associated with the JPEG image.
      Specified by:
        `getICCProfile` in interface `Image`
      Overrides:
        `getICCProfile` in class `AbstractImage`
      Returns:
        the ICC color profile or null if there's no profile

    - #### isInverted

          public boolean isInverted()

      Indicates whether the image should be inverted when interpreting it.
      Returns:
        true if the image is to be inverted

    - #### getColorSpace

          public java.awt.color.ColorSpace getColorSpace()

      Returns the image's color space
      Specified by:
        `getColorSpace` in interface `Image`
      Overrides:
        `getColorSpace` in class `AbstractImage`
      Returns:
        the color space

Copyright 1999-2025 The Apache Software Foundation. All Rights Reserved.