| 842 | } |
| 843 | |
| 844 | void MNNSamplerCopyCommon(const unsigned char* source, unsigned char* dest, MNN::CV::Point* points, size_t sta, |
| 845 | size_t count, size_t iw, size_t ih, size_t yStride, int bpp) { |
| 846 | dest = dest + bpp * sta; |
| 847 | MNN::CV::Point curPoints; |
| 848 | curPoints.fX = points[0].fX; |
| 849 | curPoints.fY = points[0].fY; |
| 850 | float xMax = iw - 1; |
| 851 | float yMax = ih - 1; |
| 852 | int y = (int)roundf(__clamp(curPoints.fY, 0, yMax)); |
| 853 | int x = (int)roundf(__clamp(curPoints.fX, 0, xMax)); |
| 854 | auto sourcePos = y * yStride + bpp * x; |
| 855 | ::memcpy(dest, source + sourcePos, bpp * count); |
| 856 | } |
| 857 | |
| 858 | void MNNSamplerI420Copy(const unsigned char* source, unsigned char* dest, MNN::CV::Point* points, size_t sta, |
| 859 | size_t count, size_t capacity, size_t iw, size_t ih, size_t yStride) { |
no test coverage detected