Interface_PixelProcessor.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (C) =USTC= Fu Li
  3. *
  4. * Author : Fu Li
  5. * Create : 2004-2-21
  6. * Home : http://www.crazy-bit.com/
  7. * Mail : crazybit@263.net
  8. * History :
  9. */
  10. #ifndef __PCL_INTERFACE_PIXEL_PROCESSOR__2004_02_21__H__
  11. #define __PCL_INTERFACE_PIXEL_PROCESSOR__2004_02_21__H__
  12. #include "../StdDefine.h"
  13. class FCObjImage ; // external class
  14. class FCInterface_PixelProcess ;
  15. //=============================================================================
  16. /**
  17. * Pixel processor interface.
  18. */
  19. class FCInterface_PixelProcess
  20. {
  21. public:
  22. virtual ~FCInterface_PixelProcess() {}
  23. /// How to process the image.
  24. enum PROCESS_TYPE
  25. {
  26. /// process whole image.
  27. PROCESS_TYPE_WHOLE,
  28. /// process every pixel step.
  29. PROCESS_TYPE_PIXEL,
  30. };
  31. /// Whether the image can be disposed by this processor.
  32. virtual bool ValidateColorBits (const FCObjImage* pImg) =0 ;
  33. /// Query process type, default to return PROCESS_TYPE_PIXEL.
  34. virtual PROCESS_TYPE QueryProcessType() {return PROCESS_TYPE_PIXEL;}
  35. /// Before process.
  36. virtual void OnEnterProcess (FCObjImage* pImg) {}
  37. /// Process (x,y) pixel when QueryProcessType return PROCESS_TYPE_PIXEL.
  38. virtual void ProcessPixel (FCObjImage* pImg, int x, int y, BYTE* pPixel) {}
  39. /// Process whole image when QueryProcessType return PROCESS_TYPE_WHOLE.
  40. virtual void ProcessWholeImage (FCObjImage* pImg, FCObjProgress* pProgress) {}
  41. /// After process.
  42. virtual void OnLeaveProcess (FCObjImage* pImg) {}
  43. };
  44. //=============================================================================
  45. // inline Implement
  46. //=============================================================================
  47. #endif