| java.lang.Object org.apache.xmlgraphics.ps.PSImageUtils
PSImageUtils | public class PSImageUtils (Code) | | Utility code for rendering images in PostScript.
|
Method Summary | |
public static int[] | getRGB(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. | public static void | paintForm(PSResource form, Rectangle2D targetRect, PSGenerator gen) Paints a reusable image (previously added as a PostScript form). | public static void | paintReusableImage(String formName, Rectangle2D targetRect, PSGenerator gen) Paints a reusable image (previously added as a PostScript form). | public static void | renderBitmapImage(RenderedImage img, float x, float y, float w, float h, PSGenerator gen) Renders a bitmap image to PostScript. | public static void | renderEPS(byte[] rawEPS, 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. | public static void | writeImage(byte[] img, Dimension imgDim, String imgDescription, Rectangle2D targetRect, boolean isJPEG, ColorSpace colorSpace, PSGenerator gen) Writes a bitmap image to the PostScript stream. | public static PSResource | writeReusableImage(byte[] img, Dimension imgDim, String formName, String imageDescription, boolean isJPEG, ColorSpace colorSpace, PSGenerator gen) Writes a bitmap image as a PostScript form enclosed by DSC resource wrappers to the
PostScript file. |
getRGB | public static int[] getRGB(RenderedImage img, int startX, int startY, int w, int h, int[] rgbArray, int offset, int scansize)(Code) | | Extracts a packed RGB integer array of a RenderedImage.
Parameters: img - the image Parameters: startX - the starting X coordinate Parameters: startY - the starting Y coordinate Parameters: w - the width of the cropped image Parameters: h - the height of the cropped image Parameters: rgbArray - the prepared integer array to write to Parameters: offset - offset in the target array Parameters: scansize - width of a row in the target array the populated integer array previously passed in as rgbArray parameter |
paintForm | public static void paintForm(PSResource form, Rectangle2D targetRect, PSGenerator gen) throws IOException(Code) | | Paints a reusable image (previously added as a PostScript form).
Parameters: form - the PostScript form resource implementing the image Parameters: targetRect - the target rectangle to place the image in Parameters: gen - the PostScript generator throws: IOException - In case of an I/O exception |
paintReusableImage | public static void paintReusableImage(String formName, Rectangle2D targetRect, PSGenerator gen) throws IOException(Code) | | Paints a reusable image (previously added as a PostScript form).
Parameters: formName - the name of the PostScript form implementing the image Parameters: targetRect - the target rectangle to place the image in Parameters: gen - the PostScript generator throws: IOException - In case of an I/O exception |
renderBitmapImage | public static void renderBitmapImage(RenderedImage img, float x, float y, float w, float h, PSGenerator gen) throws IOException(Code) | | Renders a bitmap image to PostScript.
Parameters: img - image to render Parameters: x - x position Parameters: y - y position Parameters: w - width Parameters: h - height Parameters: gen - PS generator throws: IOException - In case of an I/O problem while rendering the image |
renderEPS | public static void renderEPS(byte[] rawEPS, String name, float x, float y, float w, float h, float bboxx, float bboxy, float bboxw, float bboxh, PSGenerator gen) throws IOException(Code) | | Places an EPS file in the PostScript stream.
Parameters: rawEPS - byte array containing the raw EPS data Parameters: name - name for the EPS document Parameters: x - x-coordinate of viewport in millipoints Parameters: y - y-coordinate of viewport in millipoints Parameters: w - width of viewport in millipoints Parameters: h - height of viewport in millipoints Parameters: bboxx - x-coordinate of EPS bounding box in points Parameters: bboxy - y-coordinate of EPS bounding box in points Parameters: bboxw - width of EPS bounding box in points Parameters: bboxh - height of EPS bounding box in points Parameters: gen - the PS generator throws: IOException - in case an I/O error happens during output |
writeImage | public static void writeImage(byte[] img, Dimension imgDim, String imgDescription, Rectangle2D targetRect, boolean isJPEG, ColorSpace colorSpace, PSGenerator gen) throws IOException(Code) | | Writes a bitmap image to the PostScript stream.
Parameters: img - the bitmap image as a byte array Parameters: imgDim - the dimensions of the image Parameters: imgDescription - the name of the image Parameters: targetRect - the target rectangle to place the image in Parameters: isJPEG - true if "img" contains a DCT-encoded images, false if "img" contains the decoded bitmap Parameters: colorSpace - the color space of the image Parameters: gen - the PostScript generator throws: IOException - In case of an I/O exception |
writeReusableImage | public static PSResource writeReusableImage(byte[] img, Dimension imgDim, String formName, String imageDescription, boolean isJPEG, ColorSpace colorSpace, PSGenerator gen) throws IOException(Code) | | Writes a bitmap image as a PostScript form enclosed by DSC resource wrappers to the
PostScript file.
Parameters: img - the raw bitmap data Parameters: imgDim - the dimensions of the image Parameters: formName - the name of the PostScript form to use Parameters: imageDescription - a description of the image added as a DSC Title comment Parameters: isJPEG - true if "img" contains a DCT-encoded images, false if "img" contains the decoded bitmap Parameters: colorSpace - the color space of the image Parameters: gen - the PostScript generator a PSResource representing the form for resource tracking throws: IOException - In case of an I/O exception |
|
|