Package org.apache.fop.render.pdf
Class ImageRawPNGAdapter
java.lang.Object
org.apache.fop.render.pdf.AbstractImageAdapter
org.apache.fop.render.pdf.ImageRawPNGAdapter
- All Implemented Interfaces:
PDFImage
-
Field Summary
Fields inherited from class org.apache.fop.render.pdf.AbstractImageAdapter
image -
Constructor Summary
ConstructorsConstructorDescriptionImageRawPNGAdapter(org.apache.xmlgraphics.image.loader.impl.ImageRawPNG 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.getMask()Get the PDF reference for a bitmap mask.Get the PDF Filter to be applied to the image.Get the PDF reference for a soft mask.Get the transparent color.protected booleanissRGB()booleanCheck if this image has a transparent color transparency.voidWrites the raw, unencoded contents of the image to a given output stream.voidPopulates the XObject's dictionary with additional values.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, getWidth, isInverted, isPS, multipleFiltersAllowed, populateXObjectDictionaryForIndexColorModel, toPDFColorSpace
-
Constructor Details
-
ImageRawPNGAdapter
Creates a new PDFImage from an Image instance.- Parameters:
image- the imagekey- XObject key
-
-
Method Details
-
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
-
isTransparent
public boolean isTransparent()Check if this image has a transparent color transparency. Classes such asPDFImageXObjectrely on this simple binary model of transparency (e.g. compare toTransparency) in order to render color key masking (see PDF Spec 1.7 Chapter 8.9.6.4). Therefore only return true if image has fully transparent colors.- Specified by:
isTransparentin interfacePDFImage- Overrides:
isTransparentin classAbstractImageAdapter- Returns:
- true if it has at least one fully transparent color
-
getTransparentColor
Get the transparent color.- Specified by:
getTransparentColorin interfacePDFImage- Overrides:
getTransparentColorin classAbstractImageAdapter- Returns:
- the transparent color for this image
-
getMask
Get the PDF reference for a bitmap mask.- Specified by:
getMaskin interfacePDFImage- Overrides:
getMaskin classAbstractImageAdapter- Returns:
- the PDF reference for the mask image
-
getSoftMask
- Overrides:
getSoftMaskin classAbstractImageAdapter- Returns:
- null (if not overridden)
-
getSoftMaskReference
Get the PDF reference for a soft mask.- Specified by:
getSoftMaskReferencein interfacePDFImage- Overrides:
getSoftMaskReferencein classAbstractImageAdapter- Returns:
- the PDF reference for a soft mask image (or null if there's no soft mask)
-
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
-
populateXObjectDictionary
Description copied from class:AbstractImageAdapterPopulates the XObject's dictionary with additional values. The values are added to the dictionary after all the values obtained from other methods from this interface have been put into the dictionary. That allows to override certain values.- Specified by:
populateXObjectDictionaryin interfacePDFImage- Overrides:
populateXObjectDictionaryin classAbstractImageAdapter- Parameters:
dict- the dictionary to fill
-
issRGB
protected boolean issRGB()- Overrides:
issRGBin classAbstractImageAdapter
-