1. /*
  2. * @(#)CompositeContext.java 1.25 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt;
  8. import java.awt.image.Raster;
  9. import java.awt.image.WritableRaster;
  10. /**
  11. * The <code>CompositeContext</code> interface defines the encapsulated
  12. * and optimized environment for a compositing operation.
  13. * <code>CompositeContext</code> objects maintain state for
  14. * compositing operations. In a multi-threaded environment, several
  15. * contexts can exist simultaneously for a single {@link Composite}
  16. * object.
  17. * @see Composite
  18. * @version 10 Feb 1997
  19. */
  20. public interface CompositeContext {
  21. /**
  22. * Releases resources allocated for a context.
  23. */
  24. public void dispose();
  25. /**
  26. * Composes the two source {@link Raster} objects and
  27. * places the result in the destination
  28. * {@link WritableRaster}. Note that the destination
  29. * can be the same object as either the first or second
  30. * source. Note that <code>dstIn</code> and
  31. * <code>dstOut</code> must be compatible with the
  32. * <code>dstColorModel</code> passed to the
  33. * {@link Composite#createContext(java.awt.image.ColorModel, java.awt.image.ColorModel, java.awt.RenderingHints) createContext}
  34. * method of the <code>Composite</code> interface.
  35. * @param src the first source for the compositing operation
  36. * @param dstIn the second source for the compositing operation
  37. * @param dstOut the <code>WritableRaster</code> into which the
  38. * result of the operation is stored
  39. * @see Composite
  40. */
  41. public void compose(Raster src,
  42. Raster dstIn,
  43. WritableRaster dstOut);
  44. }