|
Wavelet and Image class library
1.3.2
|
00001 /* 00002 * class ColorVideo 00003 * 00004 * $Date$ 00005 * $Revision$ 00006 * 00007 */ 00008 00009 #ifndef COLOR_VIDEO_HH__ 00010 #define COLOR_VIDEO_HH__ 00011 00012 #include "WImage/ColorImage.hh" 00013 #include "WImage/VideoArray.hh" 00014 00024 class 00025 ColorVideo : public ColorBuffer 00026 { 00027 public: 00029 ColorVideo (void); 00032 ColorVideo (const ColorVideo &cv); 00044 ColorVideo (int colors, clrmodel colormodel, int rows, int cols, int frames); 00046 virtual ~ColorVideo (void); 00047 00052 virtual void swapColors (int ch1, int ch2); 00053 00059 void colormodelVideo (clrmodel model); 00060 00066 inline Image ¤tFrameChannel (int num = 0) { return *m_images[num]; } 00067 00071 inline ColorImage ¤tFrame (void) { return *m_colorImage; } 00072 00075 inline double frameRate (void) const { return m_frameRate; } 00076 00079 void frameRate (double fr) { m_frameRate = fr; } 00080 00083 inline int current (void) const { return m_current; } 00084 00087 void current (int current); 00088 00091 inline int frames (void) const { return m_frames; } 00092 00101 void reframe (int frames, bool keephead); 00102 00112 void resize (int rows, int cols); 00113 00114 #ifndef _WIN32_WCE 00115 00138 void read (char const *fname, int from = 0, int to = 0, 00139 int rawy = 0, int rawx = 0, int colors = 3, 00140 clrmodel cmodel = cm_rgb, int skip = 512); 00165 void read (char const *fname, filetype ftype, int from = 0, int to = 0, 00166 int rawy = 0, int rawx = 0, int colors = 3, 00167 clrmodel cmodel = cm_rgb, int skip = 512); 00168 00183 void write (char const *fname, int rawskip = 512, bool beautify = false); 00193 void write (char const *fname, filetype ftype, 00194 int rawskip = 512, bool beautify = false); 00195 #endif 00196 00202 virtual coeff smax (void) const; 00208 virtual coeff smin (void) const; 00209 00215 virtual bool equals (ColorBuffer &buf) const; 00224 virtual bool epsilons (ColorBuffer &buf, coeff epsilon) const; 00225 00238 bool epsilonsFrames (int f1, int f2, coeff epsilon) const; 00239 00248 bool equalsFrames (int f1, int f2) const; 00249 00258 virtual void truncate (coeff min = 0, coeff max = 255); 00259 00276 virtual void beautify (int yoffs = 0, int xoffs = 0, 00277 int ysize = 0, int xsize = 0); 00278 00279 00288 virtual coeff averageColor (int fromY = 0, int fromX = 0, 00289 int toY = -1, int toX = -1); 00290 00299 virtual unsigned char *toPixmap (clrmodel cmodel); 00300 00303 ColorVideo *clone (void) const; 00304 00305 #ifndef _WIN32_WCE 00306 00316 static void videoDimensions (const char *fname, int &y, int &x, int &z, 00317 int colors, int skip = 0); 00318 #endif 00319 00320 protected: 00322 int m_frames; 00324 int m_current; 00326 int m_xyzsize; 00328 VideoArray < coeff > **m_arrays; 00330 ColorImage *m_colorImage; 00332 double m_frameRate; 00334 virtual void destroy (void); 00339 bool epsilonsVideo (ColorVideo &cv, coeff epsilon) const; 00352 void init (int colors, clrmodel cmodel, int rows, int cols, int frames); 00353 }; /* class ColorVideo */ 00354 00357 #endif /* COLOR_VIDEO_HH__ */ 00358
1.7.6.1