|
intarsys CWT library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.image.Raster
java.awt.image.WritableRaster
de.intarsys.cwt.swt.image.SwtCompatibleRaster
public class SwtCompatibleRaster
Constructor Summary | |
---|---|
SwtCompatibleRaster(SampleModel paramSampleModel,
DataBuffer paramDataBuffer,
Point origin)
|
|
SwtCompatibleRaster(SampleModel paramSampleModel,
DataBuffer paramDataBuffer,
Rectangle aRegion,
Point origin,
WritableRaster paramParent)
|
|
SwtCompatibleRaster(SampleModel paramSampleModel,
Point origin)
|
Method Summary | |
---|---|
Raster |
createChild(int x,
int y,
int width,
int height,
int x0,
int y0,
int[] bandList)
Creates a subraster given a region of the raster. |
WritableRaster |
createCompatibleWritableRaster()
Creates a Raster with the same layout and the same width and height, and with new zeroed data arrays. |
WritableRaster |
createCompatibleWritableRaster(int w,
int h)
Creates a Raster with the same layout but using a different width and height, and with new zeroed data arrays. |
WritableRaster |
createWritableChild(int x,
int y,
int width,
int height,
int x0,
int y0,
int[] bandList)
Creates a Writable subRaster given a region of the Raster. |
byte[] |
getByteData(int x,
int y,
int w,
int h,
byte[] outData)
Returns a byte array of data elements from the specified rectangular region. |
byte[] |
getByteData(int x,
int y,
int w,
int h,
int band,
byte[] outData)
Returns a byte array of data elements from the specified rectangular region for the specified band. |
Object |
getDataElements(int x,
int y,
int w,
int h,
Object obj)
Returns an array of data elements from the specified rectangular region. |
Object |
getDataElements(int actualX,
int actualY,
Object obj)
Returns the data elements for all bands at the specified location. |
int |
getDataOffset(int band)
Returns the data offset for the specified band. |
int[] |
getDataOffsets()
Returns a copy of the data offsets array. |
byte[] |
getDataStorage()
Returns a reference to the data array. |
int[] |
getPixels(int x,
int y,
int w,
int h,
int[] iArray)
|
int |
getPixelStride()
Returns pixel stride -- the number of data array elements between two samples for the same band on the same scanline. |
int |
getSample(int x,
int y,
int b)
|
int[] |
getSamples(int x,
int y,
int w,
int h,
int b,
int[] iArray)
|
int |
getScanlineStride()
Returns the scanline stride -- the number of data array elements between a given sample and the sample in the same column of the next row in the same band. |
void |
putByteData(int x,
int y,
int w,
int h,
byte[] inData)
Stores a byte array of data elements into the specified rectangular region. |
void |
putByteData(int x,
int y,
int w,
int h,
int band,
byte[] inData)
Stores a byte array of data elements into the specified rectangular region for the specified band. |
void |
setDataElements(int x,
int y,
int w,
int h,
Object obj)
Stores an array of data elements into the specified rectangular region. |
void |
setDataElements(int x,
int y,
Object obj)
Stores the data elements for all bands at the specified location. |
void |
setDataElements(int x,
int y,
Raster inRaster)
Stores the Raster data at the specified location. |
void |
setPixels(int x,
int y,
int w,
int h,
int[] iArray)
|
void |
setRect(int dx,
int dy,
Raster srcRaster)
|
void |
setSample(int x,
int y,
int b,
int s)
|
void |
setSamples(int x,
int y,
int w,
int h,
int b,
int[] iArray)
|
String |
toString()
|
Methods inherited from class java.awt.image.WritableRaster |
---|
createWritableTranslatedChild, getWritableParent, setPixel, setPixel, setPixel, setPixels, setPixels, setRect, setSample, setSample, setSamples, setSamples |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SwtCompatibleRaster(SampleModel paramSampleModel, DataBuffer paramDataBuffer, Point origin)
public SwtCompatibleRaster(SampleModel paramSampleModel, DataBuffer paramDataBuffer, Rectangle aRegion, Point origin, WritableRaster paramParent)
public SwtCompatibleRaster(SampleModel paramSampleModel, Point origin)
Method Detail |
---|
public Raster createChild(int x, int y, int width, int height, int x0, int y0, int[] bandList)
createChild
in class Raster
x
- X offset.y
- Y offset.width
- Width (in pixels) of the subraster.height
- Height (in pixels) of the subraster.x0
- Translated X origin of the subraster.y0
- Translated Y origin of the subraster.bandList
- Array of band indices.
RasterFormatException
- if the specified bounding box is outside of the parent
raster.public WritableRaster createCompatibleWritableRaster()
createCompatibleWritableRaster
in class Raster
public WritableRaster createCompatibleWritableRaster(int w, int h)
createCompatibleWritableRaster
in class Raster
public WritableRaster createWritableChild(int x, int y, int width, int height, int x0, int y0, int[] bandList)
createWritableChild
in class WritableRaster
x
- X offset.y
- Y offset.width
- Width (in pixels) of the subraster.height
- Height (in pixels) of the subraster.x0
- Translated X origin of the subraster.y0
- Translated Y origin of the subraster.bandList
- Array of band indices.
RasterFormatException
- if the specified bounding box is outside of the parent
Raster.public byte[] getByteData(int x, int y, int w, int h, byte[] outData)
byte[] bandData = raster.getByteData(x, y, w, h, null); int numDataElements = raster.getnumDataElements(); byte[] pixel = new byte[numDataElements]; // To find a data element at location (x2, y2) System.arraycopy(bandData, ((y2 - y) * w + (x2 - x)) * numDataElements, pixel, 0, numDataElements);
x
- The X coordinate of the upper left pixel location.y
- The Y coordinate of the upper left pixel location.width
- Width of the pixel rectangle.height
- Height of the pixel rectangle.outData
- If non-null, data elements for all bands at the specified
location are returned in this array.
public byte[] getByteData(int x, int y, int w, int h, int band, byte[] outData)
byte[] bandData = raster.getByteData(x, y, w, h, null); // To find the data element at location (x2, y2) byte bandElement = bandData[((y2 - y) * w + (x2 - x))];
x
- The X coordinate of the upper left pixel location.y
- The Y coordinate of the upper left pixel location.width
- Width of the pixel rectangle.height
- Height of the pixel rectangle.band
- The band to return.outData
- If non-null, data elements for all bands at the specified
location are returned in this array.
public Object getDataElements(int x, int y, int w, int h, Object obj)
byte[] bandData = (byte[]) raster.getDataElements(x, y, w, h, null); int numDataElements = raster.getNumDataElements(); byte[] pixel = new byte[numDataElements]; // To find a data element at location (x2, y2) System.arraycopy(bandData, ((y2 - y) * w + (x2 - x)) * numDataElements, pixel, 0, numDataElements);
getDataElements
in class Raster
x
- The X coordinate of the upper left pixel location.y
- The Y coordinate of the upper left pixel location.width
- Width of the pixel rectangle.height
- Height of the pixel rectangle.outData
- An object reference to an array of type defined by
getTransferType() and length w*h*getNumDataElements(). If null
an array of appropriate type and size will be allocated.
public Object getDataElements(int actualX, int actualY, Object obj)
getDataElements
in class Raster
actualX
- The X coordinate of the pixel location.actualY
- The Y coordinate of the pixel location.outData
- An object reference to an array of type defined by
getTransferType() and length getNumDataElements(). If null an
array of appropriate type and size will be allocated.
public int getDataOffset(int band)
band
- The band whose offset is returned.public int[] getDataOffsets()
public byte[] getDataStorage()
public int[] getPixels(int x, int y, int w, int h, int[] iArray)
getPixels
in class Raster
public int getPixelStride()
public int getSample(int x, int y, int b)
getSample
in class Raster
public int[] getSamples(int x, int y, int w, int h, int b, int[] iArray)
getSamples
in class Raster
public int getScanlineStride()
public void putByteData(int x, int y, int w, int h, byte[] inData)
inData[((y2 - y) * w + (x2 - x)) * numDataElements + n]
x
- The X coordinate of the upper left pixel location.y
- The Y coordinate of the upper left pixel location.w
- Width of the pixel rectangle.h
- Height of the pixel rectangle.inData
- The data elements to be stored.public void putByteData(int x, int y, int w, int h, int band, byte[] inData)
inData[((y2 - y) * w + (x2 - x)) + n]
x
- The X coordinate of the upper left pixel location.y
- The Y coordinate of the upper left pixel location.w
- Width of the pixel rectangle.h
- Height of the pixel rectangle.band
- The band to set.inData
- The data elements to be stored.public void setDataElements(int x, int y, int w, int h, Object obj)
inData[((y2 - y) * w + (x2 - x)) * numDataElements + n]
setDataElements
in class WritableRaster
x
- The X coordinate of the upper left pixel location.y
- The Y coordinate of the upper left pixel location.w
- Width of the pixel rectangle.h
- Height of the pixel rectangle.inData
- An object reference to an array of type defined by
getTransferType() and length w*h*getNumDataElements()
containing the pixel data to place between x,y and x+h, y+h.public void setDataElements(int x, int y, Object obj)
setDataElements
in class WritableRaster
x
- The X coordinate of the pixel location.y
- The Y coordinate of the pixel location.inData
- An object reference to an array of type defined by
getTransferType() and length getNumDataElements() containing
the pixel data to place at x,y.public void setDataElements(int x, int y, Raster inRaster)
setDataElements
in class WritableRaster
x
- The X coordinate of the pixel location.y
- The Y coordinate of the pixel location.inRaster
- Raster of data to place at x,y location.public void setPixels(int x, int y, int w, int h, int[] iArray)
setPixels
in class WritableRaster
public void setRect(int dx, int dy, Raster srcRaster)
setRect
in class WritableRaster
public void setSample(int x, int y, int b, int s)
setSample
in class WritableRaster
public void setSamples(int x, int y, int w, int h, int b, int[] iArray)
setSamples
in class WritableRaster
public String toString()
toString
in class Object
|
intarsys CWT library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |