@Test public void testExtendShort() { WritableRaster raster = createRaster(DataBuffer.TYPE_SHORT); SamplingBorderExtender ex = new SamplingBorderExtender(SAMPLE_DISTANCE); ex.extend(raster, sourceImage); checkResultAsInt(raster, sourceImage.getBounds()); }
@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"); } }
SamplingBorderExtender 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"); } } }
SamplingBorderExtender 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"); } } SamplingBorderExtender(int maxDistance); }
SamplingBorderExtender 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"); } } SamplingBorderExtender(int maxDistance); @Override void extend(WritableRaster raster, PlanarImage sourceImage); }
SamplingBorderExtender 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"); } } SamplingBorderExtender(int maxDistance); @Override void extend(WritableRaster raster, PlanarImage sourceImage);  }