java.awt.image

Class WritableRaster

Known Direct Subclasses:
CairoSurface

public class WritableRaster
extends Raster

A raster with methods to support updating pixel values.

Field Summary

Fields inherited from class java.awt.image.Raster

dataBuffer, height, minX, minY, numBands, numDataElements, parent, sampleModel, sampleModelTranslateX, sampleModelTranslateY, width

Constructor Summary

WritableRaster(SampleModel sampleModel, Point origin)
Creates a new WritableRaster.
WritableRaster(SampleModel sampleModel, DataBuffer dataBuffer, Point origin)
Creates a new WritableRaster instance.
WritableRaster(SampleModel sampleModel, DataBuffer dataBuffer, Rectangle aRegion, Point sampleModelTranslate, WritableRaster parent)
Creates a new WritableRaster instance.

Method Summary

Raster
createChild(int parentX, int parentY, int width, int height, int childMinX, int childMinY, int[] bandList)
WritableRaster
createWritableChild(int parentX, int parentY, int w, int h, int childMinX, int childMinY, int[] bandList)
WritableRaster
createWritableTranslatedChild(int childMinX, int childMinY)
WritableRaster
getWritableParent()
Returns the raster's parent, cast as a WritableRaster.
void
setDataElements(int x, int y, int w, int h, Object inData)
void
setDataElements(int x, int y, Raster inRaster)
void
setDataElements(int x, int y, Object inData)
void
setPixel(int x, int y, double[] dArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.
void
setPixel(int x, int y, float[] fArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.
void
setPixel(int x, int y, int[] iArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.
void
setPixels(int x, int y, int w, int h, double[] dArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster.
void
setPixels(int x, int y, int w, int h, float[] fArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster.
void
setPixels(int x, int y, int w, int h, int[] iArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster.
void
setRect(int dx, int dy, Raster srcRaster)
void
setRect(Raster srcRaster)
void
setSample(int x, int y, int b, double s)
Sets the sample value for a band for the pixel at (x, y) in the raster.
void
setSample(int x, int y, int b, float s)
Sets the sample value for a band for the pixel at (x, y) in the raster.
void
setSample(int x, int y, int b, int s)
Sets the sample value for a band for the pixel at (x, y) in the raster.
void
setSamples(int x, int y, int w, int h, int b, double[] dArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.
void
setSamples(int x, int y, int w, int h, int b, float[] fArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.
void
setSamples(int x, int y, int w, int h, int b, int[] iArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.

Methods inherited from class java.awt.image.Raster

createBandedRaster, createBandedRaster, createBandedRaster, createChild, createCompatibleWritableRaster, createCompatibleWritableRaster, createCompatibleWritableRaster, createCompatibleWritableRaster, createInterleavedRaster, createInterleavedRaster, createInterleavedRaster, createPackedRaster, createPackedRaster, createPackedRaster, createPackedRaster, createRaster, createTranslatedChild, createWritableRaster, createWritableRaster, getBounds, getDataBuffer, getDataElements, getDataElements, getHeight, getMinX, getMinY, getNumBands, getNumDataElements, getParent, getPixel, getPixel, getPixel, getPixels, getPixels, getPixels, getSample, getSampleDouble, getSampleFloat, getSampleModel, getSampleModelTranslateX, getSampleModelTranslateY, getSamples, getSamples, getSamples, getTransferType, getWidth, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

WritableRaster

protected WritableRaster(SampleModel sampleModel,
                         Point origin)
Creates a new WritableRaster.
Parameters:
sampleModel - the sample model.
origin - the origin.

WritableRaster

protected WritableRaster(SampleModel sampleModel,
                         DataBuffer dataBuffer,
                         Point origin)
Creates a new WritableRaster instance.
Parameters:
sampleModel - the sample model.
dataBuffer - the data buffer.
origin - the origin.

WritableRaster

protected WritableRaster(SampleModel sampleModel,
                         DataBuffer dataBuffer,
                         Rectangle aRegion,
                         Point sampleModelTranslate,
                         WritableRaster parent)
Creates a new WritableRaster instance.
Parameters:
sampleModel - the sample model.
dataBuffer - the data buffer.
aRegion - the raster's bounds.
sampleModelTranslate - the translation.
parent - the parent.

Method Details

createChild

public Raster createChild(int parentX,
                          int parentY,
                          int width,
                          int height,
                          int childMinX,
                          int childMinY,
                          int[] bandList)
Overrides:
createChild in interface Raster

createWritableChild

public WritableRaster createWritableChild(int parentX,
                                          int parentY,
                                          int w,
                                          int h,
                                          int childMinX,
                                          int childMinY,
                                          int[] bandList)
Parameters:
parentX -
parentY -
w -
h -
childMinX -
childMinY -
bandList -
Returns:

createWritableTranslatedChild

public WritableRaster createWritableTranslatedChild(int childMinX,
                                                    int childMinY)
Parameters:
childMinX -
childMinY -
Returns:

getWritableParent

public WritableRaster getWritableParent()
Returns the raster's parent, cast as a WritableRaster.
Returns:
The raster's parent.

setDataElements

public void setDataElements(int x,
                            int y,
                            int w,
                            int h,
                            Object inData)

setDataElements

public void setDataElements(int x,
                            int y,
                            Raster inRaster)

setDataElements

public void setDataElements(int x,
                            int y,
                            Object inData)

setPixel

public void setPixel(int x,
                     int y,
                     double[] dArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.
Parameters:
x - the x-coordinate of the pixel.
y - the y-coordinate of the pixel.
dArray - the sample values (null not permitted).
Throws:
NullPointerException - if dArray is null.

setPixel

public void setPixel(int x,
                     int y,
                     float[] fArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.
Parameters:
x - the x-coordinate of the pixel.
y - the y-coordinate of the pixel.
fArray - the sample values (null not permitted).
Throws:
NullPointerException - if fArray is null.

setPixel

public void setPixel(int x,
                     int y,
                     int[] iArray)
Sets the samples for the pixel at (x, y) in the raster to the specified values.
Parameters:
x - the x-coordinate of the pixel.
y - the y-coordinate of the pixel.
iArray - the sample values (null not permitted).
Throws:
NullPointerException - if iArray is null.

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      double[] dArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster. The array is ordered by pixels (that is, all the samples for the first pixel are grouped together, followed by all the samples for the second pixel, and so on).
Parameters:
x - the x-coordinate of the top-left pixel.
y - the y-coordinate of the top-left pixel.
w - the width of the region of pixels.
h - the height of the region of pixels.
dArray - the pixel sample values (null not permitted).
Throws:
NullPointerException - if dArray is null.

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      float[] fArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster. The array is ordered by pixels (that is, all the samples for the first pixel are grouped together, followed by all the samples for the second pixel, and so on).
Parameters:
x - the x-coordinate of the top-left pixel.
y - the y-coordinate of the top-left pixel.
w - the width of the region of pixels.
h - the height of the region of pixels.
fArray - the pixel sample values (null not permitted).
Throws:
NullPointerException - if fArray is null.

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      int[] iArray)
Sets the sample values for the pixels in the region specified by (x, y, w, h) in the raster. The array is ordered by pixels (that is, all the samples for the first pixel are grouped together, followed by all the samples for the second pixel, and so on).
Parameters:
x - the x-coordinate of the top-left pixel.
y - the y-coordinate of the top-left pixel.
w - the width of the region of pixels.
h - the height of the region of pixels.
iArray - the pixel sample values (null not permitted).
Throws:
NullPointerException - if iArray is null.

setRect

public void setRect(int dx,
                    int dy,
                    Raster srcRaster)
Parameters:
dx -
dy -
srcRaster -

setRect

public void setRect(Raster srcRaster)
Parameters:
srcRaster -

setSample

public void setSample(int x,
                      int y,
                      int b,
                      double s)
Sets the sample value for a band for the pixel at (x, y) in the raster.
Parameters:
x - the x-coordinate of the pixel.
y - the y-coordinate of the pixel.
b - the band (in the range 0 to getNumBands() - 1).
s - the sample value.

setSample

public void setSample(int x,
                      int y,
                      int b,
                      float s)
Sets the sample value for a band for the pixel at (x, y) in the raster.
Parameters:
x - the x-coordinate of the pixel.
y - the y-coordinate of the pixel.
b - the band (in the range 0 to getNumBands() - 1).
s - the sample value.

setSample

public void setSample(int x,
                      int y,
                      int b,
                      int s)
Sets the sample value for a band for the pixel at (x, y) in the raster.
Parameters:
x - the x-coordinate of the pixel.
y - the y-coordinate of the pixel.
b - the band (in the range 0 to getNumBands() - 1).
s - the sample value.

setSamples

public void setSamples(int x,
                       int y,
                       int w,
                       int h,
                       int b,
                       double[] dArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.
Parameters:
x - the x-coordinate of the top-left pixel.
y - the y-coordinate of the top-left pixel.
w - the width of the region of pixels.
h - the height of the region of pixels.
b - the band (in the range 0 to getNumBands() - 1).
dArray - the sample values (null not permitted).
Throws:
NullPointerException - if dArray is null.

setSamples

public void setSamples(int x,
                       int y,
                       int w,
                       int h,
                       int b,
                       float[] fArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.
Parameters:
x - the x-coordinate of the top-left pixel.
y - the y-coordinate of the top-left pixel.
w - the width of the region of pixels.
h - the height of the region of pixels.
b - the band (in the range 0 to getNumBands() - 1).
fArray - the sample values (null not permitted).
Throws:
NullPointerException - if fArray is null.

setSamples

public void setSamples(int x,
                       int y,
                       int w,
                       int h,
                       int b,
                       int[] iArray)
Sets the sample values for one band for the pixels in the region specified by (x, y, w, h) in the raster.
Parameters:
x - the x-coordinate of the top-left pixel.
y - the y-coordinate of the top-left pixel.
w - the width of the region of pixels.
h - the height of the region of pixels.
b - the band (in the range 0 to getNumBands() - 1).
iArray - the sample values (null not permitted).
Throws:
NullPointerException - if iArray is null.

Copyright (C) 2000, 2002, 2003, 2006, Free Software Foundation This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.