Raster applet for use with JavaScript

Abstract

Raster applet in raster.jar file provides raster graphics interface to javascript application.

Examples

Download

Entire package with examples and sources is available.

Interface

Several public functions are aveilable to manipulate raster graphics context. Look in examples for implementation.

get_width() and get_height()

Returns the size of the raster applet in pixels.

set_pixel(int x, int y, int red, int green, int blue)

Sets the color of the pixel in RGB notation at position x,y.

Origin is at lower left corner. Color range is [0..255].

Pixel is not immediately updated until call to pixel_update() function is executed.

pixel_update()

Updates entire raster graphics applet. All changes to pixels are performed.

get_red(int x, int y), and get_green(int x, int y) and get_blue(int x, int y)

Returns color components at specified position.

clear()

Sets the graphics context to black.
Author:
Leon Kos