home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2004 March / PCWELT_3_2004.ISO / pcwsoft / flaskmpeg_078_39_src.z.exe / flaskmpeg / PostProcessing.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-10-28  |  2.8 KB  |  117 lines

  1. /* 
  2.  *  PostProcessing.h
  3.  *
  4.  *    Copyright (C) Alberto Vigata - January 2000 - ultraflask@yahoo.com
  5.  *
  6.  *  This file is part of FlasKMPEG, a free MPEG to MPEG/AVI converter
  7.  *    
  8.  *  FlasKMPEG is free software; you can redistribute it and/or modify
  9.  *  it under the terms of the GNU General Public License as published by
  10.  *  the Free Software Foundation; either version 2, or (at your option)
  11.  *  any later version.
  12.  *   
  13.  *  FlasKMPEG is distributed in the hope that it will be useful,
  14.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  *  GNU General Public License for more details.
  17.  *   
  18.  *  You should have received a copy of the GNU General Public License
  19.  *  along with GNU Make; see the file COPYING.  If not, write to
  20.  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  21.  *
  22.  */
  23.  
  24. #ifndef POST_PROCESSING_H
  25. #define POST_PROCESSING_H
  26.  
  27. #include ".\profile.h"
  28. #include ".\framesource.h"
  29. #include "Crop.h"
  30. #include "letterbox.h"
  31. #include "flfilterchain.h"
  32.  
  33. struct TPPost
  34. {
  35.     // Original image
  36.     int                    nInWidth;
  37.     int                    nInHeight;
  38.     // Resizing
  39.   bool        bResize;
  40.     bool                doAR;
  41.     int                    outAR;
  42.     double                iDAR;
  43.     int                    filterMode;
  44.     int                    resWidth;
  45.     int                    resHeight;
  46.     
  47.     // Crop and letterboxing
  48.     bool                crop;
  49.     int                    cropTopOffset;
  50.     int                    cropHeight;
  51.     int                    cropLeftOffset;
  52.     int                    cropWidth;
  53.  
  54.     bool                letterbox;
  55.     int                    letterboxTop;
  56.     int                    letterboxBottom;
  57.     int                    letterboxLeft;
  58.     int                    letterboxRight;
  59.  
  60.   // Video controls
  61.   bool videocontrols;
  62.   int  brightness;
  63.   int  hue;
  64.   int  contrast;
  65.  
  66.     // Deinterlacing
  67.     bool                deinterlace;
  68.     int                 threshold;
  69.     int                 blend_fields;
  70.  
  71.   // Processing format
  72.   int         nProcessingFormat;
  73.  
  74.     // Current time to be used in subtitles stamping
  75.     i64                 myClock;
  76.  
  77. };
  78.  
  79. /*
  80. #define  PPOST_WIDTH(x) (x.crop ? x.cropWidth : x.resWidth)
  81. #define PPOST_HEIGHT(x) (x.crop ? x.cropHeight : x.resHeight)
  82. */
  83.  
  84. class FlPostProcess : public CFrameSource
  85. {
  86. public:
  87.   FlPostProcess();
  88.   bool Set(TPPost *pp);
  89.   TPPost *Get(){ return &m_pp; }
  90.   bool Start();
  91.   int Process(CFrame *pSrc, CFrame *pDst);
  92.   bool Stop();
  93.   int GetWidth(){ return m_nWidth; }
  94.   int GetHeight(){ return m_nHeight; }
  95.  
  96. private:
  97.   int Validate();
  98.   int BuildChain();
  99.   int DestroyChain();
  100.   bool GetFrame( CFrame **ppFrame );
  101.  
  102.   TPPost m_pp;
  103.  
  104.   FlFilter *m_fil[nMaxFilters];
  105.   int  m_filc;
  106.   int  m_nWidth, m_nHeight;
  107.  
  108.   CFrame *m_pIn;
  109. };
  110.  
  111. void FromConfigToPPost(  TProfile *prof, TPPost *pp, int nSrcWidth=0, int nSrcHeight=0, double fDar=0, int nProcessingFormat=0 );
  112. void FromPPostToConfig( TProfile *prof, TPPost *pp);
  113.  
  114. void FixPPostSettings( TPPost *pp );
  115.  
  116. int CheckVideoParameters(TPPost *pp);
  117. #endif