DllInterface.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _DllInterface_h_
  2. #define _DllInterface_h_
  3. #include <EIMResult.h>
  4. #include <atlimage.h>
  5. typedef BOOL (*dll_initializeFromFile)( const char*, double, double );
  6. typedef BOOL (*dll_initializeFromRaw)( const char*, int, int, int, BOOL, double, double );
  7. typedef BOOL (*dll_setFirstPoint)( int, int );
  8. typedef float (*dll_getDistanceToFirstPoint)( int, int );
  9. typedef BOOL (*dll_setSecondPoint)( int, int, imt::IMTResult* );
  10. typedef int (*dll_getImageWidth)();
  11. typedef int (*dll_getImageHeight)();
  12. typedef int (*dll_getImageBitsPerPixel)();
  13. typedef char* (*dll_getPixelArray)();
  14. class DllInterface
  15. {
  16. public:
  17. DllInterface();
  18. virtual ~DllInterface();
  19. BOOL IsValid();
  20. void Clear();
  21. imt::IMTResult* GetResult();
  22. BOOL initializeFromFile( const char*, double mmPerPixelX = -1.0, double mmPerPixelY = -1.0 );
  23. BOOL setFirstPoint( CPoint );
  24. BOOL setSecondPoint( CPoint );
  25. dll_initializeFromRaw initializeFromRaw;
  26. dll_getDistanceToFirstPoint getDistanceToFirstPoint;
  27. dll_getImageWidth getImageWidth;
  28. dll_getImageHeight getImageHeight;
  29. dll_getImageBitsPerPixel getImageBitsPerPixel;
  30. dll_getPixelArray getPixelArray;
  31. private:
  32. void Initialize();
  33. dll_initializeFromFile m_initializeFromFile;
  34. dll_setFirstPoint m_setFirstPoint;
  35. dll_setSecondPoint m_setSecondPoint;
  36. HMODULE hDLL;
  37. BOOL m_isValid;
  38. imt::IMTResult eimResult;
  39. };
  40. #endif