Package 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
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
ConstructorsConstructorDescriptionImageRawJPEGAdapter(org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG image, String key) Creates a new PDFImage from an Image instance. -
Method Summary
Modifier and TypeMethodDescriptionintGet the bits per color component for this image.Get the color space for this image.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.ImageRawJPEGgetImage()Returns theImageRawJPEGinstance for this adapter.Get the PDF Filter to be applied to the image.booleanvoidWrites the raw, unencoded contents of the image to a given output stream.voidsetup(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, issRGB, isTransparent, multipleFiltersAllowed, populateXObjectDictionary, populateXObjectDictionaryForIndexColorModel, toPDFColorSpace
-
Constructor Details
-
ImageRawJPEGAdapter
Creates a new PDFImage from an Image instance.- Parameters:
image- the JPEG imagekey- XObject key
-
-
Method Details
-
getImage
public org.apache.xmlgraphics.image.loader.impl.ImageRawJPEG getImage()Returns theImageRawJPEGinstance for this adapter.- Returns:
- the image instance
-
setup
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:
setupin interfacePDFImage- Overrides:
setupin classAbstractImageAdapter- Parameters:
doc- the PDF parent document (todo) Remove this and delegate to the XObject
-
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:
isInvertedin interfacePDFImage- Overrides:
isInvertedin classAbstractImageAdapter- Returns:
- true for CMYK images generated by Adobe Photoshop
-
getPDFFilter
Get the PDF Filter to be applied to the image.- Returns:
- the PDF Filter or null
-
outputContents
Writes the raw, unencoded contents of the image to a given output stream.- Parameters:
out- OutputStream to write to- Throws:
IOException- if there creating stream
-
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
-