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_input.h < prev    next >
Encoding:
C/C++ Source or Header  |  2009-09-14  |  1.3 KB  |  70 lines

  1. #ifndef f_VD2_KASUMI_UBERBLIT_INPUT_H
  2. #define f_VD2_KASUMI_UBERBLIT_INPUT_H
  3.  
  4. #include "uberblit.h"
  5. #include "uberblit_base.h"
  6.  
  7. class IVDPixmapGenSrc {
  8. public:
  9.     virtual void SetSource(const void *src, ptrdiff_t pitch, const uint32 *palette) = 0;
  10. };
  11.  
  12. class VDPixmapGenSrc : public IVDPixmapGen, public IVDPixmapGenSrc {
  13. public:
  14.     void Init(sint32 width, sint32 height, uint32 type, uint32 bpr) {
  15.         mWidth = width;
  16.         mHeight = height;
  17.         mType = type;
  18.         mBpr = bpr;
  19.     }
  20.  
  21.     void SetSource(const void *src, ptrdiff_t pitch, const uint32 *palette) {
  22.         mpSrc = src;
  23.         mPitch = pitch;
  24.     }
  25.  
  26.     void AddWindowRequest(int minY, int maxY) {
  27.     }
  28.  
  29.     void Start() {
  30.     }
  31.  
  32.     sint32 GetWidth(int) const {
  33.         return mWidth;
  34.     }
  35.  
  36.     sint32 GetHeight(int) const {
  37.         return mHeight;
  38.     }
  39.  
  40.     bool IsStateful() const {
  41.         return false;
  42.     }
  43.  
  44.     const void *GetRow(sint32 y, uint32 output) {
  45.         if (y < 0)
  46.             y = 0;
  47.         else if (y >= mHeight)
  48.             y = mHeight - 1;
  49.         return vdptroffset(mpSrc, mPitch*y);
  50.     }
  51.  
  52.     void ProcessRow(void *dst, sint32 y) {
  53.         memcpy(dst, GetRow(y, 0), mBpr);
  54.     }
  55.  
  56.     uint32 GetType(uint32 index) const {
  57.         return mType;
  58.     }
  59.  
  60. protected:
  61.     const void *mpSrc;
  62.     ptrdiff_t    mPitch;
  63.     size_t        mBpr;
  64.     sint32        mWidth;
  65.     sint32        mHeight;
  66.     uint32        mType;
  67. };
  68.  
  69. #endif
  70.