public WritableRaster createWritableChild(int x,int y,int width,int height,int x0,int y0,int bandList[]){
  if (x < this.minX) {
    throw new RasterFormatException("x lies outside raster");
  }
  if (y < this.minY) {
    throw new RasterFormatException("y lies outside raster");
  }
  if ((x + width < x) || (x + width > this.minX + this.width)) {
    throw new RasterFormatException("(x + width) is outside raster");
  }
  if ((y + height < y) || (y + height > this.minY + this.height)) {
    throw new RasterFormatException("(y + height) is outside raster");
  }
  SampleModel sm;
  if (bandList != null)   sm=sampleModel.createSubsetSampleModel(bandList);
 else   sm=sampleModel;
  int deltaX=x0 - x;
  int deltaY=y0 - y;
  return new IntegerComponentRaster(sm,dataBuffer,new Rectangle(x0,y0,width,height),new Point(sampleModelTranslateX + deltaX,sampleModelTranslateY + deltaY),this);
}

public WritableRaster createWritableChild ( int x , int y , int width , int height , int x0 , int y0 , int bandList [ ] ) { if ( x < this . minX ) { throw new RasterFormatException ( "x lies outside raster" ) ; } if ( y < this . minY ) { throw new RasterFormatException ( "y lies outside raster" ) ; } if ( ( x + width < x ) || ( x + width > this . minX + this . width ) ) { throw new RasterFormatException ( "(x + width) is outside raster" ) ; } if ( ( y + height < y ) || ( y + height > this . minY + this . height ) ) { throw new RasterFormatException ( "(y + height) is outside raster" ) ; } SampleModel sm ; if ( bandList != null ) sm = sampleModel . createSubsetSampleModel ( bandList ) ; else sm = sampleModel ; int deltaX = x0 - x ; int deltaY = y0 - y ; return new IntegerComponentRaster ( sm , dataBuffer , new Rectangle ( x0 , y0 , width , height ) , new Point ( sampleModelTranslateX + deltaX , sampleModelTranslateY + deltaY ) , this ) ; }
creates a subraster given a region of the raster . the x and y coordinates specify the horizontal and vertical offsets from the upper - left corner of this raster to the upper - left corner of the subraster . a subset of the bands of the parent raster may be specified . if this is null , then all the bands are present in the subraster . a translation to the subraster may also be specified . note that the subraster will reference the same databuffer as the parent raster , but using different offsets .
