SapBufferWithTrashAndRoi.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #ifndef _SAPBUFFER_WITH_TRASH_AND_ROI_H_
  2. #define _SAPBUFFER_WITH_TRASH_AND_ROI_H_
  3. // SapBufferWithTrashAndRoi.h : header file
  4. //
  5. #include "SapClassBasicDef.h"
  6. #define SAPBUFFER_MAX_ROI 256
  7. //
  8. // SapRoi class declaration
  9. //
  10. class SAPCLASSBASIC_CLASS SapRoi
  11. {
  12. public:
  13. SapRoi() { memset(this, 0, sizeof(SapRoi)); }
  14. public:
  15. RECT m_Rect;
  16. CORBUFFER *m_pChildren;
  17. };
  18. //
  19. // SapBufferWithTrash class declaration
  20. //
  21. class SAPCLASSBASIC_CLASS SapBufferWithTrashAndRoi : public SapBufferWithTrash
  22. {
  23. public:
  24. // Constructor/Destructor
  25. SapBufferWithTrashAndRoi(int count = SapDefBufferCount, int width = SapDefWidth, int height = SapDefHeight, SapFormat format = SapDefFormat, Type type = SapDefBufferType, SapLocation loc = SapLocation::ServerSystem);
  26. SapBufferWithTrashAndRoi(int count, SapXferNode *pSrcNode, Type type = SapDefBufferType, SapLocation loc = SapLocation::ServerSystem);
  27. SapBufferWithTrashAndRoi(const char *filename, Type type = SapDefBufferType, SapLocation loc = SapLocation::ServerSystem);
  28. SapBufferWithTrashAndRoi(const SapBuffer &buf);
  29. virtual ~SapBufferWithTrashAndRoi();
  30. SapBufferWithTrashAndRoi &operator= (const SapBuffer &buf);
  31. // Module create/destroy
  32. virtual BOOL Create();
  33. virtual BOOL Destroy();
  34. // Access to implementation
  35. virtual int GetNumRoi() const { return m_NumRoi; }
  36. virtual const LPRECT GetRoi(int index) const;
  37. virtual CORBUFFER GetChild(int roiIndex, int bufIndex) const;
  38. // Operations
  39. virtual BOOL AddRoi(RECT roi);
  40. virtual BOOL RemoveAllRoi();
  41. protected:
  42. // Utility methods
  43. virtual void Construct();
  44. virtual BOOL CreateChildren();
  45. virtual BOOL DestroyChildren();
  46. protected:
  47. int m_NumRoi;
  48. SapRoi m_Roi[SAPBUFFER_MAX_ROI]; // Table of ROIs
  49. };
  50. #endif // _SAPBUFFER_WITH_TRASH_AND_ROI_H_