contrib/mul/mvl2/mvl2_video_to_avi_linux.h
Go to the documentation of this file.
00001 #ifndef mvl2_video_to_avi_linux_h_
00002 #define mvl2_video_to_avi_linux_h_
00003 //:
00004 // \file
00005 // \brief A class for writing videos
00006 // \author Franck Bettinger
00007 
00008 #include "mvl2_video_writer.h"
00009 
00010 #include <avifile.h>
00011 #include <videoencoder.h>
00012 #include <infotypes.h>
00013 #include <avm_except.h>
00014 #include <version.h>
00015 #include <avm_default.h>
00016 #include <avm_fourcc.h>
00017 
00018 //: A class for writing videos
00019 
00020 class mvl2_video_to_avi: public mvl2_video_writer
00021 {
00022  public:
00023 
00024   //: Dflt ctor
00025   mvl2_video_to_avi();
00026 
00027   //: Destructor
00028   ~mvl2_video_to_avi();
00029 
00030   //: Set the video codec fourcc
00031   bool  set_codec(char, char, char, char);
00032 
00033   //: Initialize the file (format can be Grey, RGB, or more complex)
00034   bool  open( int width, int height,
00035               vcl_string format, vcl_string file_name);
00036 
00037   //: Tidy up and close the file
00038   void  close();
00039 
00040   //: Check whether camera is initialised
00041   bool  is_opened() const {return is_initialized_;}
00042 
00043   //: Return width of image (in pixels)
00044   int get_width() const;
00045 
00046   //: Return height of image (in pixels)
00047   int get_height() const;
00048 
00049   //: Return the frame rate in frames per second
00050   double get_frame_rate() const {return frame_rate_;}
00051 
00052   //: Set the frame rate in frames per second
00053   void set_frame_rate(double frame_rate);
00054 
00055   //: Set the quality of the recorded movie
00056   void set_quality(int qual);
00057 
00058   //: Put frame data into the given image
00059   void write_frame(vil_image_view<vxl_byte>& image);
00060 
00061   //: Name of the class
00062   vcl_string is_a() const;
00063 
00064   //: Create a copy on the heap and return base class pointer
00065   mvl2_video_writer* clone() const;
00066 
00067  protected:
00068 
00069   long fourcc_;
00070   bool bgr_;
00071   bool upside_down_;
00072   double frame_rate_;
00073 
00074   IAviVideoWriteStream* moviestream_;
00075   IAviWriteFile* moviefile_;
00076 };
00077 
00078 #endif // mvl2_video_to_avi_linux_h_