Package javax.media.util

Examples of javax.media.util.BufferToImage.createImage()


      assertEquals(f.getFlipped(), 1);
      final BufferToImage b2i = new BufferToImage(f);
      final Buffer buffer = new Buffer();
      buffer.setFormat(f);
      buffer.setData(new byte[] {(byte)0,(byte)1,(byte)2,(byte)3,(byte)4,(byte)5,(byte)6,(byte)7,(byte)8,(byte)9,(byte)10,(byte)11,(byte)12,(byte)13,(byte)14,(byte)15,(byte)16,(byte)17,(byte)18,(byte)19,(byte)20,(byte)21,(byte)22,(byte)23,(byte)24,(byte)25,(byte)26,(byte)27,(byte)28,(byte)29,(byte)30,(byte)31,(byte)32,(byte)33,(byte)34,(byte)35,(byte)36,(byte)37,(byte)38,(byte)39,(byte)40,(byte)41,(byte)42,(byte)43,(byte)44,(byte)45,(byte)46,(byte)47});
      final BufferedImage i = (BufferedImage) b2i.createImage(buffer);
      assertTrue(i != null);
      assertEquals(i.getWidth(), f.getSize().width);
      assertEquals(i.getHeight(), f.getSize().height);
      assertEquals(i.getColorModel().getColorSpace().getType(), ColorSpace.TYPE_RGB);
      assertEquals(i.getType(), BufferedImage.TYPE_INT_RGB);
View Full Code Here


        // Grab a frame
        Buffer buf = fgc.grabFrame();
       
        // Convert it to an image
        BufferToImage btoi = new BufferToImage((VideoFormat)buf.getFormat());
        Image img = btoi.createImage(buf);

        while(img==null)
        {
          buf = fgc.grabFrame();
          btoi = new BufferToImage((VideoFormat)buf.getFormat());
View Full Code Here

        while(img==null)
        {
          buf = fgc.grabFrame();
          btoi = new BufferToImage((VideoFormat)buf.getFormat());
          img = btoi.createImage(buf);

          try{Thread.sleep(10);}catch(Exception e){}
        }       
       
      bufferedImage = ImageFactory.createBufferedImage(img);
View Full Code Here

        // Grab a frame
        Buffer buf = fgc.grabFrame();
       
        // Convert it to an image
        BufferToImage btoi = new BufferToImage((VideoFormat)buf.getFormat());
        Image img = btoi.createImage(buf);
 
        while(img==null)
        {
          buf = fgc.grabFrame();
          btoi = new BufferToImage((VideoFormat)buf.getFormat());
View Full Code Here

 
        while(img==null)
        {
          buf = fgc.grabFrame();
          btoi = new BufferToImage((VideoFormat)buf.getFormat());
          img = btoi.createImage(buf);
 
          try{Thread.sleep(10);}catch(Exception e){}
        }       
       
      return ImageFactory.createBufferedImage(img);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.