13#include "enrollment/Export.h"
24 using ImageImplDestroyer = void (*)(
void*);
25 using ImageMaskImplDestroyer = void (*)(
void*);
31 virtual void* Create(
const uint8_t* image,
34 ErrorCallbacks errorCallbacks)
const = 0;
35 virtual void* CreateRaw(
unsigned int width,
40 ErrorCallbacks errorCallbacks)
const = 0;
41 virtual void* Clone(
const void*, ErrorCallbacks errorCallbacks)
const = 0;
42 [[nodiscard]]
virtual ImageImplDestroyer Destroy()
const = 0;
43 virtual uint8_t DeduceType(
const uint8_t* data,
size_t length, ErrorCallbacks errorCallbacks)
const = 0;
44 virtual bool IsEqual(
const void* left,
const void* right, ErrorCallbacks errorCallbacks)
const = 0;
45 virtual size_t RawSize(
const void* impl)
const = 0;
46 virtual void ToRaw(
const void* impl,
50 ErrorCallbacks errorCallbacks)
const = 0;
51 virtual size_t RawTypeSize(
const void* impl,
unsigned int type, ErrorCallbacks errorCallbacks)
const = 0;
52 virtual void ToRawType(
const void* impl,
56 ErrorCallbacks errorCallbacks)
const = 0;
57 virtual unsigned int Width(
const void* impl)
const = 0;
58 virtual unsigned int Height(
const void* impl)
const = 0;
59 virtual unsigned int Dpi(
const void* impl)
const = 0;
60 virtual void DrawLine(
void* impl,
68 unsigned char transparency,
69 unsigned char thickness,
70 ErrorCallbacks errorCallbacks)
const = 0;
71 virtual void DrawCircle(
void* impl,
78 unsigned char transparency,
79 unsigned char thickness,
80 ErrorCallbacks errorCallbacks)
const = 0;
81 virtual void DrawingFinished(
const void* impl, ErrorCallbacks errorCallbacks)
const = 0;
82 virtual void* CropAlignedRectangle(
const void* impl,
92 float rectangleHeight,
93 unsigned int imageWidth,
94 unsigned int imageHeight,
98 unsigned char transparency,
99 ErrorCallbacks errorCallbacks)
const = 0;
100 virtual void* Resize(
const void* impl,
float factor, ErrorCallbacks errorCallbacks)
const = 0;
101 virtual void* ChangeDpi(
const void* impl,
unsigned int targetDpi, ErrorCallbacks errorCallbacks)
const = 0;
102 virtual void* ChangeDpiArea(
const void* impl,
unsigned int targetDpi, ErrorCallbacks errorCallbacks)
const = 0;
103 virtual void* ChangeDpiNist(
const void* impl,
unsigned int targetDpi, ErrorCallbacks errorCallbacks)
const = 0;
104 virtual void* ChangeDpiNistWithOptions(
const void* impl,
105 unsigned int targetDpi,
106 uint8_t interpolationMethod,
108 ErrorCallbacks errorCallbacks)
const = 0;
109 virtual void* CropRectangle(
const void* impl,
118 unsigned int imageWidth,
119 unsigned int imageHeight,
123 unsigned char transparency,
124 ErrorCallbacks errorCallbacks)
const = 0;
125 virtual unsigned int IntersectionRectangle(
const void* impl,
134 ErrorCallbacks errorCallbacks)
const = 0;
135 virtual void* CropCircle(
const void* impl,
142 unsigned char transparency,
143 ErrorCallbacks errorCallbacks)
const = 0;
144 virtual unsigned int IntersectionCircle(
const void* impl,
148 ErrorCallbacks errorCallbacks)
const = 0;
149 virtual unsigned int IntersectionPoint(
const void* impl,
int x,
int y, ErrorCallbacks errorCallbacks)
const = 0;
150 virtual void GetRectangleDimensions(
float* width,
160 ErrorCallbacks errorCallbacks)
const = 0;
161 virtual void ResizeRectangle(
float width,
175 int* newBottomRightX,
176 int* newBottomRightY,
179 ErrorCallbacks errorCallbacks)
const = 0;
180 virtual void MaskCircle(
void* impl,
187 unsigned char transparency,
188 unsigned int maskType,
189 ErrorCallbacks errorCallbacks)
const = 0;
190 virtual void MaskPolygon(
void* impl,
197 unsigned char transparency,
198 unsigned int maskType,
199 ErrorCallbacks errorCallbacks)
const = 0;
200 virtual void BlurCircle(
void* impl,
204 unsigned int maskType,
205 unsigned int blurType,
206 ErrorCallbacks errorCallbacks)
const = 0;
207 virtual void BlurPolygon(
void* impl,
211 unsigned int maskType,
212 unsigned int blurType,
213 ErrorCallbacks errorCallbacks)
const = 0;
214 virtual void AddCircleToBlurMask(
void* impl,
218 unsigned int maskType,
219 ErrorCallbacks errorCallbacks) = 0;
220 virtual void AddPolygonToBlurMask(
void* impl,
224 unsigned int maskType,
225 ErrorCallbacks errorCallbacks) = 0;
226 virtual void ApplyBlur(
void* impl,
unsigned int blurType, ErrorCallbacks errorCallbacks) = 0;
227 virtual void* MaskingFinished(
void* impl, ErrorCallbacks errorCallbacks)
const = 0;
228 virtual void* CreateMasker(
void* impl, ErrorCallbacks errorCallbacks)
const = 0;
229 [[nodiscard]]
virtual ImageMaskImplDestroyer DestroyMask()
const = 0;
230 [[nodiscard]]
virtual size_t Channels(
void* impl, ErrorCallbacks errorCallbacks)
const = 0;
232 ImageExecutor() =
default;
233 virtual ~ImageExecutor() =
default;
234 ImageExecutor(
const ImageExecutor&) =
delete;
235 ImageExecutor(ImageExecutor&&) =
delete;
236 ImageExecutor& operator=(
const ImageExecutor&) =
delete;
237 ImageExecutor& operator=(ImageExecutor&&) =
delete;
242 INNO_ENROLLMENT_API
void* inno_local_Image_Create(
const uint8_t* image,
245 ErrorCallbacks errorCallbacks);
246 INNO_ENROLLMENT_API
void* inno_local_Image_Create_Raw(
unsigned int width,
250 const uint8_t* image,
251 ErrorCallbacks errorCallbacks);
252 INNO_ENROLLMENT_API
void* inno_local_Image_Clone(
const void* impl, ErrorCallbacks errorCallbacks);
253 INNO_ENROLLMENT_API
void inno_local_Image_Destroy(
void* impl);
254 INNO_ENROLLMENT_API uint8_t inno_local_Image_DeduceType(
const uint8_t* data,
256 ErrorCallbacks errorCallbacks);
257 INNO_ENROLLMENT_API
bool inno_local_Image_IsEqual(
const void* left,
259 ErrorCallbacks errorCallbacks);
260 INNO_ENROLLMENT_API
size_t inno_local_Image_RawSize(
const void* impl);
261 INNO_ENROLLMENT_API
void inno_local_Image_ToRaw(
const void* impl,
265 ErrorCallbacks errorCallbacks);
266 INNO_ENROLLMENT_API
size_t inno_local_Image_RawTypeSize(
const void* impl,
268 ErrorCallbacks errorCallbacks);
269 INNO_ENROLLMENT_API
void inno_local_Image_ToRawType(
const void* impl,
273 ErrorCallbacks errorCallbacks);
274 INNO_ENROLLMENT_API
unsigned int inno_local_Image_Width(
const void* impl);
275 INNO_ENROLLMENT_API
unsigned int inno_local_Image_Height(
const void* impl);
276 INNO_ENROLLMENT_API
unsigned int inno_local_Image_Dpi(
const void* impl);
277 INNO_ENROLLMENT_API
void inno_local_Image_DrawLine(
void* impl,
285 unsigned char transparency,
286 unsigned char thickness,
287 ErrorCallbacks errorCallbacks);
288 INNO_ENROLLMENT_API
void inno_local_Image_DrawCircle(
void* impl,
295 unsigned char transparency,
296 unsigned char thickness,
297 ErrorCallbacks errorCallbacks);
298 INNO_ENROLLMENT_API
void inno_local_Image_DrawingFinished(
const void* impl, ErrorCallbacks errorCallbacks);
299 INNO_ENROLLMENT_API
void* inno_local_Image_GetAlignedRectangle(
const void* impl,
308 float rectangleWidth,
309 float rectangleHeight,
310 unsigned int imageWidth,
311 unsigned int imageHeight,
315 unsigned char transparency,
316 ErrorCallbacks errorCallbacks);
317 INNO_ENROLLMENT_API
void* inno_local_Image_Resize(
const void* impl,
319 ErrorCallbacks errorCallbacks);
320 INNO_ENROLLMENT_API
void* inno_local_Image_ChangeDpi(
const void* impl,
321 unsigned int targetDpi,
322 ErrorCallbacks errorCallbacks);
323 INNO_ENROLLMENT_API
void* inno_local_Image_ChangeDpiArea(
const void* impl,
324 unsigned int targetDpi,
325 ErrorCallbacks errorCallbacks);
326 INNO_ENROLLMENT_API
void* inno_local_Image_ChangeDpiNist(
const void* impl,
327 unsigned int targetDpi,
328 ErrorCallbacks errorCallbacks);
329 INNO_ENROLLMENT_API
void* inno_local_Image_ChangeDpiNistWithOptions(
const void* impl,
330 unsigned int targetDpi,
331 uint8_t interpolationMethod,
333 ErrorCallbacks errorCallbacks);
334 INNO_ENROLLMENT_API
void* inno_local_Image_GetRectangle(
const void* impl,
343 unsigned int imageWidth,
344 unsigned int imageHeight,
348 unsigned char transparency,
349 ErrorCallbacks errorCallbacks);
350 INNO_ENROLLMENT_API
unsigned int inno_local_Image_Intersection_Rectangle(
const void* impl,
359 ErrorCallbacks errorCallbacks);
360 INNO_ENROLLMENT_API
void* inno_local_Image_GetCircle(
const void* impl,
367 unsigned char transparency,
368 ErrorCallbacks errorCallbacks);
369 INNO_ENROLLMENT_API
unsigned int inno_local_Image_Intersection_Circle(
const void* impl,
373 ErrorCallbacks errorCallbacks);
374 INNO_ENROLLMENT_API
unsigned int inno_local_Image_Intersection_Point(
const void* impl,
377 ErrorCallbacks errorCallbacks);
378 INNO_ENROLLMENT_API
void inno_local_Image_GetRectangleDimensions(
float* width,
388 ErrorCallbacks errorCallbacks);
389 INNO_ENROLLMENT_API
void inno_local_Image_ResizeRectangle(
float width,
403 int* newBottomRightX,
404 int* newBottomRightY,
407 ErrorCallbacks errorCallbacks);
408 INNO_ENROLLMENT_API
void inno_local_Image_MaskCircle(
void* impl,
415 unsigned char transparency,
416 unsigned int maskType,
417 ErrorCallbacks errorCallbacks);
418 INNO_ENROLLMENT_API
void inno_local_Image_MaskPolygon(
void* impl,
425 unsigned char transparency,
426 unsigned int maskType,
427 ErrorCallbacks errorCallbacks);
428 INNO_ENROLLMENT_API
void inno_local_Image_BlurCircle(
void* impl,
432 unsigned int maskType,
433 unsigned int blurType,
434 ErrorCallbacks errorCallbacks);
435 INNO_ENROLLMENT_API
void inno_local_Image_BlurPolygon(
void* impl,
439 unsigned int maskType,
440 unsigned int blurType,
441 ErrorCallbacks errorCallbacks);
442 INNO_ENROLLMENT_API
void inno_local_Image_AddCircleToBlurMask(
void* impl,
446 unsigned int maskType,
447 ErrorCallbacks errorCallbacks);
448 INNO_ENROLLMENT_API
void inno_local_Image_AddPolygonToBlurMask(
void* impl,
452 unsigned int maskType,
453 ErrorCallbacks errorCallbacks);
454 INNO_ENROLLMENT_API
void inno_local_Image_ApplyBlur(
void* impl,
455 unsigned int blurType,
456 ErrorCallbacks errorCallbacks);
457 INNO_ENROLLMENT_API
void* inno_local_Image_MaskingFinished(
void* impl, ErrorCallbacks errorCallbacks);
458 INNO_ENROLLMENT_API
void* inno_local_Image_CreateMasker(
void* impl, ErrorCallbacks errorCallbacks);
459 INNO_ENROLLMENT_API
void inno_local_Image_DestroyMask(
void* impl);
460 INNO_ENROLLMENT_API
size_t inno_local_Image_GetNumOfChannels(
void* impl, ErrorCallbacks errorCallbacks);
462 class LocalImageExecutor :
public ImageExecutor
465 void* Create(
const uint8_t* image,
468 ErrorCallbacks errorCallbacks)
const final
470 return inno_local_Image_Create(image, imageLength, dpi, errorCallbacks);
473 void* CreateRaw(
unsigned int width,
477 const uint8_t* image,
478 ErrorCallbacks errorCallbacks)
const final
480 return inno_local_Image_Create_Raw(width, height, dpi, type, image, errorCallbacks);
482 void* Clone(
const void* impl, ErrorCallbacks errorCallbacks)
const final
484 return inno_local_Image_Clone(impl, errorCallbacks);
486 [[nodiscard]] ImageImplDestroyer Destroy() const final
488 return inno_local_Image_Destroy;
490 uint8_t DeduceType(
const uint8_t* data,
size_t length, ErrorCallbacks errorCallbacks)
const final
492 return inno_local_Image_DeduceType(data, length, errorCallbacks);
494 bool IsEqual(
const void* left,
const void* right, ErrorCallbacks errorCallbacks)
const final
496 return inno_local_Image_IsEqual(left, right, errorCallbacks);
498 size_t RawSize(
const void* impl)
const final
500 return inno_local_Image_RawSize(impl);
502 void ToRaw(
const void* impl,
506 ErrorCallbacks errorCallbacks)
const final
508 inno_local_Image_ToRaw(impl, data, size, type, errorCallbacks);
510 size_t RawTypeSize(
const void* impl,
unsigned int type, ErrorCallbacks errorCallbacks)
const final
512 return inno_local_Image_RawTypeSize(impl, type, errorCallbacks);
514 void ToRawType(
const void* impl,
518 ErrorCallbacks errorCallbacks)
const final
520 inno_local_Image_ToRawType(impl, data, size, type, errorCallbacks);
522 unsigned int Width(
const void* impl)
const final
524 return inno_local_Image_Width(impl);
526 unsigned int Height(
const void* impl)
const final
528 return inno_local_Image_Height(impl);
530 unsigned int Dpi(
const void* impl)
const final
532 return inno_local_Image_Dpi(impl);
534 void DrawLine(
void* impl,
542 unsigned char transparency,
543 unsigned char thickness,
544 ErrorCallbacks errorCallbacks)
const final
546 inno_local_Image_DrawLine(
547 impl, startX, startY, endX, endY, red, green, blue, transparency, thickness, errorCallbacks);
549 void DrawCircle(
void* impl,
556 unsigned char transparency,
557 unsigned char thickness,
558 ErrorCallbacks errorCallbacks)
const final
560 inno_local_Image_DrawCircle(
561 impl, centerX, centerY, radius, red, green, blue, transparency, thickness, errorCallbacks);
563 void DrawingFinished(
const void* impl, ErrorCallbacks errorCallbacks)
const final
565 inno_local_Image_DrawingFinished(impl, errorCallbacks);
567 void* Resize(
const void* impl,
float factor, ErrorCallbacks errorCallbacks)
const final
569 return inno_local_Image_Resize(impl, factor, errorCallbacks);
571 void* ChangeDpi(
const void* impl,
unsigned int targetDpi, ErrorCallbacks errorCallbacks)
const final
573 return inno_local_Image_ChangeDpi(impl, targetDpi, errorCallbacks);
575 void* ChangeDpiArea(
const void* impl,
unsigned int targetDpi, ErrorCallbacks errorCallbacks)
const final
577 return inno_local_Image_ChangeDpiArea(impl, targetDpi, errorCallbacks);
580 void* ChangeDpiNist(
const void* impl,
unsigned int targetDpi, ErrorCallbacks errorCallbacks)
const final
582 return inno_local_Image_ChangeDpiNist(impl, targetDpi, errorCallbacks);
585 void* ChangeDpiNistWithOptions(
const void* impl,
586 unsigned int targetDpi,
587 uint8_t interpolationMethod,
589 ErrorCallbacks errorCallbacks)
const final
591 return inno_local_Image_ChangeDpiNistWithOptions(
592 impl, targetDpi, interpolationMethod, filterType, errorCallbacks);
595 void* CropAlignedRectangle(
const void* impl,
604 float rectangleWidth,
605 float rectangleHeight,
606 unsigned int imageWidth,
607 unsigned int imageHeight,
611 unsigned char transparency,
612 ErrorCallbacks errorCallbacks)
const final
614 return inno_local_Image_GetAlignedRectangle(impl,
634 void* CropRectangle(
const void* impl,
643 unsigned int imageWidth,
644 unsigned int imageHeight,
648 unsigned char transparency,
649 ErrorCallbacks errorCallbacks)
const final
651 return inno_local_Image_GetRectangle(impl,
668 unsigned int IntersectionRectangle(
const void* impl,
677 ErrorCallbacks errorCallbacks)
const final
679 return inno_local_Image_Intersection_Rectangle(impl,
690 void* CropCircle(
const void* impl,
697 unsigned char transparency,
698 ErrorCallbacks errorCallbacks)
const final
700 return inno_local_Image_GetCircle(
701 impl, centerX, centerY, radius, red, green, blue, transparency, errorCallbacks);
703 unsigned int IntersectionCircle(
const void* impl,
707 ErrorCallbacks errorCallbacks)
const final
709 return inno_local_Image_Intersection_Circle(impl, centerX, centerY, radius, errorCallbacks);
711 unsigned int IntersectionPoint(
const void* impl,
int x,
int y, ErrorCallbacks errorCallbacks)
const final
713 return inno_local_Image_Intersection_Point(impl, x, y, errorCallbacks);
716 void GetRectangleDimensions(
float* width,
726 ErrorCallbacks errorCallbacks)
const final
728 inno_local_Image_GetRectangleDimensions(width,
741 void ResizeRectangle(
float width,
755 int* newBottomRightX,
756 int* newBottomRightY,
759 ErrorCallbacks errorCallbacks)
const final
761 inno_local_Image_ResizeRectangle(width,
782 void MaskCircle(
void* impl,
789 unsigned char transparency,
790 unsigned int maskType,
791 ErrorCallbacks errorCallbacks)
const final
793 inno_local_Image_MaskCircle(
794 impl, centerX, centerY, radius, red, green, blue, transparency, maskType, errorCallbacks);
797 void MaskPolygon(
void* impl,
804 unsigned char transparency,
805 unsigned int maskType,
806 ErrorCallbacks errorCallbacks)
const final
808 inno_local_Image_MaskPolygon(impl, x, y, size, red, green, blue, transparency, maskType, errorCallbacks);
811 void BlurCircle(
void* impl,
815 unsigned int maskType,
816 unsigned int blurType,
817 ErrorCallbacks errorCallbacks)
const final
819 inno_local_Image_BlurCircle(impl, centerX, centerY, radius, maskType, blurType, errorCallbacks);
822 void BlurPolygon(
void* impl,
826 unsigned int maskType,
827 unsigned int blurType,
828 ErrorCallbacks errorCallbacks)
const final
830 inno_local_Image_BlurPolygon(impl, x, y, size, maskType, blurType, errorCallbacks);
833 void AddCircleToBlurMask(
void* impl,
837 unsigned int maskType,
838 ErrorCallbacks errorCallbacks)
final
840 inno_local_Image_AddCircleToBlurMask(impl, centerX, centerY, radius, maskType, errorCallbacks);
843 void AddPolygonToBlurMask(
void* impl,
847 unsigned int maskType,
848 ErrorCallbacks errorCallbacks)
final
850 inno_local_Image_AddPolygonToBlurMask(impl, x, y, size, maskType, errorCallbacks);
853 void ApplyBlur(
void* impl,
unsigned int blurType, ErrorCallbacks errorCallbacks)
final
855 inno_local_Image_ApplyBlur(impl, blurType, errorCallbacks);
858 void* MaskingFinished(
void* impl, ErrorCallbacks errorCallbacks)
const final
860 return inno_local_Image_MaskingFinished(impl, errorCallbacks);
863 void* CreateMasker(
void* impl, ErrorCallbacks errorCallbacks)
const final
865 return inno_local_Image_CreateMasker(impl, errorCallbacks);
868 [[nodiscard]] ImageMaskImplDestroyer DestroyMask() const final
870 return inno_local_Image_DestroyMask;
873 [[nodiscard]]
size_t Channels(
void* impl, ErrorCallbacks errorCallbacks)
const final
875 return inno_local_Image_GetNumOfChannels(impl, errorCallbacks);
878 LocalImageExecutor() =
default;
879 virtual ~LocalImageExecutor() =
default;
880 LocalImageExecutor(
const LocalImageExecutor&) =
delete;
881 LocalImageExecutor(LocalImageExecutor&&) =
delete;
882 LocalImageExecutor& operator=(
const LocalImageExecutor&) =
delete;
883 LocalImageExecutor& operator=(LocalImageExecutor&&) =
delete;
888 struct inno_grcp_ImageChannel;
889 INNO_ENROLLMENT_API inno_grcp_ImageChannel* inno_grpc_Image_Channel_Create(
const char* endpoint);
890 INNO_ENROLLMENT_API
void inno_grpc_Image_Channel_Destroy(inno_grcp_ImageChannel* channel);
892 INNO_ENROLLMENT_API
void* inno_grpc_Image_Create(inno_grcp_ImageChannel* channel,
893 const uint8_t* image,
896 ErrorCallbacks errorCallbacks);
897 INNO_ENROLLMENT_API
void* inno_grpc_Image_Create_Raw(inno_grcp_ImageChannel* channel,
902 const uint8_t* image,
903 ErrorCallbacks errorCallbacks);
904 INNO_ENROLLMENT_API
void* inno_grpc_Image_Clone(
const void* impl, ErrorCallbacks errorCallbacks);
905 INNO_ENROLLMENT_API
void inno_grpc_Image_Destroy(
void* impl);
906 INNO_ENROLLMENT_API uint8_t inno_grpc_Image_DeduceType(
const uint8_t* data,
908 ErrorCallbacks errorCallbacks);
909 INNO_ENROLLMENT_API
bool inno_grpc_Image_IsEqual(
const void* left,
911 ErrorCallbacks errorCallbacks);
912 INNO_ENROLLMENT_API
size_t inno_grpc_Image_RawSize(
const void* impl);
913 INNO_ENROLLMENT_API
void inno_grpc_Image_ToRaw(
const void* impl,
917 ErrorCallbacks errorCallbacks);
918 INNO_ENROLLMENT_API
size_t inno_grpc_Image_RawTypeSize(
const void* impl,
920 ErrorCallbacks errorCallbacks);
921 INNO_ENROLLMENT_API
void inno_grpc_Image_ToRawType(
const void* impl,
925 ErrorCallbacks errorCallbacks);
926 INNO_ENROLLMENT_API
unsigned int inno_grpc_Image_Width(
const void* impl);
927 INNO_ENROLLMENT_API
unsigned int inno_grpc_Image_Height(
const void* impl);
928 INNO_ENROLLMENT_API
unsigned int inno_grpc_Image_Dpi(
const void* impl);
929 INNO_ENROLLMENT_API
void inno_grpc_Image_DrawLine(
void* impl,
937 unsigned char transparency,
938 unsigned char thickness,
939 ErrorCallbacks errorCallbacks);
940 INNO_ENROLLMENT_API
void inno_grpc_Image_DrawCircle(
void* impl,
947 unsigned char transparency,
948 unsigned char thickness,
949 ErrorCallbacks errorCallbacks);
950 INNO_ENROLLMENT_API
void inno_grpc_Image_DrawingFinished(
const void* impl, ErrorCallbacks errorCallbacks);
951 INNO_ENROLLMENT_API
void* inno_grpc_Image_Resize(
const void* impl,
float factor, ErrorCallbacks errorCallbacks);
952 INNO_ENROLLMENT_API
void* inno_grpc_Image_ChangeDpi(
const void* impl,
953 unsigned int targetDpi,
954 ErrorCallbacks errorCallbacks);
955 INNO_ENROLLMENT_API
void* inno_grpc_Image_ChangeDpiArea(
const void* impl,
956 unsigned int targetDpi,
957 ErrorCallbacks errorCallbacks);
958 INNO_ENROLLMENT_API
void* inno_grpc_Image_ChangeDpiNist(
const void* impl,
959 unsigned int targetDpi,
960 ErrorCallbacks errorCallbacks);
961 INNO_ENROLLMENT_API
void* inno_grpc_Image_ChangeDpiNistWithOptions(
const void* impl,
962 unsigned int targetDpi,
963 uint8_t interpolationMethod,
965 ErrorCallbacks errorCallbacks);
966 INNO_ENROLLMENT_API
void* inno_grpc_Image_GetAlignedRectangle(
const void* impl,
975 float rectangleWidth,
976 float rectangleHeight,
977 unsigned int imageWidth,
978 unsigned int imageHeight,
982 unsigned char transparency,
983 ErrorCallbacks errorCallbacks);
984 INNO_ENROLLMENT_API
void* inno_grpc_Image_GetRectangle(
const void* impl,
993 unsigned int imageWidth,
994 unsigned int imageHeight,
998 unsigned char transparency,
999 ErrorCallbacks errorCallbacks);
1000 INNO_ENROLLMENT_API
unsigned int inno_grpc_Image_Intersection_Rectangle(
const void* impl,
1009 ErrorCallbacks errorCallbacks);
1010 INNO_ENROLLMENT_API
void* inno_grpc_Image_GetCircle(
const void* impl,
1013 unsigned int radius,
1015 unsigned char green,
1017 unsigned char transparency,
1018 ErrorCallbacks errorCallbacks);
1019 INNO_ENROLLMENT_API
unsigned int inno_grpc_Image_Intersection_Circle(
const void* impl,
1022 unsigned int radius,
1023 ErrorCallbacks errorCallbacks);
1024 INNO_ENROLLMENT_API
unsigned int inno_grpc_Image_Intersection_Point(
const void* impl,
1027 ErrorCallbacks errorCallbacks);
1028 INNO_ENROLLMENT_API
void inno_grpc_Image_GetRectangleDimensions(
const inno_grcp_ImageChannel* channel,
1039 ErrorCallbacks errorCallbacks);
1040 INNO_ENROLLMENT_API
void inno_grpc_Image_ResizeRectangle(
const inno_grcp_ImageChannel* channel,
1055 int* newBottomRightX,
1056 int* newBottomRightY,
1057 int* newBottomLeftX,
1058 int* newBottomLeftY,
1059 ErrorCallbacks errorCallbacks);
1061 INNO_ENROLLMENT_API
void inno_grpc_Image_MaskCircle(
void* impl,
1064 unsigned int radius,
1066 unsigned char green,
1068 unsigned char transparency,
1069 unsigned int maskType,
1070 ErrorCallbacks errorCallbacks);
1071 INNO_ENROLLMENT_API
void inno_grpc_Image_MaskPolygon(
void* impl,
1076 unsigned char green,
1078 unsigned char transparency,
1079 unsigned int maskType,
1080 ErrorCallbacks errorCallbacks);
1081 INNO_ENROLLMENT_API
void inno_grpc_Image_BlurCircle(
void* impl,
1084 unsigned int radius,
1085 unsigned int maskType,
1086 unsigned int blurType,
1087 ErrorCallbacks errorCallbacks);
1088 INNO_ENROLLMENT_API
void inno_grpc_Image_BlurPolygon(
void* impl,
1092 unsigned int maskType,
1093 unsigned int blurType,
1094 ErrorCallbacks errorCallbacks);
1095 INNO_ENROLLMENT_API
void inno_grpc_Image_AddCircleToBlurMask(
void* impl,
1098 unsigned int radius,
1099 unsigned int maskType,
1100 ErrorCallbacks errorCallbacks);
1101 INNO_ENROLLMENT_API
void inno_grpc_Image_AddPolygonToBlurMask(
void* impl,
1105 unsigned int maskType,
1106 ErrorCallbacks errorCallbacks);
1107 INNO_ENROLLMENT_API
void inno_grpc_Image_ApplyBlur(
void* impl,
1108 unsigned int blurType,
1109 ErrorCallbacks errorCallbacks);
1110 INNO_ENROLLMENT_API
void* inno_grpc_Image_MaskingFinished(
void* impl, ErrorCallbacks errorCallbacks);
1111 INNO_ENROLLMENT_API
void* inno_grpc_Image_CreateMasker(
void* impl, ErrorCallbacks errorCallbacks);
1112 INNO_ENROLLMENT_API
void inno_grpc_Image_DestroyMask(
void* impl);
1113 INNO_ENROLLMENT_API
size_t inno_grpc_Image_GetNumOfChannels(
void* impl, ErrorCallbacks errorCallbacks);
1116 class GrpcImageExecutor :
public ImageExecutor
1119 void* Create(
const uint8_t* image,
1122 ErrorCallbacks errorCallbacks)
const final
1124 return inno_grpc_Image_Create(channel.get(), image, imageLength, dpi, errorCallbacks);
1127 void* CreateRaw(
unsigned int width,
1128 unsigned int height,
1131 const uint8_t* image,
1132 ErrorCallbacks errorCallbacks)
const final
1134 return inno_grpc_Image_Create_Raw(channel.get(), width, height, dpi, type, image, errorCallbacks);
1136 void* Clone(
const void* impl, ErrorCallbacks errorCallbacks)
const final
1138 return inno_grpc_Image_Clone(impl, errorCallbacks);
1140 [[nodiscard]] ImageImplDestroyer Destroy() const final
1142 return inno_grpc_Image_Destroy;
1144 uint8_t DeduceType(
const uint8_t* data,
size_t length, ErrorCallbacks errorCallbacks)
const final
1146 return inno_grpc_Image_DeduceType(data, length, errorCallbacks);
1148 bool IsEqual(
const void* left,
const void* right, ErrorCallbacks errorCallbacks)
const final
1150 return inno_grpc_Image_IsEqual(left, right, errorCallbacks);
1152 size_t RawSize(
const void* impl)
const final
1154 return inno_grpc_Image_RawSize(impl);
1156 void ToRaw(
const void* impl,
1160 ErrorCallbacks errorCallbacks)
const final
1162 inno_grpc_Image_ToRaw(impl, data, size, type, errorCallbacks);
1164 size_t RawTypeSize(
const void* impl,
unsigned int type, ErrorCallbacks errorCallbacks)
const final
1166 return inno_grpc_Image_RawTypeSize(impl, type, errorCallbacks);
1168 void ToRawType(
const void* impl,
1172 ErrorCallbacks errorCallbacks)
const final
1174 inno_grpc_Image_ToRawType(impl, data, size, type, errorCallbacks);
1176 unsigned int Width(
const void* impl)
const final
1178 return inno_grpc_Image_Width(impl);
1180 unsigned int Height(
const void* impl)
const final
1182 return inno_grpc_Image_Height(impl);
1184 unsigned int Dpi(
const void* impl)
const final
1186 return inno_grpc_Image_Dpi(impl);
1188 void DrawLine(
void* impl,
1194 unsigned char green,
1196 unsigned char transparency,
1197 unsigned char thickness,
1198 ErrorCallbacks errorCallbacks)
const final
1200 inno_grpc_Image_DrawLine(
1201 impl, startX, startY, endX, endY, red, green, blue, transparency, thickness, errorCallbacks);
1203 void DrawCircle(
void* impl,
1206 unsigned int radius,
1208 unsigned char green,
1210 unsigned char transparency,
1211 unsigned char thickness,
1212 ErrorCallbacks errorCallbacks)
const final
1214 inno_grpc_Image_DrawCircle(
1215 impl, centerX, centerY, radius, red, green, blue, transparency, thickness, errorCallbacks);
1217 void DrawingFinished(
const void* impl, ErrorCallbacks errorCallbacks)
const final
1219 inno_grpc_Image_DrawingFinished(impl, errorCallbacks);
1222 void* Resize(
const void* impl,
float factor, ErrorCallbacks errorCallbacks)
const final
1224 return inno_grpc_Image_Resize(impl, factor, errorCallbacks);
1227 void* ChangeDpi(
const void* impl,
unsigned int targetDpi, ErrorCallbacks errorCallbacks)
const final
1229 return inno_grpc_Image_ChangeDpi(impl, targetDpi, errorCallbacks);
1232 void* ChangeDpiArea(
const void* impl,
unsigned int targetDpi, ErrorCallbacks errorCallbacks)
const final
1234 return inno_grpc_Image_ChangeDpiArea(impl, targetDpi, errorCallbacks);
1237 void* ChangeDpiNist(
const void* impl,
unsigned int targetDpi, ErrorCallbacks errorCallbacks)
const final
1239 return inno_grpc_Image_ChangeDpiNist(impl, targetDpi, errorCallbacks);
1242 void* ChangeDpiNistWithOptions(
const void* impl,
1243 unsigned int targetDpi,
1244 uint8_t interpolationMethod,
1246 ErrorCallbacks errorCallbacks)
const final
1248 return inno_grpc_Image_ChangeDpiNistWithOptions(
1249 impl, targetDpi, interpolationMethod, filterType, errorCallbacks);
1252 void* CropAlignedRectangle(
const void* impl,
1261 float rectangleWidth,
1262 float rectangleHeight,
1263 unsigned int imageWidth,
1264 unsigned int imageHeight,
1266 unsigned char green,
1268 unsigned char transparency,
1269 ErrorCallbacks errorCallbacks)
const final
1271 return inno_grpc_Image_GetAlignedRectangle(impl,
1291 void* CropRectangle(
const void* impl,
1300 unsigned int imageWidth,
1301 unsigned int imageHeight,
1303 unsigned char green,
1305 unsigned char transparency,
1306 ErrorCallbacks errorCallbacks)
const final
1308 return inno_grpc_Image_GetRectangle(impl,
1325 unsigned int IntersectionRectangle(
const void* impl,
1334 ErrorCallbacks errorCallbacks)
const final
1336 return inno_grpc_Image_Intersection_Rectangle(impl,
1347 void* CropCircle(
const void* impl,
1350 unsigned int radius,
1352 unsigned char green,
1354 unsigned char transparency,
1355 ErrorCallbacks errorCallbacks)
const final
1357 return inno_grpc_Image_GetCircle(
1358 impl, centerX, centerY, radius, red, green, blue, transparency, errorCallbacks);
1360 unsigned int IntersectionCircle(
const void* impl,
1363 unsigned int radius,
1364 ErrorCallbacks errorCallbacks)
const final
1366 return inno_grpc_Image_Intersection_Circle(impl, centerX, centerY, radius, errorCallbacks);
1368 unsigned int IntersectionPoint(
const void* impl,
int x,
int y, ErrorCallbacks errorCallbacks)
const final
1370 return inno_grpc_Image_Intersection_Point(impl, x, y, errorCallbacks);
1373 void GetRectangleDimensions(
float* width,
1383 ErrorCallbacks errorCallbacks)
const final
1385 inno_grpc_Image_GetRectangleDimensions(channel.get(),
1399 void ResizeRectangle(
float width,
1413 int* newBottomRightX,
1414 int* newBottomRightY,
1415 int* newBottomLeftX,
1416 int* newBottomLeftY,
1417 ErrorCallbacks errorCallbacks)
const final
1419 inno_grpc_Image_ResizeRectangle(channel.get(),
1441 void MaskCircle(
void* impl,
1444 unsigned int radius,
1446 unsigned char green,
1448 unsigned char transparency,
1449 unsigned int maskType,
1450 ErrorCallbacks errorCallbacks)
const final
1452 inno_grpc_Image_MaskCircle(
1453 impl, centerX, centerY, radius, red, green, blue, transparency, maskType, errorCallbacks);
1456 void MaskPolygon(
void* impl,
1461 unsigned char green,
1463 unsigned char transparency,
1464 unsigned int maskType,
1465 ErrorCallbacks errorCallbacks)
const final
1467 inno_grpc_Image_MaskPolygon(impl, x, y, size, red, green, blue, transparency, maskType, errorCallbacks);
1470 void BlurCircle(
void* impl,
1473 unsigned int radius,
1474 unsigned int maskType,
1475 unsigned int blurType,
1476 ErrorCallbacks errorCallbacks)
const final
1478 inno_grpc_Image_BlurCircle(impl, centerX, centerY, radius, maskType, blurType, errorCallbacks);
1481 void BlurPolygon(
void* impl,
1485 unsigned int maskType,
1486 unsigned int blurType,
1487 ErrorCallbacks errorCallbacks)
const final
1489 inno_grpc_Image_BlurPolygon(impl, x, y, size, maskType, blurType, errorCallbacks);
1492 void AddCircleToBlurMask(
void* impl,
1495 unsigned int radius,
1496 unsigned int maskType,
1497 ErrorCallbacks errorCallbacks)
final
1499 inno_grpc_Image_AddCircleToBlurMask(impl, centerX, centerY, radius, maskType, errorCallbacks);
1502 void AddPolygonToBlurMask(
void* impl,
1506 unsigned int maskType,
1507 ErrorCallbacks errorCallbacks)
final
1509 inno_grpc_Image_AddPolygonToBlurMask(impl, x, y, size, maskType, errorCallbacks);
1512 void ApplyBlur(
void* impl,
unsigned int blurType, ErrorCallbacks errorCallbacks)
final
1514 inno_grpc_Image_ApplyBlur(impl, blurType, errorCallbacks);
1517 void* MaskingFinished(
void* impl, ErrorCallbacks errorCallbacks)
const final
1519 return inno_grpc_Image_MaskingFinished(impl, errorCallbacks);
1522 void* CreateMasker(
void* impl, ErrorCallbacks errorCallbacks)
const final
1524 return inno_grpc_Image_CreateMasker(impl, errorCallbacks);
1527 [[nodiscard]] ImageMaskImplDestroyer DestroyMask() const final
1529 return inno_grpc_Image_DestroyMask;
1532 [[nodiscard]]
size_t Channels(
void* impl, ErrorCallbacks errorCallbacks)
const final
1534 return inno_grpc_Image_GetNumOfChannels(impl, errorCallbacks);
1542 explicit GrpcImageExecutor(
const std::string& endPoint)
1543 : channel(inno_grpc_Image_Channel_Create(endPoint.c_str()), inno_grpc_Image_Channel_Destroy)
1547 GrpcImageExecutor() =
delete;
1548 virtual ~GrpcImageExecutor() =
default;
1549 GrpcImageExecutor(
const GrpcImageExecutor&) =
delete;
1550 GrpcImageExecutor(GrpcImageExecutor&&) =
delete;
1551 GrpcImageExecutor& operator=(
const GrpcImageExecutor&) =
delete;
1552 GrpcImageExecutor& operator=(GrpcImageExecutor&&) =
delete;
1555 std::unique_ptr<inno_grcp_ImageChannel, void (*)(inno_grcp_ImageChannel*)> channel;
1564 class GlobalImageExecutor
1571 static std::shared_ptr<ImageExecutor>
Get()
1573 return GlobalImageExecutor::Instance().GetInternal();
1581 static void Set(std::shared_ptr<ImageExecutor> executor)
1583 if (executor ==
nullptr)
1588 GlobalImageExecutor::Instance().SetInternal(std::move(executor));
1599 std::shared_ptr<ImageExecutor> pe;
1608 std::shared_ptr<ImageExecutor> GetInternal()
1610 const std::scoped_lock lock(peMux);
1614 void SetInternal(std::shared_ptr<ImageExecutor> executor)
1616 const std::scoped_lock lock(peMux);
1617 pe = std::move(executor);
1620 explicit GlobalImageExecutor(std::shared_ptr<ImageExecutor> e)
Holds instance of ImageExecutor.
Definition ImageExecutor.h:1564
static std::shared_ptr< ImageExecutor > Get()
Provides current executor.
Definition ImageExecutor.h:1570
static void Set(std::shared_ptr< ImageExecutor > executor)
Sets new global executor.
Definition ImageExecutor.h:1580
Null argument is not allowed.
Definition EnrollmentException.h:156