Advertisement
wandrake

Untitled

Sep 17th, 2014
491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. extern "C" {
  2.     __declspec(dllexport) void * Image_new(uint32_t channels, void ** data) {
  3.         std::vector<myns::Matrix> v;
  4.         for (int i = 0; i < channels; ++i) v.push_back(*((myns::Matrix*)data[i]));
  5.         return new (std::nothrow) myns::Image(channels, v);
  6.     }
  7.  
  8.     __declspec(dllexport) void * Image_convolve(void * im, void * kernel) {
  9.         return &(((myns::Image*)im)->convolve(*(myns::Kernel*)kernel));
  10.     }
  11.  
  12.     __declspec(dllexport) double * Image_getPixel(void * im, uint32_t i, uint32_t j) {
  13.         return ((myns::Image*)im)->getPixel(i, j);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement