|
|||||||||
| Home >> All >> org >> ydp >> [ jai overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.ydp.jai
Class RasterFactory

java.lang.Objectorg.ydp.jai.RasterFactory
- public class RasterFactory
- extends java.lang.Object
A convenience class for the construction of various types of
WritableRaster and SampleModel objects.
This class provides the capability of creating
Rasters with the enumerated data types in the
java.awt.image.DataBuffer.
In come cases, instances of
ComponentSampleModelJAI, a subclass of
java.awt.image.ComponentSampleModel are instantiated
instead of java.awt.image.BandedSampleModel in order
to work around bugs in the current release of the Java 2 SDK.
| Constructor Summary | |
RasterFactory()
|
|
| Method Summary | |
static java.awt.image.WritableRaster |
createBandedRaster(java.awt.image.DataBuffer dataBuffer,
int width,
int height,
int scanlineStride,
int[] bankIndices,
int[] bandOffsets,
java.awt.Point location)
Creates a WritableRaster based on a
ComponentSampleModel with the specified
DataBuffer, width, height, scanline stride, bank
indices, and band offsets. |
static java.awt.image.WritableRaster |
createBandedRaster(int dataType,
int width,
int height,
int scanlineStride,
int[] bankIndices,
int[] bandOffsets,
java.awt.Point location)
Creates a WritableRaster based on a
ComponentSampleModel with the specified data type,
width, height, scanline stride, bank indices and band offsets. |
static java.awt.image.WritableRaster |
createBandedRaster(int dataType,
int width,
int height,
int bands,
java.awt.Point location)
Creates a WritableRaster based on a
ComponentSampleModel with the specified data type,
width, height, and number of bands. |
static java.awt.image.SampleModel |
createBandedSampleModel(int dataType,
int width,
int height,
int numBands)
Creates a banded SampleModel with a given data
type, width, height, and number of bands. |
static java.awt.image.SampleModel |
createBandedSampleModel(int dataType,
int width,
int height,
int numBands,
int[] bankIndices,
int[] bandOffsets)
Creates a banded SampleModel with a given data
type, width, height, number of bands, bank indices, and band
offsets. |
static java.awt.image.ComponentColorModel |
createComponentColorModel(int dataType,
java.awt.color.ColorSpace colorSpace,
boolean useAlpha,
boolean premultiplied,
int transparency)
Creates a component-based ColorModel with a given
data type, color space, and transparency type. |
static java.awt.image.SampleModel |
createComponentSampleModel(java.awt.image.SampleModel sm,
int dataType,
int width,
int height,
int numBands)
Creates a component SampleModel with a given data
type, width, height, and number of bands that is "compatible"
with a given SampleModel. |
static java.awt.image.WritableRaster |
createInterleavedRaster(java.awt.image.DataBuffer dataBuffer,
int width,
int height,
int scanlineStride,
int pixelStride,
int[] bandOffsets,
java.awt.Point location)
Creates a WritableRaster based on a
PixelInterleavedSampleModel with the specified
DataBuffer, width, height, scanline stride, pixel
stride, and band offsets. |
static java.awt.image.WritableRaster |
createInterleavedRaster(int dataType,
int width,
int height,
int scanlineStride,
int pixelStride,
int[] bandOffsets,
java.awt.Point location)
Creates a WritableRaster based on a
PixelInterleavedSampleModel with the specified
data type, width, height, scanline stride, pixel stride, and
band offsets. |
static java.awt.image.WritableRaster |
createInterleavedRaster(int dataType,
int width,
int height,
int numBands,
java.awt.Point location)
Creates a WritableRaster based on a
PixelInterleavedSampleModel with the specified
data type, width, height, and number of bands. |
static java.awt.image.WritableRaster |
createPackedRaster(java.awt.image.DataBuffer dataBuffer,
int width,
int height,
int scanlineStride,
int[] bandMasks,
java.awt.Point location)
Creates a WritableRaster based on a
SinglePixelPackedSampleModel with the specified
DataBuffer, width, height, scanline stride, and
band masks. |
static java.awt.image.WritableRaster |
createPackedRaster(java.awt.image.DataBuffer dataBuffer,
int width,
int height,
int bitsPerPixel,
java.awt.Point location)
Creates a WritableRaster based on a
MultiPixelPackedSampleModel with the specified
DataBuffer, width, height, and bits per pixel. |
static java.awt.image.WritableRaster |
createPackedRaster(int dataType,
int width,
int height,
int[] bandMasks,
java.awt.Point location)
Creates a WritableRaster based on a
SinglePixelPackedSampleModel with the specified
data type, width, height, and band masks. |
static java.awt.image.WritableRaster |
createPackedRaster(int dataType,
int width,
int height,
int numBands,
int bitsPerBand,
java.awt.Point location)
Creates a WritableRaster based on a packed
SampleModel with the specified data type, width,
height, number of bands, and bits per band. |
static java.awt.image.SampleModel |
createPixelInterleavedSampleModel(int dataType,
int width,
int height,
int numBands)
Creates a pixel interleaved SampleModel with a
given data type, width, height, and number of bands. |
static java.awt.image.SampleModel |
createPixelInterleavedSampleModel(int dataType,
int width,
int height,
int pixelStride,
int scanlineStride,
int[] bandOffsets)
Creates a pixel interleaved SampleModel with a
given data type, width, height, pixel and scanline strides, and
band offsets. |
static java.awt.image.Raster |
createRaster(java.awt.image.SampleModel sampleModel,
java.awt.image.DataBuffer dataBuffer,
java.awt.Point location)
Creates a WritableRaster with the specified
SampleModel and DataBuffer. |
static java.awt.image.WritableRaster |
createWritableChild(java.awt.image.WritableRaster raster,
int parentX,
int parentY,
int width,
int height,
int childMinX,
int childMinY,
int[] bandList)
Returns a new WritableRaster which shares all or part of the supplied WritableRaster's DataBuffer. |
static java.awt.image.WritableRaster |
createWritableRaster(java.awt.image.SampleModel sampleModel,
java.awt.image.DataBuffer dataBuffer,
java.awt.Point location)
Creates a WritableRaster with the specified
SampleModel and DataBuffer. |
static java.awt.image.WritableRaster |
createWritableRaster(java.awt.image.SampleModel sampleModel,
java.awt.Point location)
Creates a WritableRaster with the specified
SampleModel. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
RasterFactory
public RasterFactory()
| Method Detail |
createInterleavedRaster
public static java.awt.image.WritableRaster createInterleavedRaster(int dataType, int width, int height, int numBands, java.awt.Point location)
- Creates a
WritableRasterbased on aPixelInterleavedSampleModelwith the specified data type, width, height, and number of bands.The upper left corner of the
WritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used. ThedataTypeparameter should be one of the enumerated values defined in theDataBufferclass.
createInterleavedRaster
public static java.awt.image.WritableRaster createInterleavedRaster(int dataType, int width, int height, int scanlineStride, int pixelStride, int[] bandOffsets, java.awt.Point location)
- Creates a
WritableRasterbased on aPixelInterleavedSampleModelwith the specified data type, width, height, scanline stride, pixel stride, and band offsets. The number of bands is inferred from bandOffsets.length.The upper left corner of the
WritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used. ThedataTypeparameter should be one of the enumerated values defined in theDataBufferclass.
createBandedRaster
public static java.awt.image.WritableRaster createBandedRaster(int dataType, int width, int height, int bands, java.awt.Point location)
- Creates a
WritableRasterbased on aComponentSampleModelwith the specified data type, width, height, and number of bands.Note that the
Raster'sSampleModelwill be of typeComponentSampleModel, notBandedSampleModelas might be expected.The upper left corner of the
WritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used. ThedataTypeparameter should be one of the enumerated values defined in theDataBufferclass.
createBandedRaster
public static java.awt.image.WritableRaster createBandedRaster(int dataType, int width, int height, int scanlineStride, int[] bankIndices, int[] bandOffsets, java.awt.Point location)
- Creates a
WritableRasterbased on aComponentSampleModelwith the specified data type, width, height, scanline stride, bank indices and band offsets. The number of bands is inferred frombankIndices.lengthandbandOffsets.length, which must be the same.Note that the
Raster'sSampleModelwill be of typeComponentSampleModel, notBandedSampleModelas might be expected.The upper left corner of the
WritableRasteris given by thelocationargument. ThedataTypeparameter should be one of the enumerated values defined in theDataBufferclass.
createPackedRaster
public static java.awt.image.WritableRaster createPackedRaster(int dataType, int width, int height, int[] bandMasks, java.awt.Point location)
- Creates a
WritableRasterbased on aSinglePixelPackedSampleModelwith the specified data type, width, height, and band masks. The number of bands is inferred frombandMasks.length.The upper left corner of the
WritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used. ThedataTypeparameter should be one of the enumerated values defined in theDataBufferclass.
createPackedRaster
public static java.awt.image.WritableRaster createPackedRaster(int dataType, int width, int height, int numBands, int bitsPerBand, java.awt.Point location)
- Creates a
WritableRasterbased on a packedSampleModelwith the specified data type, width, height, number of bands, and bits per band. If the number of bands is one, theSampleModelwill be aMultiPixelPackedSampleModel.If the number of bands is more than one, the
SampleModelwill be aSinglePixelPackedSampleModel, with each band havingbitsPerBandbits. In either case, the requirements ondataTypeandbitsPerBandimposed by the correspondingSampleModelmust be met.The upper left corner of the
WritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used. ThedataTypeparameter should be one of the enumerated values defined in theDataBufferclass.
createInterleavedRaster
public static java.awt.image.WritableRaster createInterleavedRaster(java.awt.image.DataBuffer dataBuffer, int width, int height, int scanlineStride, int pixelStride, int[] bandOffsets, java.awt.Point location)
- Creates a
WritableRasterbased on aPixelInterleavedSampleModelwith the specifiedDataBuffer, width, height, scanline stride, pixel stride, and band offsets. The number of bands is inferred frombandOffsets.length. The upper left corner of theWritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used.
createBandedRaster
public static java.awt.image.WritableRaster createBandedRaster(java.awt.image.DataBuffer dataBuffer, int width, int height, int scanlineStride, int[] bankIndices, int[] bandOffsets, java.awt.Point location)
- Creates a
WritableRasterbased on aComponentSampleModelwith the specifiedDataBuffer, width, height, scanline stride, bank indices, and band offsets. The number of bands is inferred frombankIndices.lengthandbandOffsets.length, which must be the same. The upper left corner of theWritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used.Note that the
Raster'sSampleModelwill be of typeComponentSampleModel, notBandedSampleModelas might be expected.
createPackedRaster
public static java.awt.image.WritableRaster createPackedRaster(java.awt.image.DataBuffer dataBuffer, int width, int height, int scanlineStride, int[] bandMasks, java.awt.Point location)
- Creates a
WritableRasterbased on aSinglePixelPackedSampleModelwith the specifiedDataBuffer, width, height, scanline stride, and band masks. The number of bands is inferred frombandMasks.length. The upper left corner of theWritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used.
createPackedRaster
public static java.awt.image.WritableRaster createPackedRaster(java.awt.image.DataBuffer dataBuffer, int width, int height, int bitsPerPixel, java.awt.Point location)
- Creates a
WritableRasterbased on aMultiPixelPackedSampleModelwith the specifiedDataBuffer, width, height, and bits per pixel. The upper left corner of theWritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used.
createRaster
public static java.awt.image.Raster createRaster(java.awt.image.SampleModel sampleModel, java.awt.image.DataBuffer dataBuffer, java.awt.Point location)
- Creates a
WritableRasterwith the specifiedSampleModelandDataBuffer. The upper left corner of theWritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used.
createWritableRaster
public static java.awt.image.WritableRaster createWritableRaster(java.awt.image.SampleModel sampleModel, java.awt.Point location)
- Creates a
WritableRasterwith the specifiedSampleModel. The upper left corner of theWritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used.
createWritableRaster
public static java.awt.image.WritableRaster createWritableRaster(java.awt.image.SampleModel sampleModel, java.awt.image.DataBuffer dataBuffer, java.awt.Point location)
- Creates a
WritableRasterwith the specifiedSampleModelandDataBuffer. The upper left corner of theWritableRasteris given by thelocationargument. Iflocationisnull, (0, 0) will be used.
createWritableChild
public static java.awt.image.WritableRaster createWritableChild(java.awt.image.WritableRaster raster, int parentX, int parentY, int width, int height, int childMinX, int childMinY, int[] bandList)
- Returns a new WritableRaster which shares all or part of the
supplied WritableRaster's DataBuffer. The new WritableRaster will
possess a reference to the supplied WritableRaster, accessible
through its getParent() and getWritableParent() methods.
This method provides a workaround for a bug in the implementation of WritableRaster.createWritableChild in the initial relase of the Java2 platform.
The
parentX,parentY,widthandheightparameters form a Rectangle in this WritableRaster's coordinate space, indicating the area of pixels to be shared. An error will be thrown if this Rectangle is not contained with the bounds of the supplied WritableRaster.The new WritableRaster may additionally be translated to a different coordinate system for the plane than that used by the supplied WritableRaster. The childMinX and childMinY parameters give the new (x, y) coordinate of the upper-left pixel of the returned WritableRaster; the coordinate (childMinX, childMinY) in the new WritableRaster will map to the same pixel as the coordinate (parentX, parentY) in the supplied WritableRaster.
The new WritableRaster may be defined to contain only a subset of the bands of the supplied WritableRaster, possibly reordered, by means of the bandList parameter. If bandList is null, it is taken to include all of the bands of the supplied WritableRaster in their current order.
To create a new WritableRaster that contains a subregion of the supplied WritableRaster, but shares its coordinate system and bands, this method should be called with childMinX equal to parentX, childMinY equal to parentY, and bandList equal to null.
createBandedSampleModel
public static java.awt.image.SampleModel createBandedSampleModel(int dataType, int width, int height, int numBands, int[] bankIndices, int[] bandOffsets)
- Creates a banded
SampleModelwith a given data type, width, height, number of bands, bank indices, and band offsets.Note that the returned
SampleModelwill be of typeComponentSampleModel, notBandedSampleModelas might be expected. Its behavior will be equivalent to that of aBandedSampleModel, and in particular its pixel stride will always be 1.
createBandedSampleModel
public static java.awt.image.SampleModel createBandedSampleModel(int dataType, int width, int height, int numBands)
- Creates a banded
SampleModelwith a given data type, width, height, and number of bands. The bank indices and band offsets are set to default values.Note that the returned
SampleModelwill be of typeComponentSampleModel, notBandedSampleModelas might be expected. Its behavior will be equivalent to that of aBandedSampleModel, and in particular its pixel stride will always be 1.
createPixelInterleavedSampleModel
public static java.awt.image.SampleModel createPixelInterleavedSampleModel(int dataType, int width, int height, int pixelStride, int scanlineStride, int[] bandOffsets)
- Creates a pixel interleaved
SampleModelwith a given data type, width, height, pixel and scanline strides, and band offsets.
createPixelInterleavedSampleModel
public static java.awt.image.SampleModel createPixelInterleavedSampleModel(int dataType, int width, int height, int numBands)
- Creates a pixel interleaved
SampleModelwith a given data type, width, height, and number of bands. The pixel stride, scanline stride, and band offsets are set to default values.
createComponentSampleModel
public static java.awt.image.SampleModel createComponentSampleModel(java.awt.image.SampleModel sm, int dataType, int width, int height, int numBands)
- Creates a component
SampleModelwith a given data type, width, height, and number of bands that is "compatible" with a given SampleModel.
createComponentColorModel
public static java.awt.image.ComponentColorModel createComponentColorModel(int dataType, java.awt.color.ColorSpace colorSpace, boolean useAlpha, boolean premultiplied, int transparency)
- Creates a component-based
ColorModelwith a given data type, color space, and transparency type. Currently this method does not support data typeDataBuffer.TYPE_SHORT.
|
|||||||||
| Home >> All >> org >> ydp >> [ jai overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.ydp.jai.RasterFactory