gpt4 book ai didi

us.ihmc.codecs.yuv.YUVPictureConverter.toBufferedImage()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 05:18:49 28 4
gpt4 key购买 nike

本文整理了Java中us.ihmc.codecs.yuv.YUVPictureConverter.toBufferedImage()方法的一些代码示例,展示了YUVPictureConverter.toBufferedImage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YUVPictureConverter.toBufferedImage()方法的具体详情如下:
包路径:us.ihmc.codecs.yuv.YUVPictureConverter
类名称:YUVPictureConverter
方法名:toBufferedImage

YUVPictureConverter.toBufferedImage介绍

[英]Convert YUVPicture to BufferedImage, minimizing object allocation
[中]将YUVPicture转换为BuffereImage,最小化对象分配

代码示例

代码示例来源:origin: us.ihmc/IHMCVideoCodecs

/**
* Convert YUVPicture to BufferedImage, minimizing object allocation
* 
* @param picture YUVPicture to convert
* @return new BufferedImage.
*/
public BufferedImage toBufferedImage(YUVPicture picture)
{
 return toBufferedImage(picture, null);
}

代码示例来源:origin: us.ihmc/ihmc-video-codecs

/**
* Convert YUVPicture to BufferedImage, minimizing object allocation
* 
* @param picture YUVPicture to convert
* @return new BufferedImage.
*/
public BufferedImage toBufferedImage(YUVPicture picture)
{
 return toBufferedImage(picture, null);
}

代码示例来源:origin: us.ihmc/ihmc-video-codecs

@Override
 public void run()
 {
   image.setIcon(new ImageIcon(converter.toBufferedImage(img)));
 }
});

代码示例来源:origin: us.ihmc/IHMCVideoCodecs

@Override
 public void run()
 {
   image.setIcon(new ImageIcon(converter.toBufferedImage(img)));
 }
});

代码示例来源:origin: us.ihmc/ihmc-robot-data-visualizer

@Override
 public void run()
 {
   img = converter.toBufferedImage(nextFrame, img);
   nextFrame.delete();
   ImageIcon icon = new ImageIcon(img);
   label.setIcon(icon);
   if (img.getWidth() != width || img.getHeight() != height)
   {
    width = img.getWidth();
    height = img.getHeight();
    label.setPreferredSize(new Dimension(width, height));
    pack();
   }
 }
});

代码示例来源:origin: us.ihmc/RobotDataCommunication

@Override
 public void run()
 {
   img = converter.toBufferedImage(nextFrame, img);
   nextFrame.delete();
   ImageIcon icon = new ImageIcon(img);
   label.setIcon(icon);
   if (img.getWidth() != width || img.getHeight() != height)
   {
    width = img.getWidth();
    height = img.getHeight();
    label.setPreferredSize(new Dimension(width, height));
    pack();
   }
 }
});

代码示例来源:origin: us.ihmc/IHMCRobotDataVisualizer

@Override
 public void run()
 {
   img = converter.toBufferedImage(nextFrame, img);
   nextFrame.delete();
   ImageIcon icon = new ImageIcon(img);
   label.setIcon(icon);
   if (img.getWidth() != width || img.getHeight() != height)
   {
    width = img.getWidth();
    height = img.getHeight();
    label.setPreferredSize(new Dimension(width, height));
    pack();
   }
 }
});

代码示例来源:origin: us.ihmc/IHMCCommunication

@Override
public synchronized void consumeObject(byte[] data, Point3d position, Quat4d orientation, IntrinsicParameters intrinsicParameters)
{
 nalBuffer.clear();
 nalBuffer.put(data);
 nalBuffer.clear();
 
 YUVPicture frame = decoder.decodeFrame(nalBuffer);
 if(frame != null)
 {
   image = converter.toBufferedImage(frame, image);
   videoStreamer.updateImage(image, position, orientation, intrinsicParameters);
   frame.delete();
 }
 
 
}

代码示例来源:origin: us.ihmc/IHMCCommunication

