org.eclipse.actf.visualization.util
Class ImageOverlayUtil

java.lang.Object
  extended by org.eclipse.actf.visualization.util.ImageOverlayUtil

public class ImageOverlayUtil
extends Object

Utility class to create overlay image


Field Summary
static org.eclipse.swt.graphics.PaletteData PALETTE
          24 bit direct palette used for overlay.
 
Constructor Summary
ImageOverlayUtil()
           
 
Method Summary
static boolean overlay(org.eclipse.swt.graphics.Image base, org.eclipse.swt.graphics.Image overlay)
          Overlay image onto base image.
static boolean overlay(org.eclipse.swt.graphics.Image base, int[][] pixels, int alpha)
          Overlay pixels onto base image.
static boolean overlay(org.eclipse.swt.graphics.Image base, int width, int[] pixels, int alpha)
          Overlay pixels onto base image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PALETTE

public static final org.eclipse.swt.graphics.PaletteData PALETTE
24 bit direct palette used for overlay. Pixels will divide into 3 portions, red in the lowest 8 bits, green in the central 8 bits and blue in the highest 8 bits. For example, pixel value 0xFF is red, 0xFF00 is green, 0xFF0000 is blue.

Constructor Detail

ImageOverlayUtil

public ImageOverlayUtil()
Method Detail

overlay

public static boolean overlay(org.eclipse.swt.graphics.Image base,
                              org.eclipse.swt.graphics.Image overlay)
Overlay image onto base image.

Parameters:
base - the target image to add overlay
overlay - the overlay image. alpha value of the Image should be set in advance.
Returns:
whether overlay succeeded or not

overlay

public static boolean overlay(org.eclipse.swt.graphics.Image base,
                              int[][] pixels,
                              int alpha)
Overlay pixels onto base image. An alpha value of 255 is full weight, and 0 is no weight (transparent).

Parameters:
base - the target image to add overlay
pixels - the pixel data array of the overlay image in [y][x] format
alpha - the global alpha value to be used for every pixel
Returns:
whether overlay succeeded or not
See Also:
to understand how to specify pixel value

overlay

public static boolean overlay(org.eclipse.swt.graphics.Image base,
                              int width,
                              int[] pixels,
                              int alpha)
Overlay pixels onto base image. An alpha value of 255 is full weight, and 0 is no weight (transparent).

Parameters:
base - the target image to add overlay
width - the width of the overlay image
pixels - the pixel data array of the overlay image
alpha - the global alpha value to be used for every pixel
Returns:
whether overlay succeeded or not
See Also:
to understand how to specify pixel value