diff -r 3e3fb431d2b7 -r 0726c9779524 javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java --- a/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Wed Feb 12 09:14:20 2014 +0100 +++ b/javaquery/canvas/src/main/java/net/java/html/canvas/spi/GraphicsEnvironment.java Wed Feb 12 14:43:38 2014 +0100 @@ -19,6 +19,7 @@ import net.java.html.canvas.Dimension; import net.java.html.canvas.Image; +import net.java.html.canvas.ImageData; import net.java.html.canvas.Style; /** @@ -527,15 +528,51 @@ */ public void strokeText(String text, double x, double y, double maxWidth); -// public ImageData createPixelMap(double x, double y); -// -// public ImageData createPixelMap(ImageData imageData); -// -// public ImageData getPixelMap(double x, double y, double width, double height); -// -// public void putPixelMap(ImageData imageData, double x, double y); -// -// public void putPixelMap(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight); + /** + * Get a pixel array that you can manipulate, e.g. apply effects / transparency + * @param x width + * @param y height + * @return a PixelMap + */ + public ImageData createPixelMap(double x, double y); + + /** + * Create a new ImageData object with the same dimensions as the + * object specified by imageData (this does not copy the image data) + * @param imageData + * @return + */ + public ImageData createPixelMap(ImageData imageData); + + /** + * Get the pixels for a region of your GraphicsContext + * @param x start x coordinate + * @param y start y coordinate + * @param width width + * @param height height + * @return + */ + public ImageData getPixelMap(double x, double y, double width, double height); + + /** + * Render an ImageData Object at the specified position + * @param imageData the Pixel array + * @param x start x coordinate + * @param y start y coordinate + */ + public void putPixelMap(ImageData imageData, double x, double y); + + /** + * Render an ImageData Object at the specified position + * @param imageData the Pixel array to draw + * @param x start x coordinate + * @param y start y coordinate + * @param dirtyx The horizontal (x) value, in pixels, where to place the image on the canvas + * @param dirtyy The vertical (y) value, in pixels, where to place the image on the canvas + * @param dirtywidth The width to use to draw the image on the canvas + * @param dirtyheight The height to use to draw the image on the canvas + */ + public void putPixelMap(ImageData imageData, double x, double y, double dirtyx, double dirtyy, double dirtywidth, double dirtyheight); /** * Sets the global alpha of the current state. *