static private void readImage(
final String urlString,
final int w,
final int h,
final int[] data ) throws IOException, InterruptedException
{
final URL url = new URL( urlString );
final BufferedImage jpg = ImageIO.read( url );
/* This gymnastic is necessary to get reproducible gray
* values, just opening a JPG or PNG, even when saved by
* ImageIO, and grabbing its pixels results in gray values
* with a non-matching gamma transfer function, I cannot tell
* why... */
final BufferedImage image =
new BufferedImage( w, h, BufferedImage.TYPE_INT_ARGB );
image.createGraphics().drawImage( jpg, 0, 0, null );
final PixelGrabber pg = new PixelGrabber( image, 0, 0, w, h, data, 0, w );
pg.grabPixels();
}
DvidMultiscale2dVolatileArrayLoader.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:bigcat
作者:
评论列表
文章目录