|
xmlgraphics-commons 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xmlgraphics.ps.PSImageUtils
public class PSImageUtils
Utility code for rendering images in PostScript.
Constructor Summary | |
---|---|
PSImageUtils()
|
Method Summary | |
---|---|
static int[] |
getRGB(java.awt.image.RenderedImage img,
int startX,
int startY,
int w,
int h,
int[] rgbArray,
int offset,
int scansize)
Extracts a packed RGB integer array of a RenderedImage. |
static void |
paintForm(PSResource form,
java.awt.geom.Rectangle2D targetRect,
PSGenerator gen)
Paints a reusable image (previously added as a PostScript form). |
static void |
paintReusableImage(java.lang.String formName,
java.awt.geom.Rectangle2D targetRect,
PSGenerator gen)
Paints a reusable image (previously added as a PostScript form). |
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 imgDescription,
java.awt.geom.Rectangle2D targetRect,
boolean isJPEG,
java.awt.color.ColorSpace colorSpace,
PSGenerator gen)
Writes a bitmap image to the PostScript stream. |
static PSResource |
writeReusableImage(byte[] img,
java.awt.Dimension imgDim,
java.lang.String formName,
java.lang.String imageDescription,
boolean isJPEG,
java.awt.color.ColorSpace colorSpace,
PSGenerator gen)
Writes a bitmap image as a PostScript form enclosed by DSC resource wrappers to the PostScript file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PSImageUtils()
Method Detail |
---|
public static void writeImage(byte[] img, java.awt.Dimension imgDim, java.lang.String imgDescription, java.awt.geom.Rectangle2D targetRect, boolean isJPEG, java.awt.color.ColorSpace colorSpace, PSGenerator gen) throws java.io.IOException
img
- the bitmap image as a byte arrayimgDim
- the dimensions of the imageimgDescription
- 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
java.io.IOException
- In case of an I/O exceptionpublic static PSResource writeReusableImage(byte[] img, java.awt.Dimension imgDim, java.lang.String formName, java.lang.String imageDescription, boolean isJPEG, java.awt.color.ColorSpace colorSpace, PSGenerator gen) throws java.io.IOException
img
- the raw bitmap dataimgDim
- the dimensions of the imageformName
- the name of the PostScript form to useimageDescription
- a description of the image added as a DSC Title commentisJPEG
- true if "img" contains a DCT-encoded images, false if "img" contains the
decoded bitmapcolorSpace
- the color space of the imagegen
- the PostScript generator
java.io.IOException
- In case of an I/O exceptionpublic static void paintReusableImage(java.lang.String formName, java.awt.geom.Rectangle2D targetRect, PSGenerator gen) throws java.io.IOException
formName
- the name of the PostScript form implementing the imagetargetRect
- the target rectangle to place the image ingen
- the PostScript generator
java.io.IOException
- In case of an I/O exceptionpublic static void paintForm(PSResource form, java.awt.geom.Rectangle2D targetRect, PSGenerator gen) throws java.io.IOException
form
- the PostScript form resource implementing the imagetargetRect
- the target rectangle to place the image ingen
- the PostScript generator
java.io.IOException
- In case of an I/O exceptionpublic static void renderBitmapImage(java.awt.image.RenderedImage img, float x, float y, float w, float h, PSGenerator gen) throws java.io.IOException
img
- image to renderx
- x positiony
- y positionw
- widthh
- heightgen
- PS generator
java.io.IOException
- In case of an I/O problem while rendering the imagepublic static int[] getRGB(java.awt.image.RenderedImage img, int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)
img
- the imagestartX
- the starting X coordinatestartY
- the starting Y coordinatew
- the width of the cropped imageh
- the height of the cropped imagergbArray
- the prepared integer array to write tooffset
- offset in the target arrayscansize
- width of a row in the target array
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
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
java.io.IOException
- in case an I/O error happens during output
|
xmlgraphics-commons 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |