org.apache.xmlgraphics.ps
Class PSImageUtils
java.lang.Object
|
+--org.apache.xmlgraphics.ps.PSImageUtils
- public class PSImageUtils
- extends java.lang.Object
Utility code for rendering images in PostScript.
Method Summary |
static int[] |
getRGB(java.awt.image.RenderedImage img,
int startX,
int startY,
int w,
int h,
int[] rgbArray,
int offset,
int scansize)
|
static void |
renderBitmapImage(java.awt.image.RenderedImage img,
float x,
float y,
float w,
float h,
PSGenerator gen)
Renders a bitmap image to PostScript. |
static void |
renderEPS(byte[] rawEPS,
java.lang.String name,
float x,
float y,
float w,
float h,
float bboxx,
float bboxy,
float bboxw,
float bboxh,
PSGenerator gen)
Places an EPS file in the PostScript stream. |
static void |
writeImage(byte[] img,
java.awt.Dimension imgDim,
java.lang.String imgName,
java.awt.geom.Rectangle2D targetRect,
boolean isJPEG,
java.awt.color.ColorSpace colorSpace,
PSGenerator gen)
Writes a bitmap image to the PostScript stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PSImageUtils
public PSImageUtils()
writeImage
public static void writeImage(byte[] img,
java.awt.Dimension imgDim,
java.lang.String imgName,
java.awt.geom.Rectangle2D targetRect,
boolean isJPEG,
java.awt.color.ColorSpace colorSpace,
PSGenerator gen)
throws java.io.IOException
- Writes a bitmap image to the PostScript stream.
- Parameters:
img
- the bitmap image as a byte arrayimgDim
- the dimensions of the imageimgName
- the name of the imagetargetRect
- the target rectangle to place the image inisJPEG
- true if "img" contains a DCT-encoded images, false if "img" contains the
decoded bitmapcolorSpace
- the color space of the imagegen
- the PostScript generator- Throws:
java.io.IOException
- In case of an I/O exception
renderBitmapImage
public static void renderBitmapImage(java.awt.image.RenderedImage img,
float x,
float y,
float w,
float h,
PSGenerator gen)
throws java.io.IOException
- Renders a bitmap image to PostScript.
- Parameters:
img
- image to renderx
- x positiony
- y positionw
- widthh
- heightgen
- PS generator- Throws:
java.io.IOException
- In case of an I/O problem while rendering the image
getRGB
public static int[] getRGB(java.awt.image.RenderedImage img,
int startX,
int startY,
int w,
int h,
int[] rgbArray,
int offset,
int scansize)
renderEPS
public static void renderEPS(byte[] rawEPS,
java.lang.String name,
float x,
float y,
float w,
float h,
float bboxx,
float bboxy,
float bboxw,
float bboxh,
PSGenerator gen)
throws java.io.IOException
- Places an EPS file in the PostScript stream.
- Parameters:
rawEPS
- byte array containing the raw EPS dataname
- name for the EPS documentx
- x-coordinate of viewport in millipointsy
- y-coordinate of viewport in millipointsw
- width of viewport in millipointsh
- height of viewport in millipointsbboxx
- x-coordinate of EPS bounding box in pointsbboxy
- y-coordinate of EPS bounding box in pointsbboxw
- width of EPS bounding box in pointsbboxh
- height of EPS bounding box in pointsgen
- the PS generator- Throws:
java.io.IOException
- in case an I/O error happens during output
Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.