EIMInterfaceDLL.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include "EIMInterfaceDLL.h"
  2. #include "EIMInterface.h"
  3. #include "CEIMResult.h"
  4. #include "EIMResult.h"
  5. #include "../Object/point.h"
  6. bool imt::initializeFromFile( const char* fileName, double mmPerPixelX, double mmPerPixelY )
  7. {
  8. return EIMInterface::getInstance().initialize( fileName, mmPerPixelX, mmPerPixelY );
  9. }
  10. bool imt::initializeFromRaw( const char* pixelArray, int width, int height, int bitsPerPixel, bool upsideDown, double mmPerPixelX, double mmPerPixelY )
  11. {
  12. return EIMInterface::getInstance().initialize( pixelArray, width, height, bitsPerPixel, upsideDown, mmPerPixelX, mmPerPixelY );
  13. }
  14. bool imt::setFirstPoint( int x, int y )
  15. {
  16. return EIMInterface::getInstance().setFirstPoint( x, y );
  17. }
  18. float imt::getDistanceToFirstPoint( int x, int y )
  19. {
  20. return EIMInterface::getInstance().getDistanceToFirstPoint( x, y );
  21. }
  22. bool imt::setSecondPoint( int x, int y, imt::IMTResult* result )
  23. {
  24. if ( !result )
  25. {
  26. return false;
  27. }
  28. CEIMResult eim_result;
  29. bool status = EIMInterface::getInstance().setSecondPoint( x, y, &eim_result );
  30. status |= eim_result.fill( result );
  31. return status;
  32. }
  33. int imt::getImageWidth()
  34. {
  35. return EIMInterface::getInstance().getImageWidth();
  36. }
  37. int imt::getImageHeight()
  38. {
  39. return EIMInterface::getInstance().getImageHeight();
  40. }
  41. int imt::getImageBitsPerPixel()
  42. {
  43. return EIMInterface::getInstance().getImageBitsPerPixel();
  44. }
  45. char* imt::getPixelArray()
  46. {
  47. return EIMInterface::getInstance().getPixelArray();
  48. }