|
xmlgraphics-commons 1.5 | |||||||||
| 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(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,
Dimension2D formDimensions,
Rectangle2D targetRect,
PSGenerator gen)
Paints a reusable image (previously added as a PostScript form). |
static void |
paintForm(PSResource form,
Rectangle2D targetRect,
PSGenerator gen)
Deprecated. Please use paintForm(PSResource, Dimension2D, Rectangle2D, PSGenerator)
instead. |
static void |
paintReusableImage(String formName,
Rectangle2D targetRect,
PSGenerator gen)
Deprecated. Please use paintForm(PSResource, Dimension2D, Rectangle2D, PSGenerator)
instead. |
static void |
renderBitmapImage(RenderedImage img,
float x,
float y,
float w,
float h,
PSGenerator gen)
Renders a bitmap image to PostScript. |
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)
Deprecated. Please use the variant with the InputStream as parameter |
static void |
renderEPS(InputStream in,
String name,
Rectangle2D viewport,
Rectangle2D bbox,
PSGenerator gen)
Places an EPS file in the PostScript stream. |
static void |
translateAndScale(PSGenerator gen,
Dimension2D imageDimensions,
Rectangle2D targetRect)
Generates commands to modify the current transformation matrix so an image fits into a given rectangle. |
static void |
writeImage(byte[] img,
Dimension imgDim,
String imgDescription,
Rectangle2D targetRect,
boolean isJPEG,
ColorSpace colorSpace,
PSGenerator gen)
Deprecated. Please use the variant with the more versatile ImageEncoder as parameter |
static void |
writeImage(ImageEncoder encoder,
Dimension imgDim,
String imgDescription,
Rectangle2D targetRect,
ColorModel colorModel,
PSGenerator gen)
Writes a bitmap image to the PostScript stream. |
static void |
writeImage(ImageEncoder encoder,
Dimension imgDim,
String imgDescription,
Rectangle2D targetRect,
ColorSpace colorSpace,
int bitsPerComponent,
boolean invertImage,
PSGenerator gen)
Writes a bitmap image to the PostScript stream. |
static PSResource |
writeReusableImage(byte[] img,
Dimension imgDim,
String formName,
String imageDescription,
boolean isJPEG,
ColorSpace colorSpace,
PSGenerator gen)
Deprecated. Please use FormGenerator |
protected static PSResource |
writeReusableImage(ImageEncoder encoder,
Dimension imgDim,
String formName,
String imageDescription,
ColorSpace colorSpace,
boolean invertImage,
PSGenerator gen)
Deprecated. Please use FormGenerator |
| 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,
Dimension imgDim,
String imgDescription,
Rectangle2D targetRect,
boolean isJPEG,
ColorSpace colorSpace,
PSGenerator gen)
throws 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
IOException - In case of an I/O exception
public static void writeImage(ImageEncoder encoder,
Dimension imgDim,
String imgDescription,
Rectangle2D targetRect,
ColorSpace colorSpace,
int bitsPerComponent,
boolean invertImage,
PSGenerator gen)
throws IOException
encoder - the image encoderimgDim - the dimensions of the imageimgDescription - the name of the imagetargetRect - the target rectangle to place the image incolorSpace - the color space of the imagebitsPerComponent - the number of bits per componentinvertImage - true if the image shall be invertedgen - the PostScript generator
IOException - In case of an I/O exception
public static void writeImage(ImageEncoder encoder,
Dimension imgDim,
String imgDescription,
Rectangle2D targetRect,
ColorModel colorModel,
PSGenerator gen)
throws IOException
encoder - the image encoderimgDim - the dimensions of the imageimgDescription - the name of the imagetargetRect - the target rectangle to place the image incolorModel - the color model of the imagegen - the PostScript generator
IOException - In case of an I/O exception
public static void renderBitmapImage(RenderedImage img,
float x,
float y,
float w,
float h,
PSGenerator gen)
throws IOException
img - image to renderx - x positiony - y positionw - widthh - heightgen - PS generator
IOException - In case of an I/O problem while rendering the image
public static PSResource writeReusableImage(byte[] img,
Dimension imgDim,
String formName,
String imageDescription,
boolean isJPEG,
ColorSpace colorSpace,
PSGenerator gen)
throws IOException
FormGenerator
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
IOException - In case of an I/O exception
protected static PSResource writeReusableImage(ImageEncoder encoder,
Dimension imgDim,
String formName,
String imageDescription,
ColorSpace colorSpace,
boolean invertImage,
PSGenerator gen)
throws IOException
FormGenerator
encoder - the ImageEncoder that will provide 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 commentcolorSpace - the color space of the imageinvertImage - true if the image shall be invertedgen - the PostScript generator
IOException - In case of an I/O exception
public static void paintReusableImage(String formName,
Rectangle2D targetRect,
PSGenerator gen)
throws IOException
paintForm(PSResource, Dimension2D, Rectangle2D, PSGenerator)
instead.
formName - the name of the PostScript form implementing the imagetargetRect - the target rectangle to place the image ingen - the PostScript generator
IOException - In case of an I/O exception
public static void paintForm(PSResource form,
Rectangle2D targetRect,
PSGenerator gen)
throws IOException
paintForm(PSResource, Dimension2D, Rectangle2D, PSGenerator)
instead.
form - the PostScript form resource implementing the imagetargetRect - the target rectangle to place the image ingen - the PostScript generator
IOException - In case of an I/O exception
public static void paintForm(PSResource form,
Dimension2D formDimensions,
Rectangle2D targetRect,
PSGenerator gen)
throws IOException
form - the PostScript form resource implementing the imageformDimensions - the original dimensions of the formtargetRect - the target rectangle to place the image ingen - the PostScript generator
IOException - In case of an I/O exception
public static void translateAndScale(PSGenerator gen,
Dimension2D imageDimensions,
Rectangle2D targetRect)
throws IOException
gen - the PostScript generatorimageDimensions - the image's dimensionstargetRect - the target rectangle
IOException - if an I/O error occurs
public static int[] getRGB(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,
String name,
float x,
float y,
float w,
float h,
float bboxx,
float bboxy,
float bboxw,
float bboxh,
PSGenerator gen)
throws IOException
rawEPS - byte array containing the raw EPS dataname - name for the EPS documentx - x-coordinate of viewport in pointsy - y-coordinate of viewport in pointsw - width of viewport in pointsh - height of viewport in pointsbboxx - 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
IOException - in case an I/O error happens during output
public static void renderEPS(InputStream in,
String name,
Rectangle2D viewport,
Rectangle2D bbox,
PSGenerator gen)
throws IOException
in - the InputStream that contains the EPS streamname - name for the EPS documentviewport - the viewport in points in which to place the EPSbbox - the EPS bounding box in pointsgen - the PS generator
IOException - in case an I/O error happens during output
|
xmlgraphics-commons 1.5 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||