| java.lang.Object javax.media.jai.PlanarImage ca.forklabs.media.jai.RasterAdapter
RasterAdapter | public class RasterAdapter extends PlanarImage (Code) | | Class
RasterAdapter is a
PlanarImage adapter over a
WritableRaster . The resulting image has only one tile and the
ImageLayout information, except for the
ColorModel that is
taken directly from the raster.
author: Daniel Léonard version: $Revision: 1.3 $ |
Constructor Summary | |
public | RasterAdapter(WritableRaster raster) Constructor. |
Method Summary | |
public static RasterAdapter | buildByteImage(byte[][] pixels, int cols, int rows) Builds an image from byte data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. | public static RasterAdapter | buildDoubleImage(double[][] pixels, int cols, int rows) Builds an image from double data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. | public static RasterAdapter | buildFloatImage(float[][] pixels, int cols, int rows) Builds an image from float data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. | public static RasterAdapter | buildImage(DataBuffer buffer, int cols, int rows) Builds an image from a
DataBuffer .
Parameters: buffer - the data buffer. Parameters: cols - the number of columns. Parameters: rows - the number of rows. | public static RasterAdapter | buildIntImage(int[][] pixels, int cols, int rows) Builds an image from int data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. | public static RasterAdapter | buildShortImage(short[][] pixels, int cols, int rows) Builds an image from short data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. | public static RasterAdapter | buildUShortImage(short[][] pixels, int cols, int rows) Builds an image from unsigned short data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. | protected static String | getBadTileErrorMessage(int x, int y) Gets the formatted error message for a request to an inexistant tile.
Parameters: x - the x coordinate of the tile. Parameters: y - the y coordinate of the tile. | public Raster | getTile(int x, int y) Returns the underlying raster (as a
WritableRaster ). | protected WritableRaster | getWritableRaster() Gets the raster. | protected ImageLayout | setUpImageLayout(Raster raster) Sets up an
ImageLayout with information extracted from the given
Raster .
Parameters: raster - the raster behing this image. | protected void | setWritableRaster(WritableRaster raster) Changes the raster. |
RasterAdapter | public RasterAdapter(WritableRaster raster)(Code) | | Constructor.
Parameters: raster - the underlying raster. exception: NullPointerException - if raster is null . |
buildByteImage | public static RasterAdapter buildByteImage(byte[][] pixels, int cols, int rows)(Code) | | Builds an image from byte data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. a new image. See Also: DataBufferByte.DataBufferByte(byte[][]int) |
buildDoubleImage | public static RasterAdapter buildDoubleImage(double[][] pixels, int cols, int rows)(Code) | | Builds an image from double data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. a new image. See Also: DataBufferDouble.DataBufferDouble(double[][]int) |
buildFloatImage | public static RasterAdapter buildFloatImage(float[][] pixels, int cols, int rows)(Code) | | Builds an image from float data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. a new image. See Also: DataBufferFloat.DataBufferFloat(float[][]int) |
buildImage | public static RasterAdapter buildImage(DataBuffer buffer, int cols, int rows)(Code) | | Builds an image from a
DataBuffer .
Parameters: buffer - the data buffer. Parameters: cols - the number of columns. Parameters: rows - the number of rows. a new image. |
buildIntImage | public static RasterAdapter buildIntImage(int[][] pixels, int cols, int rows)(Code) | | Builds an image from int data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. a new image. See Also: DataBufferInt.DataBufferInt(int[][]int) |
buildShortImage | public static RasterAdapter buildShortImage(short[][] pixels, int cols, int rows)(Code) | | Builds an image from short data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. a new image. See Also: DataBufferShort.DataBufferShort(short[][]int) |
buildUShortImage | public static RasterAdapter buildUShortImage(short[][] pixels, int cols, int rows)(Code) | | Builds an image from unsigned short data.
Parameters: pixels - the pixel data. Parameters: cols - the number of columns in the image. Parameters: rows - the number of rows in the image. a new image. See Also: DataBufferUShort.DataBufferUShort(short[][]int) |
getBadTileErrorMessage | protected static String getBadTileErrorMessage(int x, int y)(Code) | | Gets the formatted error message for a request to an inexistant tile.
Parameters: x - the x coordinate of the tile. Parameters: y - the y coordinate of the tile. the message. |
getTile | public Raster getTile(int x, int y) throws IndexOutOfBoundsException(Code) | | Returns the underlying raster (as a
WritableRaster ). There is only
one tile (0, 0).
Parameters: x - the x position of the tile. Parameters: y - the y position of the tile. the tile. exception: IndexOutOfBoundsException - if the requested tile is not(0, 0). |
getWritableRaster | protected WritableRaster getWritableRaster()(Code) | | Gets the raster.
the raster. |
setUpImageLayout | protected ImageLayout setUpImageLayout(Raster raster)(Code) | | Sets up an
ImageLayout with information extracted from the given
Raster .
Parameters: raster - the raster behing this image. the new image layout. |
setWritableRaster | protected void setWritableRaster(WritableRaster raster)(Code) | | Changes the raster.
Parameters: raster - the new raster. |
Methods inherited from javax.media.jai.PlanarImage | public static int XToTileX(int x, int tileGridXOffset, int tileWidth)(Code)(Java Doc) public int XToTileX(int x)(Code)(Java Doc) public static int YToTileY(int y, int tileGridYOffset, int tileHeight)(Code)(Java Doc) public int YToTileY(int y)(Code)(Java Doc) public void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public synchronized boolean addSink(Object sink)(Code)(Java Doc) protected void addSink(PlanarImage sink)(Code)(Java Doc) protected void addSource(Object source)(Code)(Java Doc) public synchronized void addTileComputationListener(TileComputationListener listener)(Code)(Java Doc) public void cancelTiles(TileRequest request, Point[] tileIndices)(Code)(Java Doc) public WritableRaster copyData()(Code)(Java Doc) public WritableRaster copyData(WritableRaster raster)(Code)(Java Doc) public void copyExtendedData(WritableRaster dest, BorderExtender extender)(Code)(Java Doc) public static ColorModel createColorModel(SampleModel sm)(Code)(Java Doc) public PlanarImage createSnapshot()(Code)(Java Doc) final protected WritableRaster createWritableRaster(SampleModel sampleModel, Point location)(Code)(Java Doc) public synchronized void dispose()(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public BufferedImage getAsBufferedImage(Rectangle rect, ColorModel cm)(Code)(Java Doc) public BufferedImage getAsBufferedImage()(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) public ColorModel getColorModel()(Code)(Java Doc) public Raster getData()(Code)(Java Doc) public Raster getData(Rectangle region)(Code)(Java Doc) public static ColorModel getDefaultColorModel(int dataType, int numBands)(Code)(Java Doc) public Raster getExtendedData(Rectangle region, BorderExtender extender)(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public Object getImageID()(Code)(Java Doc) public int getMaxTileX()(Code)(Java Doc) public int getMaxTileY()(Code)(Java Doc) public int getMaxX()(Code)(Java Doc) public int getMaxY()(Code)(Java Doc) public int getMinTileX()(Code)(Java Doc) public int getMinTileY()(Code)(Java Doc) public int getMinX()(Code)(Java Doc) public int getMinY()(Code)(Java Doc) public int getNumBands()(Code)(Java Doc) public int getNumSources()(Code)(Java Doc) public int getNumXTiles()(Code)(Java Doc) public int getNumYTiles()(Code)(Java Doc) protected Hashtable getProperties()(Code)(Java Doc) public Object getProperty(String name)(Code)(Java Doc) public Class getPropertyClass(String name)(Code)(Java Doc) public String[] getPropertyNames()(Code)(Java Doc) public String[] getPropertyNames(String prefix)(Code)(Java Doc) public SampleModel getSampleModel()(Code)(Java Doc) public Vector getSinks()(Code)(Java Doc) public PlanarImage getSource(int index)(Code)(Java Doc) public PlanarImage getSourceImage(int index)(Code)(Java Doc) public Object getSourceObject(int index)(Code)(Java Doc) public Vector getSources()(Code)(Java Doc) public void getSplits(IntegerSequence xSplits, IntegerSequence ySplits, Rectangle rect)(Code)(Java Doc) abstract public Raster getTile(int tileX, int tileY)(Code)(Java Doc) public TileComputationListener[] getTileComputationListeners()(Code)(Java Doc) public TileFactory getTileFactory()(Code)(Java Doc) public int getTileGridXOffset()(Code)(Java Doc) public int getTileGridYOffset()(Code)(Java Doc) public int getTileHeight()(Code)(Java Doc) public Point[] getTileIndices(Rectangle region)(Code)(Java Doc) public Rectangle getTileRect(int tileX, int tileY)(Code)(Java Doc) public int getTileWidth()(Code)(Java Doc) public Raster[] getTiles(Point[] tileIndices)(Code)(Java Doc) public Raster[] getTiles()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public boolean overlapsMultipleTiles(Rectangle rect)(Code)(Java Doc) public void prefetchTiles(Point[] tileIndices)(Code)(Java Doc) public TileRequest queueTiles(Point[] tileIndices)(Code)(Java Doc) public void removeProperty(String name)(Code)(Java Doc) public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public synchronized boolean removeSink(Object sink)(Code)(Java Doc) protected boolean removeSink(PlanarImage sink)(Code)(Java Doc) public void removeSinks()(Code)(Java Doc) protected boolean removeSource(Object source)(Code)(Java Doc) protected void removeSources()(Code)(Java Doc) public synchronized void removeTileComputationListener(TileComputationListener listener)(Code)(Java Doc) protected void setImageLayout(ImageLayout layout)(Code)(Java Doc) protected void setProperties(Hashtable properties)(Code)(Java Doc) public void setProperty(String name, Object value)(Code)(Java Doc) protected void setSource(Object source, int index)(Code)(Java Doc) protected void setSources(List sourceList)(Code)(Java Doc) public static int tileXToX(int tx, int tileGridXOffset, int tileWidth)(Code)(Java Doc) public int tileXToX(int tx)(Code)(Java Doc) public static int tileYToY(int ty, int tileGridYOffset, int tileHeight)(Code)(Java Doc) public int tileYToY(int ty)(Code)(Java Doc) public String toString()(Code)(Java Doc) public static PlanarImage wrapRenderedImage(RenderedImage image)(Code)(Java Doc)
|
|
|