TrackerPanel.java 文件源码

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

项目:synergynet3.1 作者:
/**
 * Draw user depths.
 *
 * @param g2d
 *            the g2d
 */
private void drawUserDepths(Graphics2D g2d)
{ // Create BufferedImage using
    // the depth image bytes and
    // a colour model, then draw
    // it
    // define an 8-bit RGB channel colour model
    ColorModel colorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), new int[]
    { 8, 8, 8 }, false, false, ComponentColorModel.OPAQUE, DataBuffer.TYPE_BYTE);

    // fill the raster with the depth image bytes
    DataBufferByte dataBuffer = new DataBufferByte(imgbytes, imWidth * imHeight * 3);

    WritableRaster raster = Raster.createInterleavedRaster(dataBuffer, imWidth, imHeight, imWidth * 3, 3, new int[]
    { 0, 1, 2 }, null);

    // combine colour model and raster to create a BufferedImage
    BufferedImage image = new BufferedImage(colorModel, raster, false, null);

    g2d.drawImage(image, 0, 0, null);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号