@Test public void testExtendUShort() { WritableRaster raster = createRaster(DataBuffer.TYPE_USHORT); RandomBorderExtender ex = new RandomBorderExtender(-10, 10); ex.extend(raster, sourceImage); checkResultAsInt(raster, sourceImage.getBounds(), 0, 10); }
@Override public void extend(WritableRaster raster, PlanarImage sourceImage) { int dataType = raster.getSampleModel().getDataType(); switch (dataType) { case DataBuffer.TYPE_BYTE: extendAsByte(raster, sourceImage); break; case DataBuffer.TYPE_SHORT: extendAsShort(raster, sourceImage); break; case DataBuffer.TYPE_USHORT: extendAsUShort(raster, sourceImage); break; case DataBuffer.TYPE_INT: extendAsInt(raster, sourceImage); break; case DataBuffer.TYPE_FLOAT: extendAsFloat(raster, sourceImage); break; case DataBuffer.TYPE_DOUBLE: extendAsDouble(raster, sourceImage); break; default: throw new UnsupportedOperationException("Unsupported data type"); } }
RandomBorderExtender extends BorderExtender { @Override public void extend(WritableRaster raster, PlanarImage sourceImage) { int dataType = raster.getSampleModel().getDataType(); switch (dataType) { case DataBuffer.TYPE_BYTE: extendAsByte(raster, sourceImage); break; case DataBuffer.TYPE_SHORT: extendAsShort(raster, sourceImage); break; case DataBuffer.TYPE_USHORT: extendAsUShort(raster, sourceImage); break; case DataBuffer.TYPE_INT: extendAsInt(raster, sourceImage); break; case DataBuffer.TYPE_FLOAT: extendAsFloat(raster, sourceImage); break; case DataBuffer.TYPE_DOUBLE: extendAsDouble(raster, sourceImage); break; default: throw new UnsupportedOperationException("Unsupported data type"); } } }
RandomBorderExtender extends BorderExtender { @Override public void extend(WritableRaster raster, PlanarImage sourceImage) { int dataType = raster.getSampleModel().getDataType(); switch (dataType) { case DataBuffer.TYPE_BYTE: extendAsByte(raster, sourceImage); break; case DataBuffer.TYPE_SHORT: extendAsShort(raster, sourceImage); break; case DataBuffer.TYPE_USHORT: extendAsUShort(raster, sourceImage); break; case DataBuffer.TYPE_INT: extendAsInt(raster, sourceImage); break; case DataBuffer.TYPE_FLOAT: extendAsFloat(raster, sourceImage); break; case DataBuffer.TYPE_DOUBLE: extendAsDouble(raster, sourceImage); break; default: throw new UnsupportedOperationException("Unsupported data type"); } } RandomBorderExtender(Number minValue, Number maxValue); }
RandomBorderExtender extends BorderExtender { @Override public void extend(WritableRaster raster, PlanarImage sourceImage) { int dataType = raster.getSampleModel().getDataType(); switch (dataType) { case DataBuffer.TYPE_BYTE: extendAsByte(raster, sourceImage); break; case DataBuffer.TYPE_SHORT: extendAsShort(raster, sourceImage); break; case DataBuffer.TYPE_USHORT: extendAsUShort(raster, sourceImage); break; case DataBuffer.TYPE_INT: extendAsInt(raster, sourceImage); break; case DataBuffer.TYPE_FLOAT: extendAsFloat(raster, sourceImage); break; case DataBuffer.TYPE_DOUBLE: extendAsDouble(raster, sourceImage); break; default: throw new UnsupportedOperationException("Unsupported data type"); } } RandomBorderExtender(Number minValue, Number maxValue); @Override void extend(WritableRaster raster, PlanarImage sourceImage); }
RandomBorderExtender extends BorderExtender { @Override public void extend(WritableRaster raster, PlanarImage sourceImage) { int dataType = raster.getSampleModel().getDataType(); switch (dataType) { case DataBuffer.TYPE_BYTE: extendAsByte(raster, sourceImage); break; case DataBuffer.TYPE_SHORT: extendAsShort(raster, sourceImage); break; case DataBuffer.TYPE_USHORT: extendAsUShort(raster, sourceImage); break; case DataBuffer.TYPE_INT: extendAsInt(raster, sourceImage); break; case DataBuffer.TYPE_FLOAT: extendAsFloat(raster, sourceImage); break; case DataBuffer.TYPE_DOUBLE: extendAsDouble(raster, sourceImage); break; default: throw new UnsupportedOperationException("Unsupported data type"); } } RandomBorderExtender(Number minValue, Number maxValue); @Override void extend(WritableRaster raster, PlanarImage sourceImage);  }