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

  1. //    VirtualDub - Video processing and capture application
  2. //    Application helper library
  3. //    Copyright (C) 1998-2007 Avery Lee
  4. //
  5. //    This program is free software; you can redistribute it and/or modify
  6. //    it under the terms of the GNU General Public License as published by
  7. //    the Free Software Foundation; either version 2 of the License, or
  8. //    (at your option) any later version.
  9. //
  10. //    This program is distributed in the hope that it will be useful,
  11. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. //    GNU General Public License for more details.
  14. //
  15. //    You should have received a copy of the GNU General Public License
  16. //    along with this program; if not, write to the Free Software
  17. //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. #ifndef f_VD2_VDLIB_WIN32_DIBSECTION_H
  20. #define f_VD2_VDLIB_WIN32_DIBSECTION_H
  21.  
  22. #ifdef _MSC_VER
  23.     #pragma once
  24. #endif
  25.  
  26. struct HBITMAP__;
  27. struct HDC__;
  28. struct tagBITMAPINFO;
  29. struct VDPixmap;
  30. class VDFileMappingW32;
  31.  
  32. class VDDIBSectionW32 {
  33. public:
  34.     VDDIBSectionW32();
  35.     ~VDDIBSectionW32();
  36.  
  37.     bool    Init(int w, int h, int depth, const VDFileMappingW32 *mapping = NULL, uint32 mapOffset = 0);
  38.     bool    Init(const tagBITMAPINFO *bi, const VDFileMappingW32 *mapping = NULL, uint32 mapOffset = 0);
  39.     void    Shutdown();
  40.  
  41.     void        *GetPointer()    const { return mpBits; }
  42.     HDC__        *GetHDC()        const { return mhdc; }
  43.     HBITMAP__    *GetHBITMAP()    const { return mhbm; }
  44.  
  45.     VDPixmap    GetPixmap()        const;
  46.  
  47. protected:
  48.     void        *mpBits;
  49.     HBITMAP__    *mhbm;
  50.     HDC__        *mhdc;
  51.     void        *mhgo;
  52.     int            mWidth;
  53.     int            mHeight;
  54.     int            mDepth;
  55.     ptrdiff_t    mPitch;
  56.     void        *mpScan0;
  57.     bool        mbForceUnmap;
  58. };
  59.  
  60. #endif
  61.