public BufferedImage decompressJPEGDataToBufferedImage(byte[] jpegData)
  {
   ByteBuffer byteBuffer = byteBufferProvider.getOrCreateBuffer(jpegData.length);
   byteBuffer.put(jpegData);
   byteBuffer.flip();
   YUVPicture yuvPicture = jpegDecoder.decode(byteBuffer);
   BufferedImage bufferedImage = yuvPictureConverter.toBufferedImage(yuvPicture);
   yuvPicture.delete();
   return bufferedImage;
  }
}

代码示例来源:origin: us.ihmc/IHMCCommunication

@Override
  public void consumeObject(byte[] data, Point3d position, Quat4d orientation, IntrinsicParameters intrinsicParameters)
  {
   ByteBuffer buffer = byteBufferProvider.getOrCreateBuffer(data.length);
   buffer.put(data);
   buffer.flip();
   YUVPicture pic = decoder.decode(buffer);
   BufferedImage img = converter.toBufferedImage(pic);
   pic.delete();
   videoStreamer.updateImage(img, position, orientation, intrinsicParameters);
  }
}

代码示例来源:origin: us.ihmc/ImageProcessing

private void streamBufferedImagesFromVideo()
{
 YUVPicture frame;
 try
 {
   while ((frame = demuxer.getNextFrame()) != null)
   {
    videoListener.updateImage(converter.toBufferedImage(frame));
    frame.delete();
   }
 }
 catch (IOException e)
 {
   throw new RuntimeException(e);
 }
}

代码示例来源:origin: us.ihmc/ImageProcessing

private void streamBufferedImagesFromVideo()
{
 // Now, we start walking through the container looking at each packet.
 YUVPicture leftEye;
 YUVPicture rightEye;
 try
 {
   while ((leftEye = leftEyeDemuxer.getNextFrame()) != null && (rightEye = rightEyeDemuxer.getNextFrame()) != null)
   {
    videoListener.updateImage(converter.toBufferedImage(leftEye), converter.toBufferedImage(rightEye));
    leftEye.delete();
    rightEye.delete();
    //TODO: Insert eait loop
   }
 }
 catch (IOException e)
 {
   e.printStackTrace();
 }
}

代码示例来源:origin: us.ihmc/ihmc-video-codecs

while ((picture = demuxer.getNextFrame()) != null)
  final BufferedImage img = converter.toBufferedImage(picture);
  SwingUtilities.invokeLater(new Runnable()

代码示例来源:origin: us.ihmc/IHMCVideoCodecs

while ((picture = demuxer.getNextFrame()) != null)
  final BufferedImage img = converter.toBufferedImage(picture);
  SwingUtilities.invokeLater(new Runnable()

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

private void doTheNextFrame(YUVPicture picture)
{
 int width = jPanel.getWidth();
 int height = jPanel.getHeight();
 
 if (width < 1 || height < 1)
   return;
 
 picture.scale(width, height, FilterModeEnum.kFilterBilinear);
 
 bufferedImage = converter.toBufferedImage(picture, bufferedImage);
 
 SwingUtilities.invokeLater(new Runnable()
 {
   @Override
   public void run()
   {
    imageIcon = new ImageIcon(bufferedImage);
    jLabel.setIcon(imageIcon);
   }
 });
 picture.delete();
}

代码示例来源:origin: us.ihmc/RobotDataCommunication

int newHeight = ((int) (scaleHeight * (double) img.getHeight()) >> 1) << 1;
img.scale(newWidth, newHeight, FilterModeEnum.kFilterBilinear);
image = converter.toBufferedImage(img, image);
ImageIcon icon = new ImageIcon(image);
label.setIcon(icon);

代码示例来源:origin: us.ihmc/IHMCRobotDataVisualizer

int newHeight = ((int) (scaleHeight * (double) img.getHeight()) >> 1) << 1;
img.scale(newWidth, newHeight, FilterModeEnum.kFilterBilinear);
image = converter.toBufferedImage(img, image);
ImageIcon icon = new ImageIcon(image);
label.setIcon(icon);

代码示例来源:origin: us.ihmc/ihmc-robot-data-visualizer

int newHeight = ((int) (scaleHeight * (double) img.getHeight()) >> 1) << 1;
img.scale(newWidth, newHeight, FilterModeEnum.kFilterBilinear);
image = converter.toBufferedImage(img, image);
ImageIcon icon = new ImageIcon(image);
label.setIcon(icon);

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com