core/vidl_vil1/vidl_vil1_io.h

Go to the documentation of this file.
00001 #ifndef vidl_vil1_io_h
00002 #define vidl_vil1_io_h
00003 //:
00004 // \file
00005 // \author Nicolas Dano, september 1999
00006 //
00007 // \verbatim
00008 //  Modifications
00009 //   Julien ESTEVE, June 2000 -  Ported from TargetJr
00010 //   10/4/2001 Ian Scott (Manchester) Converted perceps header to doxygen
00011 // \endverbatim
00012 
00013 
00014 #include <vcl_string.h>
00015 #include <vidl_vil1/vidl_vil1_clip_sptr.h>
00016 #include <vidl_vil1/vidl_vil1_movie_sptr.h>
00017 #include <vidl_vil1/vidl_vil1_codec_sptr.h>
00018 #include <vcl_vector.h>
00019 #include <vcl_list.h>
00020 #include "dll.h"
00021 
00022 class vidl_vil1_movie;
00023 class vidl_vil1_codec;
00024 //: Video Input / Output
00025 //   vidl_vil1_io takes care of Input / Output of videos
00026 //   It reads video in from filenames and creates
00027 //   movies or clips. It saves videos into specific
00028 //   codecs
00029 class vidl_vil1_io
00030 {
00031   // PUBLIC INTERFACE----------------------------------------------------------
00032 
00033  public:
00034   //-----------------------------------------------------
00035   //   Callbacks for initializing codecs
00036   //-------------------------------------------------------
00037   VIDL_VIL1_DLL_DATA static void (* load_mpegcodec_callback)( vidl_vil1_codec*);
00038 
00039 
00040   //---------------------------------------------------------
00041   //   LoadMovie
00042   //---------------------------------------------------------
00043 
00044   static vidl_vil1_movie_sptr load_movie(
00045         vcl_string const& fname,
00046         int start, int end,
00047         int increment,
00048         char mode = 'r'
00049         );
00050 
00051   static vidl_vil1_movie_sptr load_movie(
00052         const vcl_list<vcl_string> &fnames,
00053         int start,
00054         int end,
00055         int increment,
00056         char mode = 'r'
00057         );
00058 
00059   static vidl_vil1_movie_sptr load_movie(
00060         const vcl_vector<vcl_string> &fnames,
00061         int start,
00062         int end,
00063         int increment,
00064         char mode = 'r'
00065         );
00066 
00067   static vidl_vil1_movie_sptr load_movie(
00068         vcl_string const& fname,
00069         char mode = 'r'
00070         ) { return load_movie(fname, 0, 0, 1, mode); }
00071 
00072   static vidl_vil1_movie_sptr load_movie(
00073         const vcl_list<vcl_string> &fnames,
00074         char mode = 'r'
00075         ) { return load_movie(fnames, 0, 0, 1, mode); }
00076 
00077   static vidl_vil1_movie_sptr load_movie(
00078         const vcl_vector<vcl_string> &fnames,
00079         char mode = 'r'
00080         ) { return load_movie(fnames, 0, 0, 1, mode); }
00081 
00082   //---------------------------------------------------------
00083   //   LoadClip
00084   //---------------------------------------------------------
00085 
00086   static vidl_vil1_clip_sptr load_clip(
00087         vcl_string const& fname,
00088         int start,
00089         int end,
00090         int increment,
00091         char mode = 'r'
00092         );
00093 
00094   static vidl_vil1_clip_sptr load_clip(
00095         const vcl_list<vcl_string> &fnames,
00096         int start, int end,
00097         int increment,
00098         char mode = 'r'
00099         );
00100 
00101   static vidl_vil1_clip_sptr load_clip(
00102         const vcl_vector<vcl_string> &fnames,
00103         int start, int end,
00104         int increment,
00105         char mode = 'r'
00106         );
00107 
00108   static vidl_vil1_clip_sptr load_clip(
00109         vcl_string const& fname,
00110         char mode = 'r'
00111         ) { return load_clip(fname, 0, 0, 1, mode); }
00112 
00113   static vidl_vil1_clip_sptr load_clip(
00114         const vcl_list<vcl_string> &fnames,
00115         char mode = 'r'
00116         ) { return load_clip(fnames, 0, 0, 1, mode); }
00117 
00118   static vidl_vil1_clip_sptr load_clip(
00119         const vcl_vector<vcl_string> &fnames,
00120         char mode = 'r'
00121         ) { return load_clip(fnames, 0, 0, 1, mode); }
00122 
00123   //---------------------------------------------------------
00124 
00125   static bool save(
00126         vidl_vil1_movie* movie,
00127         vcl_string const& fname,
00128         vcl_string const& type);
00129 
00130   // returns vcl_string names  for supported types
00131   static vcl_list<vcl_string> supported_types();
00132 
00133   static void register_codec(vidl_vil1_codec* codec); // adds to supported_types list
00134 
00135   static void close(); // Must call this before the MPEG library is deleted, i.e. on exit.
00136 
00137  public:
00138   static vcl_list<vidl_vil1_codec_sptr> supported_types_;
00139 
00140   // Helpers-------------------------------------------------------------------
00141 
00142   //: Functions when videos are sequences of still images
00143   // This may go in the public area if some people know
00144   // they are dealing with images
00145 
00146   static vidl_vil1_clip_sptr load_images(
00147         const vcl_list<vcl_string> &fnames,
00148         int start,
00149         int,
00150         int increment,
00151         char mode = 'r'
00152         );
00153 
00154   static vidl_vil1_clip_sptr load_images(
00155         const vcl_vector<vcl_string> &fnames,
00156         int start,
00157         int,
00158         int increment,
00159         char mode = 'r'
00160         );
00161 
00162   static vidl_vil1_clip_sptr load_images(
00163         const vcl_list<vcl_string> &fnames,
00164         char mode = 'r'
00165         )
00166         {
00167         return load_images(fnames, 0, 0, 1, mode);
00168         }
00169 
00170   static vidl_vil1_clip_sptr load_images(
00171         const vcl_vector<vcl_string> &fnames,
00172         char mode = 'r'
00173         )
00174         {
00175         return load_images(fnames, 0, 0, 1, mode);
00176         }
00177 
00178   static bool save_images(
00179         vidl_vil1_movie* movie,
00180         vcl_string const& fname,
00181         vcl_string const& type);
00182 };
00183 
00184 #endif // vidl_vil1_io_h

Generated on Tue Dec 2 05:09:13 2008 for core/vidl_vil1 by  doxygen 1.5.1