JavaTM 2 Platform
Std. Ed. v1.3.1

java.awt.image
Class MacWritableIntRaster

java.lang.Object
  |
  +--java.awt.image.Raster
        |
        +--java.awt.image.WritableRaster
              |
              +--java.awt.image.MacWritableIntRaster

public class MacWritableIntRaster
extends WritableRaster


Field Summary
protected  int pixelStride
          Pixel stride of the image data contained in this Raster.
protected  int scanlineStride
          Scanline stride of the image data contained in this Raster.
 
Fields inherited from class java.awt.image.Raster
dataBuffer, height, minX, minY, numBands, numDataElements, parent, sampleModel, sampleModelTranslateX, sampleModelTranslateY, width
 
Constructor Summary
MacWritableIntRaster(SampleModel sampleModel, DataBuffer inDataBuffer, Point origin)
           
MacWritableIntRaster(SampleModel sampleModel, DataBuffer dataBuffer, Rectangle childbounds, Point origin, MacWritableIntRaster parent)
           
MacWritableIntRaster(SampleModel sampleModel, Point origin)
           
 
Method Summary
 WritableRaster createCompatibleWritableRaster()
          Create a compatible WritableRaster the same size as this Raster with the same SampleModel and a new initialized DataBuffer.
 WritableRaster createCompatibleWritableRaster(int w, int h)
          Create a compatible WritableRaster with the specified size, a new SampleModel, and a new initialized DataBuffer.
 WritableRaster createCompatibleWritableRaster(int x, int y, int w, int h)
          Create a compatible WritableRaster with the specified location (minX, minY) and size (width, height), a new SampleModel, and a new initialized DataBuffer.
 WritableRaster createCompatibleWritableRaster(Rectangle rect)
          Create a compatible WritableRaster with location (minX, minY) and size (width, height) specified by rect, a new SampleModel, and a new initialized DataBuffer.
 WritableRaster createWritableChild(int parentX, int parentY, int width, int height, int childMinX, int childMinY, int[] bandList)
          Returns a new WritableRaster which shares all or part of this WritableRaster's DataBuffer.
 Object getDataElements(int x, int y, int w, int h, Object obj)
          Returns the pixel data for the specified rectangle of pixels in a primitive array of type TransferType.
 int getDataOffset(int inBank)
           
 int getScanlineStride()
           
 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)
          Sets the data for a single pixel from a primitive array of type TransferType.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.awt.image.WritableRaster
createWritableTranslatedChild, getWritableParent, setDataElements, setPixel, setPixel, setPixel, setPixels, setPixels, setPixels, setRect, setRect, setSample, setSample, setSample, setSamples, setSamples, setSamples
 
Methods inherited from class java.awt.image.Raster
createBandedRaster, createBandedRaster, createBandedRaster, createChild, createInterleavedRaster, createInterleavedRaster, createInterleavedRaster, createPackedRaster, createPackedRaster, createPackedRaster, createPackedRaster, createRaster, createTranslatedChild, createWritableRaster, createWritableRaster, getBounds, getDataBuffer, getDataElements, getHeight, getMinX, getMinY, getNumBands, getNumDataElements, getParent, getPixel, getPixel, getPixel, getPixels, getPixels, getPixels, getSample, getSampleDouble, getSampleFloat, getSampleModel, getSampleModelTranslateX, getSampleModelTranslateY, getSamples, getSamples, getSamples, getTransferType, getWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

scanlineStride

protected int scanlineStride
Scanline stride of the image data contained in this Raster.

pixelStride

protected int pixelStride
Pixel stride of the image data contained in this Raster.
Constructor Detail

MacWritableIntRaster

public MacWritableIntRaster(SampleModel sampleModel,
                            Point origin)

MacWritableIntRaster

public MacWritableIntRaster(SampleModel sampleModel,
                            DataBuffer dataBuffer,
                            Rectangle childbounds,
                            Point origin,
                            MacWritableIntRaster parent)

MacWritableIntRaster

public MacWritableIntRaster(SampleModel sampleModel,
                            DataBuffer inDataBuffer,
                            Point origin)
Method Detail

setDataElements

public void setDataElements(int x,
                            int y,
                            int w,
                            int h,
                            Object obj)
Stores an array of data elements into the specified rectangular region. There will be no explicit bounds checking on the parameters. An ArrayOutOfBounds exception will be thrown at runtime if data outside of the array is accessed. A ClassCastException will be thrown if the input object is non null and references anything other than an array of transferType. The data elements in the data array are assumed to be packed. That is, a data element for the nth band at location (x2, y2) would be found at:
      inData[((y2-y)*w + (x2-x))*numDataElements + n]
 
