Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.fop.render.pdf
Class ImageRawJPEGAdapter

    java.lang.Object
      org.apache.fop.render.pdf.AbstractImageAdapter
          org.apache.fop.render.pdf.ImageRawJPEGAdapter

All Implemented Interfaces:
  PDFImage

    public class ImageRawJPEGAdapter

extends AbstractImageAdapter

PDFImage implementation for the PDF renderer which handles raw JPEG images.

The JPEG is copied to the XObject's stream as-is but some elements (marker segments) are filtered. For example, an embedded color profile is filtered since it is already added as a PDF object and associated with the XObject. This way, the PDF file size is kept as small as possible.

Field Summary

Fields inherited from class org.apache.fop.render.pdf.AbstractImageAdapter
`image`

Constructor Summary
`ImageRawJPEGAdapter(org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG image, java.lang.String key)` Creates a new PDFImage from an Image instance.

Method Summary
`int` | `getBitsPerComponent()` Get the bits per color component for this image.
`PDFDeviceColorSpace` | `getColorSpace()` Get the color space for this image.
`java.lang.String` | `getFilterHint()` Returns a hint in form of a String (Possible values from PDFFilterList) indicating which filter setup should be used to encode the object.
`org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG` | `getImage()` Returns the `ImageRawJPEG` instance for this adapter.
`PDFFilter` | `getPDFFilter()` Get the PDF Filter to be applied to the image.
`boolean` | `isInverted()`
`void` | `outputContents(java.io.OutputStream out)` Writes the raw, unencoded contents of the image to a given output stream.
`void` | `setup(PDFDocument doc)` Setup the PDF image for the current document.

Methods inherited from class org.apache.fop.render.pdf.AbstractImageAdapter
`disallowMultipleFilters, getEffectiveICCProfile, getHeight, getICCStream, getImageColorSpace, getKey, getMask, getSoftMask, getSoftMaskReference, getTransparentColor, getWidth, isPS, isTransparent, multipleFiltersAllowed, populateXObjectDictionary, populateXObjectDictionaryForIndexColorModel, toPDFColorSpace`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ImageRawJPEGAdapter

    public ImageRawJPEGAdapter(org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG image,
                               java.lang.String key)

  Creates a new PDFImage from an Image instance.

  Parameters:
    `image` - the JPEG image
    `key` - XObject key

Method Detail

### getImage

    public org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG getImage()

  Returns the `ImageRawJPEG` instance for this adapter.

  Returns:
    the image instance

### setup

    public void setup(PDFDocument doc)

  Setup the PDF image for the current document. Some image formats may need to access the document (for example to add an ICC profile to the document).

  Specified by:
    `setup` in interface `PDFImage`
  Overrides:
    `setup` in class `AbstractImageAdapter`
  Parameters:
    `doc` - the PDF parent document (todo) Remove this and delegate to the XObject

### getColorSpace

    public PDFDeviceColorSpace getColorSpace()

  Get the color space for this image. Possible results are: DeviceGray, DeviceRGB, or DeviceCMYK

  Returns:
    the color space

### getBitsPerComponent

    public int getBitsPerComponent()

  Get the bits per color component for this image.

  Returns:
    the bits per component

### isInverted

    public boolean isInverted()

  Description copied from class: `AbstractImageAdapter`

  Specified by:
    `isInverted` in interface `PDFImage`
  Overrides:
    `isInverted` in class `AbstractImageAdapter`
  Returns:
    true for CMYK images generated by Adobe Photoshop

### getPDFFilter

    public PDFFilter getPDFFilter()

  Get the PDF Filter to be applied to the image.

  Returns:
    the PDF Filter or null

### outputContents

    public void outputContents(java.io.OutputStream out)
                        throws java.io.IOException

  Writes the raw, unencoded contents of the image to a given output stream.

  Parameters:
    `out` - OutputStream to write to
  Throws:
    `java.io.IOException` - if there creating stream

### getFilterHint

    public java.lang.String getFilterHint()

  Returns a hint in form of a String (Possible values from PDFFilterList) indicating which filter setup should be used to encode the object.

  Returns:
    the filter setup hint

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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