home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 5.8 KB | 180 lines |
- /*
- * @(#)RenderedImage.java 1.11 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.
- */
-
- /* ****************************************************************
- ******************************************************************
- ******************************************************************
- *** COPYRIGHT (c) Eastman Kodak Company, 1997
- *** As an unpublished work pursuant to Title 17 of the United
- *** States Code. All rights reserved.
- ******************************************************************
- ******************************************************************
- ******************************************************************/
-
- package java.awt.image;
- import java.awt.Rectangle;
- import java.util.Dictionary;
- import java.util.Vector;
-
- /**
- * A RenderedImage is a common interface for objects which contain
- * or can produce image data in the form of Rasters.
- */
-
- public interface RenderedImage {
-
- /**
- * Return a vector of RenderedImages that are the sources of
- * image data for this RenderedImage. This method may return null.
- */
- Vector getSources();
-
- /**
- * Get a property from the property set of this image. The set of
- * properties is determined at construction time and is immutable.
- */
- Object getProperty(String name);
-
- /**
- * Return a list of names recognized by getProperty(String).
- */
- String[] getPropertyNames();
-
- /**
- * Return the ColorModel associated with this image. All Rasters returned
- * from this image will have this as their ColorModel.
- */
- ColorModel getColorModel();
-
- /**
- * Return the SampleModel associated with this image. All Rasters returned
- * from this image will have this as their SampleModel.
- */
- SampleModel getSampleModel();
-
- /**
- * Return the width of the RenderedImage. Equivalent to
- * getMaxXCoord() - getMinXCoord() + 1.
- */
- int getWidth();
-
- /**
- * Return the height of the RenderedImage. Equivalent to
- * getMaxYCoord() - getMinYCoord() + 1.
- */
- int getHeight();
-
- /**
- * Return the minimum X coordinate (inclusive) of the rendered image.
- * For an image with infinite extent, it could be Integer.MIN_VALUE.
- */
- int getMinXCoord();
-
- /**
- * Return the maximum X coordinate (inclusive) of the rendered image.
- * For an image with infinite extent, it could be Integer.MAX_VALUE.
- */
- int getMaxXCoord();
-
- /**
- * Return the minimum Y coordinate (inclusive) of the rendered image.
- * For an image with infinite extent, it could be Integer.MIN_VALUE.
- */
- int getMinYCoord();
-
- /**
- * Return the minimum Y coordinate (inclusive) of the rendered image.
- * For an image with infinite extent, it could be Integer.MAX_VALUE.
- */
- int getMaxYCoord();
-
- /**
- * Return the number of tiles across the image. Equivalent to
- * getMaxTileX() - getMinTileX() + 1.
- */
- int tilesAcross();
-
- /**
- * Return the number of tiles down the image. Equivalent to
- * getMaxTileY() - getMinTileY() + 1.
- */
- int tilesDown();
-
- /** Return the index of the minimum tile in the X direction. */
- int getMinTileX();
-
- /** Return the index of the maximum tile in the X direction. */
- int getMaxTileX();
-
- /** Return the index of the minimum tile in the Y direction. */
- int getMinTileY();
-
- /** Return the index of the maximum tile in the Y direction. */
- int getMaxTileY();
-
- /** Return the tile width in pixels. All tiles must have the same width. */
- int getTileWidth();
-
- /** Return the tile height in pixels. All tiles must have the same height. */
- int getTileHeight();
-
- /**
- * Return the X offset of the tile grid relative to the origin,
- * i.e., the X coordinate of the upper-left pixel of tile (0, 0).
- */
- int getTileGridXOffset();
-
- /**
- * Return the Y offset of the tile grid relative to the origin,
- * i.e., the Y coordinate of the upper-left pixel of tile (0, 0).
- */
- int getTileGridYOffset();
-
- /**
- * Return tile (X, Y). Note that X and Y are indices into the
- * tile array, not pixel locations. The Raster that is returned
- * is live and will be updated if the image is changed.
- * @param x the X index of the requested tile in the tile array.
- * @param y the Y index of the requested tile in the tile array.
- */
- Raster getTile(int x, int y);
-
- /**
- * Return the image as one large tile (for tile based
- * images this will require fetching the whole image
- * and copying the image data over). The Raster returned is
- * semantically a copy.
- */
- Raster getData();
-
- /**
- * Compute and return an arbitrary region of the RenderedImage.
- * Note that in general this may involve copying image data.
- * The Raster returned is semantically a copy.
- * @param rect the region of the RenderedImage to be returned.
- */
- Raster getRect(Rectangle rect);
-
- /**
- * Compute an arbitrary rectangular region of the RenderedImage
- * and copy it into a caller-supplied WritableRaster. The region
- * to be computed is determined from the bounds of the supplied
- * WritableRaster. The supplied WritableRaster must have a ColorModel
- * and SampleModel that are compatible with those of this image.
- * @param raster a WritableRaster to hold the returned portion of the image.
- * @return a reference to the supplied WritableRaster.
- */
- WritableRaster getRect(WritableRaster raster);
- }
-