public abstract class AbstractImageAdapter extends Object implements PDFImage
Modifier and Type | Field and Description |
---|---|
protected org.apache.xmlgraphics.image.loader.Image |
image
the image
|
Constructor and Description |
---|
AbstractImageAdapter(org.apache.xmlgraphics.image.loader.Image image,
String key)
Creates a new PDFImage from an Image instance.
|
Modifier and Type | Method and Description |
---|---|
void |
disallowMultipleFilters()
Disallows multiple filters.
|
protected ICC_Profile |
getEffectiveICCProfile()
Returns the effective ICC profile for the image.
|
int |
getHeight()
Get the image height in pixels.
|
PDFICCStream |
getICCStream()
Get the ICC stream for this image.
|
protected ColorSpace |
getImageColorSpace()
Returns the image's color space.
|
String |
getKey()
Key to look up XObject.
|
String |
getMask()
Get the PDF reference for a bitmap mask.
|
String |
getSoftMask() |
PDFReference |
getSoftMaskReference()
Get the PDF reference for a soft mask.
|
PDFColor |
getTransparentColor()
Get the transparent color.
|
int |
getWidth()
Get the image width in pixels.
|
boolean |
isInverted() |
boolean |
isPS()
Check if this image is a PostScript image.
|
protected boolean |
issRGB() |
boolean |
isTransparent()
Check if this image has a transparent color transparency.
|
boolean |
multipleFiltersAllowed()
Indicates whether multiple image filters are allowed; this is implemented because Adobe
Reader does not like multiple FlateDecode filters applied to an image even though that
allowed by the PDF spec; this is probable due to security concerns since many PDF malware
exploits, like zip bombs, make use of a chain of FlateDecode filters.
|
void |
populateXObjectDictionary(PDFDictionary dict)
Populates the XObject's dictionary with additional values.
|
protected void |
populateXObjectDictionaryForIndexColorModel(PDFDictionary dict,
IndexColorModel icm)
This is to be used by populateXObjectDictionary() when the image is palette based.
|
void |
setup(PDFDocument doc)
Setup the PDF image for the current document.
|
static PDFDeviceColorSpace |
toPDFColorSpace(ColorSpace cs)
Converts a ColorSpace object to a PDFColorSpace object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBitsPerComponent, getColorSpace, getFilterHint, getPDFFilter, outputContents
public AbstractImageAdapter(org.apache.xmlgraphics.image.loader.Image image, String key)
image
- the imagekey
- XObject keypublic String getKey()
protected ColorSpace getImageColorSpace()
public void setup(PDFDocument doc)
protected ICC_Profile getEffectiveICCProfile()
protected boolean issRGB()
public int getWidth()
public int getHeight()
public boolean isTransparent()
PDFImageXObject
rely on this simple
binary model of transparency (e.g. compare to
Transparency
) 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.isTransparent
in interface PDFImage
public PDFColor getTransparentColor()
getTransparentColor
in interface PDFImage
public String getMask()
public String getSoftMask()
public PDFReference getSoftMaskReference()
getSoftMaskReference
in interface PDFImage
public boolean isInverted()
isInverted
in interface PDFImage
public boolean isPS()
public PDFICCStream getICCStream()
getICCStream
in interface PDFImage
public void populateXObjectDictionary(PDFDictionary dict)
populateXObjectDictionary
in interface PDFImage
dict
- the dictionary to fillprotected void populateXObjectDictionaryForIndexColorModel(PDFDictionary dict, IndexColorModel icm)
dict
- the dictionary to fill inicm
- the image color modelpublic static PDFDeviceColorSpace toPDFColorSpace(ColorSpace cs)
cs
- ColorSpace instancepublic boolean multipleFiltersAllowed()
multipleFiltersAllowed
in interface PDFImage
public void disallowMultipleFilters()
Copyright © 2025 Apache Software Foundation. All rights reserved.