public class ImageRenderedAdapter extends AbstractImageAdapter
image
Constructor and Description |
---|
ImageRenderedAdapter(org.apache.xmlgraphics.image.loader.impl.ImageRendered image,
String key)
Creates a new PDFImage from an Image instance.
|
Modifier and Type | Method and Description |
---|---|
int |
getBitsPerComponent()
Get the bits per color component for this image.
|
PDFDeviceColorSpace |
getColorSpace()
Get the color space for this image.
|
protected ICC_Profile |
getEffectiveICCProfile()
Returns the effective ICC profile for the image.
|
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.
|
int |
getHeight()
Get the image height in pixels.
|
org.apache.xmlgraphics.image.loader.impl.ImageRendered |
getImage()
Returns the ImageRendered instance for this adapter.
|
protected ColorSpace |
getImageColorSpace()
Returns the image's color space.
|
String |
getMask()
Get the PDF reference for a bitmap mask.
|
PDFFilter |
getPDFFilter()
Get the PDF Filter to be applied to the image.
|
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 |
isTransparent()
Check if this image has a transparent color transparency.
|
void |
outputContents(OutputStream out)
Writes the raw, unencoded contents of the image to a given output stream.
|
void |
populateXObjectDictionary(PDFDictionary dict)
Populates the XObject's dictionary with additional values.
|
void |
setup(PDFDocument doc)
Setup the PDF image for the current document.
|
disallowMultipleFilters, getICCStream, getKey, getSoftMask, isInverted, isPS, issRGB, multipleFiltersAllowed, populateXObjectDictionaryForIndexColorModel, toPDFColorSpace
public ImageRenderedAdapter(org.apache.xmlgraphics.image.loader.impl.ImageRendered image, String key)
image
- the imagekey
- XObject keypublic org.apache.xmlgraphics.image.loader.impl.ImageRendered getImage()
public int getWidth()
getWidth
in interface PDFImage
getWidth
in class AbstractImageAdapter
public int getHeight()
getHeight
in interface PDFImage
getHeight
in class AbstractImageAdapter
protected ColorSpace getImageColorSpace()
getImageColorSpace
in class AbstractImageAdapter
protected ICC_Profile getEffectiveICCProfile()
getEffectiveICCProfile
in class AbstractImageAdapter
public void setup(PDFDocument doc)
setup
in interface PDFImage
setup
in class AbstractImageAdapter
doc
- the PDF parent document
(todo) Remove this and delegate to the XObjectpublic PDFDeviceColorSpace getColorSpace()
public int getBitsPerComponent()
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
isTransparent
in class AbstractImageAdapter
public PDFColor getTransparentColor()
getTransparentColor
in interface PDFImage
getTransparentColor
in class AbstractImageAdapter
public String getMask()
getMask
in interface PDFImage
getMask
in class AbstractImageAdapter
public PDFReference getSoftMaskReference()
getSoftMaskReference
in interface PDFImage
getSoftMaskReference
in class AbstractImageAdapter
public PDFFilter getPDFFilter()
public void outputContents(OutputStream out) throws IOException
out
- OutputStream to write toIOException
- if there creating streampublic void populateXObjectDictionary(PDFDictionary dict)
populateXObjectDictionary
in interface PDFImage
populateXObjectDictionary
in class AbstractImageAdapter
dict
- the dictionary to fillpublic String getFilterHint()
Copyright © 2025 Apache Software Foundation. All rights reserved.