home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 275 / DPCS0111DVD.ISO / Toolkit / Audio-Visual / VirtualDub / Source / VirtualDub-1.9.10-src.7z / src / Kasumi / h / uberblit_resample.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-09-14  |  2.0 KB  |  84 lines

  1. #ifndef f_VD2_KASUMI_UBERBLIT_RESAMPLE_H
  2. #define f_VD2_KASUMI_UBERBLIT_RESAMPLE_H
  3.  
  4. #include <vd2/system/vdstl.h>
  5. #include <vd2/system/math.h>
  6. #include "uberblit.h"
  7. #include "uberblit_base.h"
  8. #include <vd2/Kasumi/resample_kernels.h>
  9.  
  10. class IVDResamplerSeparableRowStage;
  11. class IVDResamplerSeparableRowStage2;
  12. class IVDResamplerSeparableColStage;
  13.  
  14. namespace nsVDPixmap {
  15.     enum FilterMode {
  16.         kFilterPoint,
  17.         kFilterLinear,
  18.         kFilterCubic,
  19.         kFilterLanczos3,
  20.         kFilterCount
  21.     };
  22. }
  23.  
  24. class VDPixmapGenResampleRow : public VDPixmapGenWindowBasedOneSource {
  25. public:
  26.     VDPixmapGenResampleRow();
  27.     ~VDPixmapGenResampleRow();
  28.  
  29.     void Init(IVDPixmapGen *src, uint32 srcIndex, uint32 width, float offset, float step, nsVDPixmap::FilterMode filterMode, float filterFactor, bool interpolationOnly);
  30.  
  31.     void Start();
  32.  
  33.     uint32 GetType(uint32 output) const {
  34.         return mpSrc->GetType(mSrcIndex);
  35.     }
  36.  
  37. protected:
  38.     void Compute(void *dst0, sint32 y);
  39.     void Compute8(void *dst0, sint32 y);
  40.     void Compute32(void *dst0, sint32 y);
  41.     void Compute128(void *dst0, sint32 y);
  42.  
  43.     IVDResamplerSeparableRowStage *mpRowStage;
  44.     IVDResamplerSeparableRowStage2 *mpRowStage2;
  45.  
  46.     uint32                mRowFiltW;
  47.     uint32                mBytesPerSample;
  48.  
  49.     VDResamplerAxis        mAxis;
  50.  
  51.     vdblock<void *>    mWindow;
  52.     void                **mpAllocWindow;
  53.     vdblock<uint32, vdaligned_alloc<uint32> >        mTempSpace;
  54. };
  55.  
  56. class VDPixmapGenResampleCol : public VDPixmapGenWindowBasedOneSource {
  57. public:
  58.     VDPixmapGenResampleCol();
  59.     ~VDPixmapGenResampleCol();
  60.  
  61.     void Init(IVDPixmapGen *src, uint32 srcIndex, uint32 height, float offset, float step, nsVDPixmap::FilterMode filterMode, float filterFactor, bool interpolationOnly);
  62.  
  63.     void Start();
  64.  
  65.     uint32 GetType(uint32 output) const {
  66.         return mpSrc->GetType(mSrcIndex);
  67.     }
  68.  
  69. protected:
  70.     void Compute(void *dst0, sint32 y);
  71.  
  72.     IVDResamplerSeparableColStage *mpColStage;
  73.  
  74.     uint32                mWinSize;
  75.     uint32                mBytesPerSample;
  76.     uint32                mBytesPerRow;
  77.  
  78.     VDResamplerAxis        mAxis;
  79.  
  80.     vdblock<const void *>    mWindow;
  81. };
  82.  
  83. #endif
  84.