1.1 --- a/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Wed Feb 12 09:14:20 2014 +0100
1.2 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Wed Feb 12 14:43:38 2014 +0100
1.3 @@ -19,6 +19,7 @@
1.4
1.5 import net.java.html.canvas.Dimension;
1.6 import net.java.html.canvas.Image;
1.7 +import net.java.html.canvas.ImageData;
1.8 import net.java.html.canvas.Style;
1.9
1.10 /**
1.11 @@ -527,15 +528,51 @@
1.12 */
1.13 public void strokeText(String text, double x, double y, double maxWidth);
1.14
1.15 -// public ImageData createPixelMap(double x, double y);
1.16 -//
1.17 -// public ImageData createPixelMap(ImageData imageData);
1.18 -//
1.19 -// public ImageData getPixelMap(double x, double y, double width, double height);
1.20 -//
1.21 -// public void putPixelMap(ImageData imageData, double x, double y);
1.22 -//
1.23 -// public void putPixelMap(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
1.24 + /**
1.25 + * Get a pixel array that you can manipulate, e.g. apply effects / transparency
1.26 + * @param x width
1.27 + * @param y height
1.28 + * @return a PixelMap
1.29 + */
1.30 + public ImageData createPixelMap(double x, double y);
1.31 +
1.32 + /**
1.33 + * Create a new ImageData object with the same dimensions as the
1.34 + * object specified by imageData (this does not copy the image data)
1.35 + * @param imageData
1.36 + * @return
1.37 + */
1.38 + public ImageData createPixelMap(ImageData imageData);
1.39 +
1.40 + /**
1.41 + * Get the pixels for a region of your GraphicsContext
1.42 + * @param x start x coordinate
1.43 + * @param y start y coordinate
1.44 + * @param width width
1.45 + * @param height height
1.46 + * @return
1.47 + */
1.48 + public ImageData getPixelMap(double x, double y, double width, double height);
1.49 +
1.50 + /**
1.51 + * Render an ImageData Object at the specified position
1.52 + * @param imageData the Pixel array
1.53 + * @param x start x coordinate
1.54 + * @param y start y coordinate
1.55 + */
1.56 + public void putPixelMap(ImageData imageData, double x, double y);
1.57 +
1.58 + /**
1.59 + * Render an ImageData Object at the specified position
1.60 + * @param imageData the Pixel array to draw
1.61 + * @param x start x coordinate
1.62 + * @param y start y coordinate
1.63 + * @param dirtyx The horizontal (x) value, in pixels, where to place the image on the canvas
1.64 + * @param dirtyy The vertical (y) value, in pixels, where to place the image on the canvas
1.65 + * @param dirtywidth The width to use to draw the image on the canvas
1.66 + * @param dirtyheight The height to use to draw the image on the canvas
1.67 + */
1.68 + public void putPixelMap(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight);
1.69 /**
1.70 * Sets the global alpha of the current state.
1.71 *