home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 1.9 KB | 64 lines |
- /*
- * @(#)AlphaCompositeContextCLEAR.java 1.4 98/03/18
- *
- * Copyright 1997 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- package java.awt;
-
- import java.awt.image.ColorModel;
-
- /**
- * This interface defines the encapsulated and optimized environment for
- * a compositing operation. CompositeContext objects maintain state for
- * compositing operations. In a multi-threaded environment, several
- * contexts may exist simultaneously for a single Composite object.
- * @see Composite
- * @version 10 Feb 1997
- */
-
- class AlphaCompositeContextCLEAR implements CompositeContext {
-
- int xtrAlph;
- ColorModel dstCM;
-
- protected AlphaCompositeContextCLEAR(ColorModel srcCM,
- ColorModel dstCM,
- float extraAlpha) {
- this.dstCM = dstCM;
- }
-
- /**
- * Release resources allocated for context.
- */
- public void dispose() {
- }
-
- /**
- * This method composes the source tile with the destination tile
- * and places the result in the destination tile.
- * @param src The source tile for the compositing operation.
- * @param dst The second source of the compositing operation and also
- * where the result is placed.
- */
- public void compose(Tile src,
- Tile dst) {
- int color[] = new int[dstCM.getNumComponents()];
-
- for (int i = 0 ; i < dst.getHeight() ; i++) {
- for (int j = 0 ; j < dst.getWidth() ; j++) {
- dst.putData(j, i, color);
- }
- }
- }
-
- }
-