You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.4 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdint.h>
  4. #include <dlfcn.h>
  5. int main() {
  6. void *lib;
  7. uint64_t (*ext_get_ahash)(const char *);
  8. uint64_t (*ext_get_dhash)(const char *);
  9. uint64_t (*ext_get_phash)(const char *);
  10. static const char largePath[] = u8"test_images/sample_01_large.jpg";
  11. static const char mediumPath[] = u8"test_images/sample_01_medium.jpg";
  12. static const char smallPath[] = u8"test_images/sample_01_small.jpg";
  13. lib = dlopen("./libpihash.so", RTLD_LAZY);
  14. uint64_t largeA = ext_get_ahash(*largePath);
  15. uint64_t largeD = ext_get_dhash(*largePath);
  16. uint64_t largeP = ext_get_phash(*largePath);
  17. uint64_t mediumA = ext_get_ahash(*mediumPath);
  18. uint64_t mediumD = ext_get_dhash(*mediumPath);
  19. uint64_t mediumP = ext_get_phash(*mediumPath);
  20. uint64_t smallA = ext_get_ahash(*smallPath);
  21. uint64_t smallD = ext_get_dhash(*smallPath);
  22. uint64_t smallP = ext_get_phash(*smallPath);
  23. printf("Large_Test_AHash: ", largeA);
  24. printf("Large_Test_DHash: ", largeD);
  25. printf("Large_Test_PHash: ", largeP);
  26. printf("Medium_Test_AHash: ", mediumA);
  27. printf("Medium_Test_DHash: ", mediumD);
  28. printf("Medium_Test_PHash: ", mediumP);
  29. printf("Small_Test_AHash: ", smallA);
  30. printf("Small_Test_DHash: ", smallD);
  31. printf("Small_Test_PHash: ", smallP);
  32. if (lib != NULL ) dlclose(lib);
  33. return EXIT_SUCCESS;
  34. }