Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / jssun / awt / image / IntegerComponentRaster.js
index 89e98a3..e824ff9 100644 (file)
-Clazz.declarePackage ("jssun.awt.image");\r
-Clazz.load (["jssun.awt.image.SunWritableRaster"], "jssun.awt.image.IntegerComponentRaster", ["java.lang.ArrayIndexOutOfBoundsException", "java.awt.Point", "$.Rectangle", "java.awt.image.DataBufferInt", "$.RasterFormatException", "$.SinglePixelPackedSampleModel"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.bandOffset = 0;\r
-this.dataOffsets = null;\r
-this.scanlineStride = 0;\r
-this.pixelStride = 0;\r
-this.data = null;\r
-this.numDataElems = 0;\r
-this.type = 0;\r
-this.maxX = 0;\r
-this.maxY = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, jssun.awt.image, "IntegerComponentRaster", jssun.awt.image.SunWritableRaster);\r
-Clazz.makeConstructor (c$, \r
-function (sampleModel, origin) {\r
-Clazz.superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);\r
-this.setIntCompRaster (sampleModel, sampleModel.createDataBuffer (),  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);\r
-}, "java.awt.image.SampleModel,java.awt.Point");\r
-Clazz.makeConstructor (c$, \r
-function (sampleModel, dataBuffer, origin) {\r
-Clazz.superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);\r
-this.setIntCompRaster (sampleModel, dataBuffer,  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);\r
-}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-Clazz.superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (sampleModel, dataBuffer, aRegion, origin, parent) {\r
-Clazz.superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);\r
-this.setIntCompRaster (sampleModel, dataBuffer, aRegion, origin, parent);\r
-}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");\r
-Clazz.defineMethod (c$, "setIntCompRaster", \r
-function (sampleModel, dataBuffer, aRegion, origin, parent) {\r
-this.setSunRaster (sampleModel, dataBuffer, aRegion, origin, parent);\r
-this.maxX = this.minX + this.width;\r
-this.maxY = this.minY + this.height;\r
-if (!(Clazz.instanceOf (dataBuffer, java.awt.image.DataBufferInt))) {\r
-throw  new java.awt.image.RasterFormatException ("IntegerComponentRasters must haveinteger DataBuffers");\r
-}var dbi = dataBuffer;\r
-if (dbi.getNumBanks () != 1) {\r
-throw  new java.awt.image.RasterFormatException ("DataBuffer for IntegerComponentRasters must only have 1 bank.");\r
-}this.data = jssun.awt.image.SunWritableRaster.stealData (dbi, 0);\r
-if (Clazz.instanceOf (sampleModel, java.awt.image.SinglePixelPackedSampleModel)) {\r
-var sppsm = sampleModel;\r
-var boffsets = sppsm.getBitOffsets ();\r
-var notByteBoundary = false;\r
-for (var i = 1; i < boffsets.length; i++) {\r
-if ((boffsets[i] % 8) != 0) {\r
-notByteBoundary = true;\r
-}}\r
-this.type = (notByteBoundary ? 9 : 10);\r
-this.scanlineStride = sppsm.getScanlineStride ();\r
-this.pixelStride = 1;\r
-this.dataOffsets =  Clazz.newIntArray (1, 0);\r
-this.dataOffsets[0] = dbi.getOffset ();\r
-this.bandOffset = this.dataOffsets[0];\r
-var xOffset = aRegion.x - origin.x;\r
-var yOffset = aRegion.y - origin.y;\r
-this.dataOffsets[0] += xOffset + yOffset * this.scanlineStride;\r
-this.numDataElems = sppsm.getNumDataElements ();\r
-} else {\r
-throw  new java.awt.image.RasterFormatException ("IntegerComponentRasters must have SinglePixelPackedSampleModel");\r
-}this.verify ();\r
-}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");\r
-Clazz.defineMethod (c$, "getDataOffsets", \r
-function () {\r
-return this.dataOffsets.clone ();\r
-});\r
-Clazz.defineMethod (c$, "getDataOffset", \r
-function (band) {\r
-return this.dataOffsets[band];\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getScanlineStride", \r
-function () {\r
-return this.scanlineStride;\r
-});\r
-Clazz.defineMethod (c$, "getPixelStride", \r
-function () {\r
-return this.pixelStride;\r
-});\r
-Clazz.defineMethod (c$, "getDataStorage", \r
-function () {\r
-return this.data;\r
-});\r
-Clazz.defineMethod (c$, "getDataElements", \r
-function (x, y, obj) {\r
-if ((x < this.minX) || (y < this.minY) || (x >= this.maxX) || (y >= this.maxY)) {\r
-throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");\r
-}var outData;\r
-if (obj == null) {\r
-outData =  Clazz.newIntArray (this.numDataElements, 0);\r
-} else {\r
-outData = obj;\r
-}var off = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;\r
-for (var band = 0; band < this.numDataElements; band++) {\r
-outData[band] = this.data[this.dataOffsets[band] + off];\r
-}\r
-return outData;\r
-}, "~N,~N,~O");\r
-Clazz.defineMethod (c$, "getDataElements", \r
-function (x, y, w, h, obj) {\r
-if ((x < this.minX) || (y < this.minY) || (x + w > this.maxX) || (y + h > this.maxY)) {\r
-throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");\r
-}var outData;\r
-if (Clazz.instanceOf (obj, Array)) {\r
-outData = obj;\r
-} else {\r
-outData =  Clazz.newIntArray (this.numDataElements * w * h, 0);\r
-}var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;\r
-var xoff;\r
-var off = 0;\r
-var xstart;\r
-var ystart;\r
-for (ystart = 0; ystart < h; ystart++, yoff += this.scanlineStride) {\r
-xoff = yoff;\r
-for (xstart = 0; xstart < w; xstart++, xoff += this.pixelStride) {\r
-for (var c = 0; c < this.numDataElements; c++) {\r
-outData[off++] = this.data[this.dataOffsets[c] + xoff];\r
-}\r
-}\r
-}\r
-return outData;\r
-}, "~N,~N,~N,~N,~O");\r
-Clazz.defineMethod (c$, "setDataElements", \r
-function (x, y, obj) {\r
-if ((x < this.minX) || (y < this.minY) || (x >= this.maxX) || (y >= this.maxY)) {\r
-throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");\r
-}var inData = obj;\r
-var off = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;\r
-for (var i = 0; i < this.numDataElements; i++) {\r
-this.data[this.dataOffsets[i] + off] = inData[i];\r
-}\r
-this.markDirty ();\r
-}, "~N,~N,~O");\r
-Clazz.overrideMethod (c$, "setDataElementsRaster", \r
-function (x, y, inRaster) {\r
-var dstOffX = x + inRaster.getMinX ();\r
-var dstOffY = y + inRaster.getMinY ();\r
-var width = inRaster.getWidth ();\r
-var height = inRaster.getHeight ();\r
-if ((dstOffX < this.minX) || (dstOffY < this.minY) || (dstOffX + width > this.maxX) || (dstOffY + height > this.maxY)) {\r
-throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");\r
-}this.setDataElementsRaster4 (dstOffX, dstOffY, width, height, inRaster);\r
-}, "~N,~N,java.awt.image.Raster");\r
-Clazz.defineMethod (c$, "setDataElementsRaster4", \r
- function (dstX, dstY, width, height, inRaster) {\r
-if (width <= 0 || height <= 0) {\r
-return;\r
-}var srcOffX = inRaster.getMinX ();\r
-var srcOffY = inRaster.getMinY ();\r
-var tdata = null;\r
-if (Clazz.instanceOf (inRaster, jssun.awt.image.IntegerComponentRaster) && (this.pixelStride == 1) && (this.numDataElements == 1)) {\r
-var ict = inRaster;\r
-if (ict.getNumDataElements () != 1) {\r
-throw  new ArrayIndexOutOfBoundsException ("Number of bands does not match");\r
-}tdata = ict.getDataStorage ();\r
-var tss = ict.getScanlineStride ();\r
-var toff = ict.getDataOffset (0);\r
-var srcOffset = toff;\r
-var dstOffset = this.dataOffsets[0] + (dstY - this.minY) * this.scanlineStride + (dstX - this.minX);\r
-if (ict.getPixelStride () == this.pixelStride) {\r
-width *= this.pixelStride;\r
-for (var startY = 0; startY < height; startY++) {\r
-System.arraycopy (tdata, srcOffset, this.data, dstOffset, width);\r
-srcOffset += tss;\r
-dstOffset += this.scanlineStride;\r
-}\r
-this.markDirty ();\r
-return;\r
-}}var odata = null;\r
-for (var startY = 0; startY < height; startY++) {\r
-odata = inRaster.getDataElements (srcOffX, srcOffY + startY, width, 1, odata);\r
-this.setDataElements (dstX, dstY + startY, width, 1, odata);\r
-}\r
-}, "~N,~N,~N,~N,java.awt.image.Raster");\r
-Clazz.defineMethod (c$, "setDataElements", \r
-function (x, y, w, h, obj) {\r
-if ((x < this.minX) || (y < this.minY) || (x + w > this.maxX) || (y + h > this.maxY)) {\r
-throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");\r
-}var inData = obj;\r
-var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;\r
-var xoff;\r
-var off = 0;\r
-var xstart;\r
-var ystart;\r
-for (ystart = 0; ystart < h; ystart++, yoff += this.scanlineStride) {\r
-xoff = yoff;\r
-for (xstart = 0; xstart < w; xstart++, xoff += this.pixelStride) {\r
-for (var c = 0; c < this.numDataElements; c++) {\r
-this.data[this.dataOffsets[c] + xoff] = inData[off++];\r
-}\r
-}\r
-}\r
-this.markDirty ();\r
-}, "~N,~N,~N,~N,~O");\r
-Clazz.overrideMethod (c$, "createWritableChild", \r
-function (x, y, width, height, x0, y0, bandList) {\r
-if (x < this.minX) {\r
-throw  new java.awt.image.RasterFormatException ("x lies outside raster");\r
-}if (y < this.minY) {\r
-throw  new java.awt.image.RasterFormatException ("y lies outside raster");\r
-}if ((x + width < x) || (x + width > this.minX + this.width)) {\r
-throw  new java.awt.image.RasterFormatException ("(x + width) is outside raster");\r
-}if ((y + height < y) || (y + height > this.minY + this.height)) {\r
-throw  new java.awt.image.RasterFormatException ("(y + height) is outside raster");\r
-}var sm;\r
-if (bandList != null) sm = this.sampleModel.createSubsetSampleModel (bandList);\r
- else sm = this.sampleModel;\r
-var deltaX = x0 - x;\r
-var deltaY = y0 - y;\r
-return  new jssun.awt.image.IntegerComponentRaster (sm, this.dataBuffer,  new java.awt.Rectangle (x0, y0, width, height),  new java.awt.Point (this.sampleModelTranslateX + deltaX, this.sampleModelTranslateY + deltaY), this);\r
-}, "~N,~N,~N,~N,~N,~N,~A");\r
-Clazz.overrideMethod (c$, "createChild", \r
-function (x, y, width, height, x0, y0, bandList) {\r
-return this.createWritableChild (x, y, width, height, x0, y0, bandList);\r
-}, "~N,~N,~N,~N,~N,~N,~A");\r
-Clazz.defineMethod (c$, "createCompatibleWritableRaster", \r
-function (w, h) {\r
-if (w <= 0 || h <= 0) {\r
-throw  new java.awt.image.RasterFormatException ("negative " + ((w <= 0) ? "width" : "height"));\r
-}var sm = this.sampleModel.createCompatibleSampleModel (w, h);\r
-return  new jssun.awt.image.IntegerComponentRaster (sm,  new java.awt.Point (0, 0));\r
-}, "~N,~N");\r
-Clazz.defineMethod (c$, "createCompatibleWritableRaster", \r
-function () {\r
-return this.createCompatibleWritableRaster (this.width, this.height);\r
-});\r
-Clazz.defineMethod (c$, "verify", \r
-function () {\r
-if (this.width <= 0 || this.height <= 0 || this.height > (Clazz.doubleToInt (2147483647 / this.width))) {\r
-throw  new java.awt.image.RasterFormatException ("Invalid raster dimension");\r
-}if (this.dataOffsets[0] < 0) {\r
-throw  new java.awt.image.RasterFormatException ("Data offset (" + this.dataOffsets[0] + ") must be >= 0");\r
-}if (this.minX - this.sampleModelTranslateX < 0 || this.minY - this.sampleModelTranslateY < 0) {\r
-throw  new java.awt.image.RasterFormatException ("Incorrect origin/translate: (" + this.minX + ", " + this.minY + ") / (" + this.sampleModelTranslateX + ", " + this.sampleModelTranslateY + ")");\r
-}if (this.scanlineStride < 0 || this.scanlineStride > (Clazz.doubleToInt (2147483647 / this.height))) {\r
-throw  new java.awt.image.RasterFormatException ("Incorrect scanline stride: " + this.scanlineStride);\r
-}if (this.height > 1 || this.minY - this.sampleModelTranslateY > 0) {\r
-if (this.scanlineStride > this.data.length) {\r
-throw  new java.awt.image.RasterFormatException ("Incorrect scanline stride: " + this.scanlineStride);\r
-}}var lastScanOffset = (this.height - 1) * this.scanlineStride;\r
-if (this.pixelStride < 0 || this.pixelStride > (Clazz.doubleToInt (2147483647 / this.width)) || this.pixelStride > this.data.length) {\r
-throw  new java.awt.image.RasterFormatException ("Incorrect pixel stride: " + this.pixelStride);\r
-}var lastPixelOffset = (this.width - 1) * this.pixelStride;\r
-if (lastPixelOffset > (2147483647 - lastScanOffset)) {\r
-throw  new java.awt.image.RasterFormatException ("Incorrect raster attributes");\r
-}lastPixelOffset += lastScanOffset;\r
-var index;\r
-var maxIndex = 0;\r
-for (var i = 0; i < this.numDataElements; i++) {\r
-if (this.dataOffsets[i] > (2147483647 - lastPixelOffset)) {\r
-throw  new java.awt.image.RasterFormatException ("Incorrect band offset: " + this.dataOffsets[i]);\r
-}index = lastPixelOffset + this.dataOffsets[i];\r
-if (index > maxIndex) {\r
-maxIndex = index;\r
-}}\r
-if (this.data.length <= maxIndex) {\r
-throw  new java.awt.image.RasterFormatException ("Data array too small (should be > " + maxIndex + " )");\r
-}});\r
-Clazz.overrideMethod (c$, "toString", \r
-function () {\r
-return  String.instantialize ("IntegerComponentRaster: width = " + this.width + " height = " + this.height + " #Bands = " + this.numBands + " #DataElements " + this.numDataElements + " xOff = " + this.sampleModelTranslateX + " yOff = " + this.sampleModelTranslateY + " dataOffset[0] " + this.dataOffsets[0]);\r
-});\r
-Clazz.defineStatics (c$,\r
-"TYPE_CUSTOM", 0,\r
-"TYPE_BYTE_SAMPLES", 1,\r
-"TYPE_USHORT_SAMPLES", 2,\r
-"TYPE_INT_SAMPLES", 3,\r
-"TYPE_BYTE_BANDED_SAMPLES", 4,\r
-"TYPE_USHORT_BANDED_SAMPLES", 5,\r
-"TYPE_INT_BANDED_SAMPLES", 6,\r
-"TYPE_BYTE_PACKED_SAMPLES", 7,\r
-"TYPE_USHORT_PACKED_SAMPLES", 8,\r
-"TYPE_INT_PACKED_SAMPLES", 9,\r
-"TYPE_INT_8BIT_SAMPLES", 10,\r
-"TYPE_BYTE_BINARY_SAMPLES", 11);\r
-});\r
+Clazz.declarePackage ("jssun.awt.image");
+Clazz.load (["jssun.awt.image.SunWritableRaster"], "jssun.awt.image.IntegerComponentRaster", ["java.lang.ArrayIndexOutOfBoundsException", "java.awt.Point", "$.Rectangle", "java.awt.image.DataBufferInt", "$.RasterFormatException", "$.SinglePixelPackedSampleModel"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.bandOffset = 0;
+this.dataOffsets = null;
+this.scanlineStride = 0;
+this.pixelStride = 0;
+this.data = null;
+this.numDataElems = 0;
+this.type = 0;
+this.maxX = 0;
+this.maxY = 0;
+Clazz.instantialize (this, arguments);
+}, jssun.awt.image, "IntegerComponentRaster", jssun.awt.image.SunWritableRaster);
+Clazz.makeConstructor (c$, 
+function (sampleModel, origin) {
+Clazz.superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
+this.setIntCompRaster (sampleModel, sampleModel.createDataBuffer (),  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
+}, "java.awt.image.SampleModel,java.awt.Point");
+Clazz.makeConstructor (c$, 
+function (sampleModel, dataBuffer, origin) {
+Clazz.superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
+this.setIntCompRaster (sampleModel, dataBuffer,  new java.awt.Rectangle (origin.x, origin.y, sampleModel.getWidth (), sampleModel.getHeight ()), origin, null);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Point");
+Clazz.makeConstructor (c$, 
+function () {
+Clazz.superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
+});
+Clazz.makeConstructor (c$, 
+function (sampleModel, dataBuffer, aRegion, origin, parent) {
+Clazz.superConstructor (this, jssun.awt.image.IntegerComponentRaster, []);
+this.setIntCompRaster (sampleModel, dataBuffer, aRegion, origin, parent);
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
+Clazz.defineMethod (c$, "setIntCompRaster", 
+function (sampleModel, dataBuffer, aRegion, origin, parent) {
+this.setSunRaster (sampleModel, dataBuffer, aRegion, origin, parent);
+this.maxX = this.minX + this.width;
+this.maxY = this.minY + this.height;
+if (!(Clazz.instanceOf (dataBuffer, java.awt.image.DataBufferInt))) {
+throw  new java.awt.image.RasterFormatException ("IntegerComponentRasters must haveinteger DataBuffers");
+}var dbi = dataBuffer;
+if (dbi.getNumBanks () != 1) {
+throw  new java.awt.image.RasterFormatException ("DataBuffer for IntegerComponentRasters must only have 1 bank.");
+}this.data = jssun.awt.image.SunWritableRaster.stealData (dbi, 0);
+if (Clazz.instanceOf (sampleModel, java.awt.image.SinglePixelPackedSampleModel)) {
+var sppsm = sampleModel;
+var boffsets = sppsm.getBitOffsets ();
+var notByteBoundary = false;
+for (var i = 1; i < boffsets.length; i++) {
+if ((boffsets[i] % 8) != 0) {
+notByteBoundary = true;
+}}
+this.type = (notByteBoundary ? 9 : 10);
+this.scanlineStride = sppsm.getScanlineStride ();
+this.pixelStride = 1;
+this.dataOffsets =  Clazz.newIntArray (1, 0);
+this.dataOffsets[0] = dbi.getOffset ();
+this.bandOffset = this.dataOffsets[0];
+var xOffset = aRegion.x - origin.x;
+var yOffset = aRegion.y - origin.y;
+this.dataOffsets[0] += xOffset + yOffset * this.scanlineStride;
+this.numDataElems = sppsm.getNumDataElements ();
+} else {
+throw  new java.awt.image.RasterFormatException ("IntegerComponentRasters must have SinglePixelPackedSampleModel");
+}this.verify ();
+}, "java.awt.image.SampleModel,java.awt.image.DataBuffer,java.awt.Rectangle,java.awt.Point,java.awt.image.Raster");
+Clazz.defineMethod (c$, "getDataOffsets", 
+function () {
+return this.dataOffsets.clone ();
+});
+Clazz.defineMethod (c$, "getDataOffset", 
+function (band) {
+return this.dataOffsets[band];
+}, "~N");
+Clazz.defineMethod (c$, "getScanlineStride", 
+function () {
+return this.scanlineStride;
+});
+Clazz.defineMethod (c$, "getPixelStride", 
+function () {
+return this.pixelStride;
+});
+Clazz.defineMethod (c$, "getDataStorage", 
+function () {
+return this.data;
+});
+Clazz.defineMethod (c$, "getDataElements", 
+function (x, y, obj) {
+if ((x < this.minX) || (y < this.minY) || (x >= this.maxX) || (y >= this.maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var outData;
+if (obj == null) {
+outData =  Clazz.newIntArray (this.numDataElements, 0);
+} else {
+outData = obj;
+}var off = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
+for (var band = 0; band < this.numDataElements; band++) {
+outData[band] = this.data[this.dataOffsets[band] + off];
+}
+return outData;
+}, "~N,~N,~O");
+Clazz.defineMethod (c$, "getDataElements", 
+function (x, y, w, h, obj) {
+if ((x < this.minX) || (y < this.minY) || (x + w > this.maxX) || (y + h > this.maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var outData;
+if (Clazz.instanceOf (obj, Array)) {
+outData = obj;
+} else {
+outData =  Clazz.newIntArray (this.numDataElements * w * h, 0);
+}var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
+var xoff;
+var off = 0;
+var xstart;
+var ystart;
+for (ystart = 0; ystart < h; ystart++, yoff += this.scanlineStride) {
+xoff = yoff;
+for (xstart = 0; xstart < w; xstart++, xoff += this.pixelStride) {
+for (var c = 0; c < this.numDataElements; c++) {
+outData[off++] = this.data[this.dataOffsets[c] + xoff];
+}
+}
+}
+return outData;
+}, "~N,~N,~N,~N,~O");
+Clazz.defineMethod (c$, "setDataElements", 
+function (x, y, obj) {
+if ((x < this.minX) || (y < this.minY) || (x >= this.maxX) || (y >= this.maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var inData = obj;
+var off = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
+for (var i = 0; i < this.numDataElements; i++) {
+this.data[this.dataOffsets[i] + off] = inData[i];
+}
+this.markDirty ();
+}, "~N,~N,~O");
+Clazz.overrideMethod (c$, "setDataElementsRaster", 
+function (x, y, inRaster) {
+var dstOffX = x + inRaster.getMinX ();
+var dstOffY = y + inRaster.getMinY ();
+var width = inRaster.getWidth ();
+var height = inRaster.getHeight ();
+if ((dstOffX < this.minX) || (dstOffY < this.minY) || (dstOffX + width > this.maxX) || (dstOffY + height > this.maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}this.setDataElementsRaster4 (dstOffX, dstOffY, width, height, inRaster);
+}, "~N,~N,java.awt.image.Raster");
+Clazz.defineMethod (c$, "setDataElementsRaster4", 
+ function (dstX, dstY, width, height, inRaster) {
+if (width <= 0 || height <= 0) {
+return;
+}var srcOffX = inRaster.getMinX ();
+var srcOffY = inRaster.getMinY ();
+var tdata = null;
+if (Clazz.instanceOf (inRaster, jssun.awt.image.IntegerComponentRaster) && (this.pixelStride == 1) && (this.numDataElements == 1)) {
+var ict = inRaster;
+if (ict.getNumDataElements () != 1) {
+throw  new ArrayIndexOutOfBoundsException ("Number of bands does not match");
+}tdata = ict.getDataStorage ();
+var tss = ict.getScanlineStride ();
+var toff = ict.getDataOffset (0);
+var srcOffset = toff;
+var dstOffset = this.dataOffsets[0] + (dstY - this.minY) * this.scanlineStride + (dstX - this.minX);
+if (ict.getPixelStride () == this.pixelStride) {
+width *= this.pixelStride;
+for (var startY = 0; startY < height; startY++) {
+System.arraycopy (tdata, srcOffset, this.data, dstOffset, width);
+srcOffset += tss;
+dstOffset += this.scanlineStride;
+}
+this.markDirty ();
+return;
+}}var odata = null;
+for (var startY = 0; startY < height; startY++) {
+odata = inRaster.getDataElements (srcOffX, srcOffY + startY, width, 1, odata);
+this.setDataElements (dstX, dstY + startY, width, 1, odata);
+}
+}, "~N,~N,~N,~N,java.awt.image.Raster");
+Clazz.defineMethod (c$, "setDataElements", 
+function (x, y, w, h, obj) {
+if ((x < this.minX) || (y < this.minY) || (x + w > this.maxX) || (y + h > this.maxY)) {
+throw  new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!");
+}var inData = obj;
+var yoff = (y - this.minY) * this.scanlineStride + (x - this.minX) * this.pixelStride;
+var xoff;
+var off = 0;
+var xstart;
+var ystart;
+for (ystart = 0; ystart < h; ystart++, yoff += this.scanlineStride) {
+xoff = yoff;
+for (xstart = 0; xstart < w; xstart++, xoff += this.pixelStride) {
+for (var c = 0; c < this.numDataElements; c++) {
+this.data[this.dataOffsets[c] + xoff] = inData[off++];
+}
+}
+}
+this.markDirty ();
+}, "~N,~N,~N,~N,~O");
+Clazz.overrideMethod (c$, "createWritableChild", 
+function (x, y, width, height, x0, y0, bandList) {
+if (x < this.minX) {
+throw  new java.awt.image.RasterFormatException ("x lies outside raster");
+}if (y < this.minY) {
+throw  new java.awt.image.RasterFormatException ("y lies outside raster");
+}if ((x + width < x) || (x + width > this.minX + this.width)) {
+throw  new java.awt.image.RasterFormatException ("(x + width) is outside raster");
+}if ((y + height < y) || (y + height > this.minY + this.height)) {
+throw  new java.awt.image.RasterFormatException ("(y + height) is outside raster");
+}var sm;
+if (bandList != null) sm = this.sampleModel.createSubsetSampleModel (bandList);
+ else sm = this.sampleModel;
+var deltaX = x0 - x;
+var deltaY = y0 - y;
+return  new jssun.awt.image.IntegerComponentRaster (sm, this.dataBuffer,  new java.awt.Rectangle (x0, y0, width, height),  new java.awt.Point (this.sampleModelTranslateX + deltaX, this.sampleModelTranslateY + deltaY), this);
+}, "~N,~N,~N,~N,~N,~N,~A");
+Clazz.overrideMethod (c$, "createChild", 
+function (x, y, width, height, x0, y0, bandList) {
+return this.createWritableChild (x, y, width, height, x0, y0, bandList);
+}, "~N,~N,~N,~N,~N,~N,~A");
+Clazz.defineMethod (c$, "createCompatibleWritableRaster", 
+function (w, h) {
+if (w <= 0 || h <= 0) {
+throw  new java.awt.image.RasterFormatException ("negative " + ((w <= 0) ? "width" : "height"));
+}var sm = this.sampleModel.createCompatibleSampleModel (w, h);
+return  new jssun.awt.image.IntegerComponentRaster (sm,  new java.awt.Point (0, 0));
+}, "~N,~N");
+Clazz.defineMethod (c$, "createCompatibleWritableRaster", 
+function () {
+return this.createCompatibleWritableRaster (this.width, this.height);
+});
+Clazz.defineMethod (c$, "verify", 
+function () {
+if (this.width <= 0 || this.height <= 0 || this.height > (Clazz.doubleToInt (2147483647 / this.width))) {
+throw  new java.awt.image.RasterFormatException ("Invalid raster dimension");
+}if (this.dataOffsets[0] < 0) {
+throw  new java.awt.image.RasterFormatException ("Data offset (" + this.dataOffsets[0] + ") must be >= 0");
+}if (this.minX - this.sampleModelTranslateX < 0 || this.minY - this.sampleModelTranslateY < 0) {
+throw  new java.awt.image.RasterFormatException ("Incorrect origin/translate: (" + this.minX + ", " + this.minY + ") / (" + this.sampleModelTranslateX + ", " + this.sampleModelTranslateY + ")");
+}if (this.scanlineStride < 0 || this.scanlineStride > (Clazz.doubleToInt (2147483647 / this.height))) {
+throw  new java.awt.image.RasterFormatException ("Incorrect scanline stride: " + this.scanlineStride);
+}if (this.height > 1 || this.minY - this.sampleModelTranslateY > 0) {
+if (this.scanlineStride > this.data.length) {
+throw  new java.awt.image.RasterFormatException ("Incorrect scanline stride: " + this.scanlineStride);
+}}var lastScanOffset = (this.height - 1) * this.scanlineStride;
+if (this.pixelStride < 0 || this.pixelStride > (Clazz.doubleToInt (2147483647 / this.width)) || this.pixelStride > this.data.length) {
+throw  new java.awt.image.RasterFormatException ("Incorrect pixel stride: " + this.pixelStride);
+}var lastPixelOffset = (this.width - 1) * this.pixelStride;
+if (lastPixelOffset > (2147483647 - lastScanOffset)) {
+throw  new java.awt.image.RasterFormatException ("Incorrect raster attributes");
+}lastPixelOffset += lastScanOffset;
+var index;
+var maxIndex = 0;
+for (var i = 0; i < this.numDataElements; i++) {
+if (this.dataOffsets[i] > (2147483647 - lastPixelOffset)) {
+throw  new java.awt.image.RasterFormatException ("Incorrect band offset: " + this.dataOffsets[i]);
+}index = lastPixelOffset + this.dataOffsets[i];
+if (index > maxIndex) {
+maxIndex = index;
+}}
+if (this.data.length <= maxIndex) {
+throw  new java.awt.image.RasterFormatException ("Data array too small (should be > " + maxIndex + " )");
+}});
+Clazz.overrideMethod (c$, "toString", 
+function () {
+return  String.instantialize ("IntegerComponentRaster: width = " + this.width + " height = " + this.height + " #Bands = " + this.numBands + " #DataElements " + this.numDataElements + " xOff = " + this.sampleModelTranslateX + " yOff = " + this.sampleModelTranslateY + " dataOffset[0] " + this.dataOffsets[0]);
+});
+Clazz.defineStatics (c$,
+"TYPE_CUSTOM", 0,
+"TYPE_BYTE_SAMPLES", 1,
+"TYPE_USHORT_SAMPLES", 2,
+"TYPE_INT_SAMPLES", 3,
+"TYPE_BYTE_BANDED_SAMPLES", 4,
+"TYPE_USHORT_BANDED_SAMPLES", 5,
+"TYPE_INT_BANDED_SAMPLES", 6,
+"TYPE_BYTE_PACKED_SAMPLES", 7,
+"TYPE_USHORT_PACKED_SAMPLES", 8,
+"TYPE_INT_PACKED_SAMPLES", 9,
+"TYPE_INT_8BIT_SAMPLES", 10,
+"TYPE_BYTE_BINARY_SAMPLES", 11);
+});