Overrides:
setDataElements in class WritableRaster
Parameters:
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.

setDataElements

public void setDataElements(int x,
                            int y,
                            Object obj)
Description copied from class: WritableRaster
Sets the data for a single pixel from a primitive array of type TransferType. For image data supported by the Java 2D(tm) API, this will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT. Data in the array may be in a packed format, thus increasing efficiency for data transfers. There will be no explicit bounds checking on the parameters. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds, or if inData is not large enough to hold the pixel data. A ClassCastException will be thrown if the input object is not null and references anything other than an array of TransferType.
Overrides:
setDataElements in class WritableRaster
Following copied from class: java.awt.image.WritableRaster
Parameters:
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.
See Also:
SampleModel.setDataElements(int, int, Object, DataBuffer)

getScanlineStride

public int getScanlineStride()

getDataOffset

public int getDataOffset(int inBank)

getDataElements

public Object getDataElements(int x,
                              int y,
                              int w,
                              int h,
                              Object obj)
Description copied from class: Raster
Returns the pixel data for the specified rectangle of pixels in a primitive array of type TransferType. For image data supported by the Java 2D API, this will be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or DataBuffer.TYPE_INT. Data may be returned in a packed format, thus increasing efficiency for data transfers. There will be no explicit bounds checking on the parameters. An ArrayIndexOutOfBoundsException may be thrown if the coordinates are not in bounds. A ClassCastException will be thrown if the input object is non null and references anything other than an array of TransferType.
Overrides:
getDataElements in class Raster
Following copied from class: java.awt.image.Raster
Parameters:
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.
Returns:
An object reference to an array of type defined by getTransferType() with the requested pixel data.
See Also:
SampleModel.getDataElements(int, int, int, int, Object, DataBuffer)

createCompatibleWritableRaster

public WritableRaster createCompatibleWritableRaster()
Create a compatible WritableRaster the same size as this Raster with the same SampleModel and a new initialized DataBuffer.
Overrides:
createCompatibleWritableRaster in class Raster

createCompatibleWritableRaster

public WritableRaster createCompatibleWritableRaster(int w,
                                                     int h)
Create a compatible WritableRaster with the specified size, a new SampleModel, and a new initialized DataBuffer.
Overrides:
createCompatibleWritableRaster in class Raster
Throws:
RasterFormatException - if the width or height is less than or equal to zero.

createCompatibleWritableRaster

public WritableRaster createCompatibleWritableRaster(Rectangle rect)
Create a compatible WritableRaster with location (minX, minY) and size (width, height) specified by rect, a new SampleModel, and a new initialized DataBuffer.
Overrides:
createCompatibleWritableRaster in class Raster

createCompatibleWritableRaster

public WritableRaster createCompatibleWritableRaster(int x,
                                                     int y,
                                                     int w,
                                                     int h)
Create a compatible WritableRaster with the specified location (minX, minY) and size (width, height), a new SampleModel, and a new initialized DataBuffer.
Overrides:
createCompatibleWritableRaster in class Raster

createWritableChild

public WritableRaster createWritableChild(int parentX,
                                          int parentY,
                                          int width,
                                          int height,
                                          int childMinX,
                                          int childMinY,
                                          int[] bandList)
Returns a new WritableRaster which shares all or part of this WritableRaster's DataBuffer. The new WritableRaster will possess a reference to the current WritableRaster, accessible through its getParent() and getWritableParent() methods.

The parentX, parentY, width and height parameters 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 current WritableRaster.

The new WritableRaster may additionally be translated to a different coordinate system for the plane than that used by the current 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 current WritableRaster.

The new WritableRaster may be defined to contain only a subset of the bands of the current WritableRaster, possibly reordered, by means of the bandList parameter. If bandList is null, it is taken to include all of the bands of the current WritableRaster in their current order.

To create a new WritableRaster that contains a subregion of the current 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.

Overrides:
createWritableChild in class WritableRaster
Parameters:
parentX - X coordinate of the upper left corner in this WritableRaster's coordinates.
parentY - Y coordinate of the upper left corner in this WritableRaster's coordinates.
width - Width of the region starting at (parentX, parentY).
height - Height of the region starting at (parentX, parentY).
childMinX - X coordinate of the upper left corner of the returned WritableRaster.
childMinY - Y coordinate of the upper left corner of the returned WritableRaster.
bandList - Array of band indices, or null to use all bands.
Throws:
RasterFormatException - if the subregion is outside of the raster bounds.

toString

public String toString()
Description copied from class: Object
Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 
Overrides:
toString in class Object
Following copied from class: java.lang.Object
Returns:
a string representation of the object.

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.