Package org.apache.fop.svg
Class PDFGraphicsConfiguration
- java.lang.Object
-
- java.awt.GraphicsConfiguration
-
- org.apache.fop.svg.GraphicsConfiguration
-
- org.apache.fop.svg.PDFGraphicsConfiguration
-
class PDFGraphicsConfiguration extends GraphicsConfiguration
Our implementation of the class that returns information about roughly what we can handle and want to see (alpha for example).
-
-
Field Summary
Fields Modifier and Type Field Description private static java.awt.image.BufferedImage
BI_WITH_ALPHA
private static java.awt.image.BufferedImage
BI_WITHOUT_ALPHA
-
Constructor Summary
Constructors Constructor Description PDFGraphicsConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImage
createCompatibleImage(int width, int height)
Construct a buffered image with an alpha channel.java.awt.image.BufferedImage
createCompatibleImage(int width, int height, int transparency)
Construct a buffered image with an alpha channel, unless transparencty is OPAQUE (no alpha at all).java.awt.Rectangle
getBounds()
TODO: This should return the page bounds in Pts, I couldn't figure out how to get this for the current page from the PDFDocument (this still works for now, but it should be fixed...).java.awt.image.ColorModel
getColorModel()
Return a good default color model for this 'device'.java.awt.image.ColorModel
getColorModel(int transparency)
Return a good color model giventransparency
java.awt.geom.AffineTransform
getDefaultTransform()
The default transform (1:1).java.awt.GraphicsDevice
getDevice()
Return our dummy instance of GraphicsDevicejava.awt.geom.AffineTransform
getNormalizingTransform()
The normalizing transform (1:1) (since we currently render images at 72dpi, which we might want to change in the future).-
Methods inherited from class org.apache.fop.svg.GraphicsConfiguration
createCompatibleVolatileImage, createCompatibleVolatileImage
-
-
-
-
Method Detail
-
createCompatibleImage
public java.awt.image.BufferedImage createCompatibleImage(int width, int height, int transparency)
Construct a buffered image with an alpha channel, unless transparencty is OPAQUE (no alpha at all).- Overrides:
createCompatibleImage
in classjava.awt.GraphicsConfiguration
- Parameters:
width
- the width of the imageheight
- the height of the imagetransparency
- the alpha value of the image- Returns:
- the new buffered image
-
createCompatibleImage
public java.awt.image.BufferedImage createCompatibleImage(int width, int height)
Construct a buffered image with an alpha channel.- Overrides:
createCompatibleImage
in classjava.awt.GraphicsConfiguration
- Parameters:
width
- the width of the imageheight
- the height of the image- Returns:
- the new buffered image
-
getBounds
public java.awt.Rectangle getBounds()
TODO: This should return the page bounds in Pts, I couldn't figure out how to get this for the current page from the PDFDocument (this still works for now, but it should be fixed...).- Specified by:
getBounds
in classjava.awt.GraphicsConfiguration
- Returns:
- the bounds of the PDF document page
-
getColorModel
public java.awt.image.ColorModel getColorModel()
Return a good default color model for this 'device'.- Specified by:
getColorModel
in classjava.awt.GraphicsConfiguration
- Returns:
- the colour model for the configuration
-
getColorModel
public java.awt.image.ColorModel getColorModel(int transparency)
Return a good color model giventransparency
- Specified by:
getColorModel
in classjava.awt.GraphicsConfiguration
- Parameters:
transparency
- the alpha value for the colour model- Returns:
- the colour model for the configuration
-
getDefaultTransform
public java.awt.geom.AffineTransform getDefaultTransform()
The default transform (1:1).- Specified by:
getDefaultTransform
in classjava.awt.GraphicsConfiguration
- Returns:
- the default transform for the configuration
-
getNormalizingTransform
public java.awt.geom.AffineTransform getNormalizingTransform()
The normalizing transform (1:1) (since we currently render images at 72dpi, which we might want to change in the future).- Specified by:
getNormalizingTransform
in classjava.awt.GraphicsConfiguration
- Returns:
- the normalizing transform for the configuration
-
getDevice
public java.awt.GraphicsDevice getDevice()
Return our dummy instance of GraphicsDevice- Specified by:
getDevice
in classjava.awt.GraphicsConfiguration
- Returns:
- the PDF graphics device
-
-