com.smaxe.uv.media
Class VideoFrameFactory

java.lang.Object
  extended by com.smaxe.uv.media.VideoFrameFactory

public final class VideoFrameFactory
extends java.lang.Object

VideoFrameFactory - VideoFrame factory.

Author:
Andrei Sochirca

Method Summary
static VideoFrame clone(VideoFrame frame)
          Clones frame.
static void save(java.io.File file, java.lang.String format, VideoFrame frame)
          Saves frame to the file.
static void saveAsJpg(java.io.File file, VideoFrame frame)
          Saves frame to the JPG file.
static void saveAsPng(java.io.File file, VideoFrame frame)
          Saves frame to the PNG file.
static java.awt.image.BufferedImage toBufferedImage(VideoFrame frame)
          Converts frame to the BufferedImage.
static VideoFrame toVideoFrame(java.awt.image.BufferedImage image)
          Converts image to the frame.
static void write(java.io.OutputStream os, java.lang.String format, VideoFrame frame)
          Writes frame to the os.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clone

public static VideoFrame clone(VideoFrame frame)
Clones frame.

Note:
- The method creates a frame.rgb copy.

Parameters:
frame - frame to clone
Returns:
cloned frame

toBufferedImage

public static java.awt.image.BufferedImage toBufferedImage(VideoFrame frame)
Converts frame to the BufferedImage.

Parameters:
frame -
Returns:
buffered image

toVideoFrame

public static VideoFrame toVideoFrame(java.awt.image.BufferedImage image)
Converts image to the frame.

Parameters:
image -
Returns:
video frame

write

public static void write(java.io.OutputStream os,
                         java.lang.String format,
                         VideoFrame frame)
                  throws java.io.IOException
Writes frame to the os.

Parameters:
os -
format - output file format
frame - video frame
Throws:
java.io.IOException - if an I/O exception occurred

save

public static void save(java.io.File file,
                        java.lang.String format,
                        VideoFrame frame)
                 throws java.io.IOException
Saves frame to the file.

Parameters:
file - output file
format - output file format
frame - video frame
Throws:
java.io.IOException - if an I/O exception occurred

saveAsJpg

public static void saveAsJpg(java.io.File file,
                             VideoFrame frame)
                      throws java.io.IOException
Saves frame to the JPG file.

Parameters:
file - output file
frame - video frame
Throws:
java.io.IOException - if an I/O exception occurred

saveAsPng

public static void saveAsPng(java.io.File file,
                             VideoFrame frame)
                      throws java.io.IOException
Saves frame to the PNG file.

Parameters:
file - output file
frame - video frame
Throws:
java.io.IOException - if an I/O exception occurred