-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgpupixel_pywrapper.cc
33 lines (25 loc) · 1.21 KB
/
gpupixel_pywrapper.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "gpupixel_wrapper.h"
extern "C" {
typedef void* GPUPixelWrapperPtr;
GPUPixelWrapperPtr GPUPixelWrapper_create() {
return new GPUPixelWrapper();
}
bool GPUPixelWrapper_initialize(GPUPixelWrapperPtr self) {
return reinterpret_cast<GPUPixelWrapper*>(self)->initialize();
}
void GPUPixelWrapper_setCallbacks(GPUPixelWrapperPtr self) {
reinterpret_cast<GPUPixelWrapper*>(self)->setCallbacks();
}
void GPUPixelWrapper_setParameters(GPUPixelWrapperPtr self, float beautyValue, float whithValue, float thinFaceValue, float bigeyeValue, float lipstickValue, float blusherValue) {
reinterpret_cast<GPUPixelWrapper*>(self)->setParameters(beautyValue, whithValue, thinFaceValue, bigeyeValue, lipstickValue, blusherValue);
}
void* GPUPixelWrapper_run(GPUPixelWrapperPtr self, const uint8_t* inputData, int width, int height, int channel) {
return reinterpret_cast<GPUPixelWrapper*>(self)->forward(inputData, width, height, channel);
}
void GPUPixelWrapper_release(GPUPixelWrapperPtr self) {
reinterpret_cast<GPUPixelWrapper*>(self)->release();
}
void GPUPixelWrapper_destroy(uint8_t* outputData) {
free(outputData);
}
}