C# Class AnimatGuiCtrls.Video.VideoStream

Inheritance: AviStream
ファイルを表示 Open project: NeuroRoboticTech/AnimatLabPublicSource Class Usage Examples

Protected Properties

Property Type Description
countFrames int
firstFrame int
frameRate double

Public Methods

Method Description
AddFrame ( Bitmap bmp ) : void

Add one frame to a new stream

This works only with uncompressed streams, and compressed streams that have not been saved yet. Use DecompressToNewFile to edit saved compressed streams.

DecompressToNewFile ( String fileName, bool recompress, VideoStream &newStream2 ) : AviManager

Copy all frames into a new file

Use this method if you want to append frames to an existing, compressed stream

ExportBitmap ( int position, String dstFileName ) : void

Export a frame into a bitmap file

ExportStream ( String fileName ) : void

Copy the stream into a new file

GetBitmap ( int position ) : Bitmap

Export a frame into a bitmap

GetFrameClose ( ) : void

Free ressources that have been used by GetFrameOpen

GetFrameOpen ( ) : void

Prepare for decompressing frames

This method has to be called before GetBitmap and ExportBitmap. Release ressources with GetFrameClose.

VideoStream ( int aviFile, Avi compressOptions, double frameRate, Bitmap firstFrame ) : System

Initialize a new VideoStream and add the first frame

VideoStream ( int aviFile, IntPtr aviStream ) : System

Initialize a VideoStream for an existing stream

VideoStream ( int aviFile, bool writeCompressed, double frameRate, Bitmap firstFrame ) : System

Initialize a new VideoStream and add the first frame

VideoStream ( int aviFile, bool writeCompressed, double frameRate, int frameSize, int width, int height, PixelFormat format ) : System

Initialize an empty VideoStream

Private Methods

Method Description
ConvertBitCountToPixelFormat ( int bitCount ) : PixelFormat

Returns a PixelFormat value for a specific bit count

ConvertPixelFormatToBitCount ( PixelFormat format ) : Int16

Get the count of bits per pixel from a PixelFormat value

CreateCompressedStream ( ) : void

Create a compressed stream from an uncompressed stream

CreateCompressedStream ( Avi options ) : void

Create a compressed stream from an uncompressed stream

CreateStream ( ) : void

Create a new stream

CreateStream ( Avi options ) : void

Create a new stream

CreateStreamWithoutFormat ( ) : void

Create a new stream

GetRateAndScale ( double &frameRate, int &scale ) : void
GetStreamInfo ( IntPtr aviStream ) : Avi.AVISTREAMINFO
Initialize ( int aviFile, bool writeCompressed, double frameRate, Bitmap firstFrameBitmap ) : void

Initialize a new VideoStream

Used only by constructors

SetFormat ( IntPtr aviStream ) : void

Apply a format to a new stream

The format must be set before the first frame can be written, and it cannot be changed later.

VideoStream ( int frameSize, double frameRate, int width, int height, Int16 countBitsPerPixel, int countFrames, Avi compressOptions, bool writeCompressed ) : System

Copy all properties from one VideoStream to another one

Used by EditableVideoStream

Method Details

AddFrame() public method

Add one frame to a new stream
This works only with uncompressed streams, and compressed streams that have not been saved yet. Use DecompressToNewFile to edit saved compressed streams.
public AddFrame ( Bitmap bmp ) : void
bmp System.Drawing.Bitmap
return void

DecompressToNewFile() public method

Copy all frames into a new file
Use this method if you want to append frames to an existing, compressed stream
public DecompressToNewFile ( String fileName, bool recompress, VideoStream &newStream2 ) : AviManager
fileName String Name of the new file
recompress bool true: Compress the new stream
newStream2 VideoStream
return AviManager

ExportBitmap() public method

Export a frame into a bitmap file
public ExportBitmap ( int position, String dstFileName ) : void
position int Position of the frame
dstFileName String Name of the file to store the bitmap
return void

ExportStream() public method

Copy the stream into a new file
public ExportStream ( String fileName ) : void
fileName String Name of the new file
return void

GetBitmap() public method

Export a frame into a bitmap
public GetBitmap ( int position ) : Bitmap
position int Position of the frame
return System.Drawing.Bitmap

GetFrameClose() public method

Free ressources that have been used by GetFrameOpen
public GetFrameClose ( ) : void
return void

GetFrameOpen() public method

Prepare for decompressing frames
This method has to be called before GetBitmap and ExportBitmap. Release ressources with GetFrameClose.
public GetFrameOpen ( ) : void
return void

VideoStream() public method

Initialize a new VideoStream and add the first frame
public VideoStream ( int aviFile, Avi compressOptions, double frameRate, Bitmap firstFrame ) : System
aviFile int The file that contains the stream
compressOptions Avi
frameRate double Frames per second
firstFrame System.Drawing.Bitmap Image to write into the stream as the first frame
return System

VideoStream() public method

Initialize a VideoStream for an existing stream
public VideoStream ( int aviFile, IntPtr aviStream ) : System
aviFile int The file that contains the stream
aviStream System.IntPtr An IAVISTREAM from [aviFile]
return System

VideoStream() public method

Initialize a new VideoStream and add the first frame
public VideoStream ( int aviFile, bool writeCompressed, double frameRate, Bitmap firstFrame ) : System
aviFile int The file that contains the stream
writeCompressed bool true: create a compressed stream before adding frames
frameRate double Frames per second
firstFrame System.Drawing.Bitmap Image to write into the stream as the first frame
return System

VideoStream() public method

Initialize an empty VideoStream
public VideoStream ( int aviFile, bool writeCompressed, double frameRate, int frameSize, int width, int height, PixelFormat format ) : System
aviFile int The file that contains the stream
writeCompressed bool true: Create a compressed stream before adding frames
frameRate double Frames per second
frameSize int Size of one frame in bytes
width int Width of each image
height int Height of each image
format PixelFormat PixelFormat of the images
return System

Property Details

countFrames protected_oe property

count of frames in the stream
protected int countFrames
return int

firstFrame protected_oe property

initial frame index
Added by M. Covington
protected int firstFrame
return int

frameRate protected_oe property

protected double frameRate
return double