smithers.extras
Class BltComposite

java.lang.Object
  extended by smithers.extras.BltComposite
All Implemented Interfaces:
java.awt.Composite

public class BltComposite
extends java.lang.Object
implements java.awt.Composite

Implementation of the Composite interface which provides the 16 standard blting operations.


Field Summary
static int OP_AND
          Operation constant for src & dst.
static int OP_AND_NOT
          Operation constant for src & ~dst.
static int OP_CLEAR
          Operation constant for 0 (clear).
static int OP_COPY
          Operation constant for src.
static int OP_EQUIV
          Operation constant for ~(src ^ dst).
static int OP_NAND
          Operation constant for ~(src & dst).
static int OP_NOOP
          Operation constant for dst.
static int OP_NOR
          Operation constant for ~(src | dst).
static int OP_NOT
          Operation constant for ~dst.
static int OP_NOT_AND
          Operation constant for ~src & dst.
static int OP_NOT_COPY
          Operation constant for ~src.
static int OP_NOT_OR
          Operation constant for ~src | dst.
static int OP_OR
          Operation constant for src | dst.
static int OP_OR_NOT
          Operation constant for src | ~dst.
static int OP_SET
          Operation constant for 1 (set).
static int OP_XOR
          Operation constant for src ^ dst.
 
Constructor Summary
BltComposite(int op, int bandMask)
          Creates a new BltComposite with a given operation.
 
Method Summary
 java.awt.CompositeContext createContext(java.awt.image.ColorModel srcColorModel, java.awt.image.ColorModel dstColorModel, java.awt.RenderingHints hints)
          Creates a context for compositing.
static void main(java.lang.String[] args)
          Tester.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OP_CLEAR

public static int OP_CLEAR
Operation constant for 0 (clear).


OP_AND

public static int OP_AND
Operation constant for src & dst.


OP_AND_NOT

public static int OP_AND_NOT
Operation constant for src & ~dst.


OP_COPY

public static int OP_COPY
Operation constant for src.


OP_NOT_AND

public static int OP_NOT_AND
Operation constant for ~src & dst.


OP_NOOP

public static int OP_NOOP
Operation constant for dst.


OP_XOR

public static int OP_XOR
Operation constant for src ^ dst.


OP_OR

public static int OP_OR
Operation constant for src | dst.


OP_NOR

public static int OP_NOR
Operation constant for ~(src | dst).


OP_EQUIV

public static int OP_EQUIV
Operation constant for ~(src ^ dst).


OP_NOT

public static int OP_NOT
Operation constant for ~dst.


OP_OR_NOT

public static int OP_OR_NOT
Operation constant for src | ~dst.


OP_NOT_COPY

public static int OP_NOT_COPY
Operation constant for ~src.


OP_NOT_OR

public static int OP_NOT_OR
Operation constant for ~src | dst.


OP_NAND

public static int OP_NAND
Operation constant for ~(src & dst).


OP_SET

public static int OP_SET
Operation constant for 1 (set).

Constructor Detail

BltComposite

public BltComposite(int op,
                    int bandMask)
Creates a new BltComposite with a given operation.

Parameters:
op - the operation to perform
bandMask - the band mask to apply (unmasked bands will remain unchanged in the destination image)
Method Detail

createContext

public java.awt.CompositeContext createContext(java.awt.image.ColorModel srcColorModel,
                                               java.awt.image.ColorModel dstColorModel,
                                               java.awt.RenderingHints hints)
Creates a context for compositing.

Specified by:
createContext in interface java.awt.Composite
Parameters:
srcColorModel - ignored
dstColorModel - ignored
hints - ignored
Returns:
a new context

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Tester. Loads one image file from args[0] and another from args[1] and copies the former over the latter using each operation of this class. Saves the results as "0.png" to "15.png".

Parameters:
args - the arguments
Throws:
java.io.IOException