createBandedRaster
public static WritableRaster createBandedRaster(int dataType,
int w,
int h,
int scanlineStride,
int[] bankIndices,
int[] bandOffsets,
Point location)
Creates a new banded raster.
dataType
- the data type.w
- the width.h
- the height.scanlineStride
- the number of data elements from a sample on one
row to the corresponding sample on the next row.bankIndices
- the index for each bank.bandOffsets
- the offset for each band.location
-
createBandedRaster
public static WritableRaster createBandedRaster(int dataType,
int w,
int h,
int bands,
Point location)
Creates a new banded raster.
dataType
- the data type.w
- the width.h
- the height.bands
- the number of bands.location
-
createBandedRaster
public static WritableRaster createBandedRaster(DataBuffer dataBuffer,
int w,
int h,
int scanlineStride,
int[] bankIndices,
int[] bandOffsets,
Point location)
Creates a new banded raster.
dataBuffer
- the data buffer.w
- the width.h
- the height.scanlineStride
- the number of data elements from a sample on one
row to the corresponding sample on the next row.bankIndices
- the index for each bank.bandOffsets
- the band offsets.location
-
createChild
public Raster createChild(int parentX,
int parentY,
int width,
int height,
int childMinX,
int childMinY,
int[] bandList)
createCompatibleWritableRaster
public WritableRaster createCompatibleWritableRaster(int x,
int y,
int w,
int h)
Creates a new writable raster that is compatible with this raster, with
the specified bounds.
x
- the x-coordinate of the top-left corner of the raster.y
- the y-coordinate of the top-left corner of the raster.w
- the raster width.h
- the raster height.
createInterleavedRaster
public static WritableRaster createInterleavedRaster(int dataType,
int w,
int h,
int scanlineStride,
int pixelStride,
int[] bandOffsets,
Point location)
Creates an interleaved raster.
dataType
- the data type.w
- the width.h
- the height.scanlineStride
- the number of data elements from a sample on one
row to the corresponding sample on the next row.pixelStride
- the number of elements from a sample in one pixel to
the corresponding sample in the next pixel.bandOffsets
- the band offsets.location
-
createInterleavedRaster
public static WritableRaster createInterleavedRaster(int dataType,
int w,
int h,
int bands,
Point location)
Creates an interleaved raster using the specified data type.
dataType
- the data type.w
- the width.h
- the height.bands
- the number of bands.location
-
createInterleavedRaster
public static WritableRaster createInterleavedRaster(DataBuffer dataBuffer,
int w,
int h,
int scanlineStride,
int pixelStride,
int[] bandOffsets,
Point location)
Creates a new interleaved raster.
dataBuffer
- the data buffer.w
- the width.h
- the height.scanlineStride
- the number of data elements from a sample on one
row to the corresponding sample on the next row.pixelStride
- the number of elements from a sample in one pixel to
the corresponding sample in the next pixel.bandOffsets
- the offset for each band.location
-
createPackedRaster
public static WritableRaster createPackedRaster(int dataType,
int w,
int h,
int bands,
int bitsPerBand,
Point location)
Creates a new raster.
dataType
- the data type.w
- the width.h
- the height.bands
- the number of bands.bitsPerBand
- the number of bits per band.location
-
createPackedRaster
public static WritableRaster createPackedRaster(int dataType,
int w,
int h,
int[] bandMasks,
Point location)
Creates a new packed raster.
dataType
- the data type.w
- the width.h
- the height.bandMasks
- the bit mask for each band.location
-
createPackedRaster
public static WritableRaster createPackedRaster(DataBuffer dataBuffer,
int w,
int h,
int scanlineStride,
int[] bandMasks,
Point location)
Creates a new packed raster.
dataBuffer
- the data buffer.w
- the width.h
- the height.scanlineStride
- the number of data elements from a sample on one
row to the corresponding sample on the next row.bandMasks
- the bit mask for each band.location
-
createPackedRaster
public static WritableRaster createPackedRaster(DataBuffer dataBuffer,
int w,
int h,
int bitsPerPixel,
Point location)
Creates a new packed raster.
dataBuffer
- the data buffer.w
- the width.h
- the height.bitsPerPixel
- the number of bits per pixel.location
-
getBounds
public Rectangle getBounds()
Returns a new rectangle containing the bounds of this raster.
- A new rectangle containing the bounds of this raster.
getHeight
public final int getHeight()
Returns the height of the raster.
- The height of the raster.
getMinX
public final int getMinX()
Returns the x-coordinate of the top left corner of the raster.
- The x-coordinate of the top left corner of the raster.
getMinY
public final int getMinY()
Returns the t-coordinate of the top left corner of the raster.
- The t-coordinate of the top left corner of the raster.
getNumBands
public final int getNumBands()
Returns the number of bands for this raster.
getPixel
public double[] getPixel(int x,
int y,
double[] dArray)
Returns an array containing the samples for the pixel at (x, y) in the
raster. If dArray
is not null
, it will be
populated with the sample values and returned as the result of
this function (this avoids allocating a new array instance).
x
- the x-coordinate of the pixel.y
- the y-coordinate of the pixel.dArray
- an array to populate with the sample values and return as
the result (if null
, a new array will be allocated).
getPixel
public float[] getPixel(int x,
int y,
float[] fArray)
Returns an array containing the samples for the pixel at (x, y) in the
raster. If fArray
is not null
, it will be
populated with the sample values and returned as the result of
this function (this avoids allocating a new array instance).
x
- the x-coordinate of the pixel.y
- the y-coordinate of the pixel.fArray
- an array to populate with the sample values and return as
the result (if null
, a new array will be allocated).
getPixel
public int[] getPixel(int x,
int y,
int[] iArray)
Returns an array containing the samples for the pixel at (x, y) in the
raster. If iArray
is not null
, it will be
populated with the sample values and returned as the result of
this function (this avoids allocating a new array instance).
x
- the x-coordinate of the pixel.y
- the y-coordinate of the pixel.iArray
- an array to populate with the sample values and return as
the result (if null
, a new array will be allocated).
getPixels
public double[] getPixels(int x,
int y,
int w,
int h,
double[] dArray)
Returns an array containing the samples 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).
If dArray
is not null
, it will be populated
with the sample values and returned as the result of this function (this
avoids allocating a new array instance).
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
- an array to populate with the sample values and return as
the result (if null
, a new array will be allocated).
getPixels
public float[] getPixels(int x,
int y,
int w,
int h,
float[] fArray)
Returns an array containing the samples 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).
If fArray
is not null
, it will be populated
with the sample values and returned as the result of this function (this
avoids allocating a new array instance).
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
- an array to populate with the sample values and return as
the result (if null
, a new array will be allocated).
getPixels
public int[] getPixels(int x,
int y,
int w,
int h,
int[] iArray)
Returns an array containing the samples 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).
If iArray
is not null
, it will be populated
with the sample values and returned as the result of this function (this
avoids allocating a new array instance).
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
- an array to populate with the sample values and return as
the result (if null
, a new array will be allocated).
getSample
public int getSample(int x,
int y,
int b)
Returns the sample value for the pixel at (x, y) in the raster.
x
- the x-coordinate of the pixel.y
- the y-coordinate of the pixel.b
- the band (in the range 0
to
getNumBands() - 1
).
getSampleDouble
public double getSampleDouble(int x,
int y,
int b)
Returns the sample value for the pixel at (x, y) in the raster.
x
- the x-coordinate of the pixel.y
- the y-coordinate of the pixel.b
- the band (in the range 0
to
getNumBands() - 1
).
getSampleFloat
public float getSampleFloat(int x,
int y,
int b)
Returns the sample value for the pixel at (x, y) in the raster.
x
- the x-coordinate of the pixel.y
- the y-coordinate of the pixel.b
- the band (in the range 0
to
getNumBands() - 1
).
getSampleModel
public SampleModel getSampleModel()
Returns the sample model that accesses the data buffer (to extract pixel
data) for this raster.
getSamples
public double[] getSamples(int x,
int y,
int w,
int h,
int b,
double[] dArray)
Returns an array containing the samples from one band for the pixels in
the region specified by (x, y, w, h) in the raster. If
dArray
is not null
, it will be
populated with the sample values and returned as the result of this
function (this avoids allocating a new array instance).
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
- an array to populate with the sample values and return as
the result (if null
, a new array will be allocated).
getSamples
public float[] getSamples(int x,
int y,
int w,
int h,
int b,
float[] fArray)
Returns an array containing the samples from one band for the pixels in
the region specified by (x, y, w, h) in the raster. If
fArray
is not null
, it will be
populated with the sample values and returned as the result of this
function (this avoids allocating a new array instance).
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
- an array to populate with the sample values and return as
the result (if null
, a new array will be allocated).
getSamples
public int[] getSamples(int x,
int y,
int w,
int h,
int b,
int[] iArray)
Returns an array containing the samples from one band for the pixels in
the region specified by (x, y, w, h) in the raster. If
iArray
is not null
, it will be
populated with the sample values and returned as the result of this
function (this avoids allocating a new array instance).
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
- an array to populate with the sample values and return as
the result (if null
, a new array will be allocated).
getTransferType
public final int getTransferType()
Returns the transfer type for the raster (this is determined by the
raster's sample model).
getWidth
public final int getWidth()
Returns the width of the raster.
toString
public String toString()
Create a String representing the state of this Raster.
- toString in interface Object
- A String representing the stat of this Raster.
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.