DvidMultiscale2dVolatileArrayLoader.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:bigcat 作者:
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();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号