| 121 | } |
| 122 | |
| 123 | ImageBatchVarShape VarShapeRemap(ImageBatchVarShape &src, Tensor &map, NVCVInterpolationType srcInterp, |
| 124 | NVCVInterpolationType mapInterp, NVCVRemapMapValueType mapValueType, bool alignCorners, |
| 125 | NVCVBorderType borderMode, const pyarray &borderValue, std::optional<Stream> pstream) |
| 126 | { |
| 127 | ImageBatchVarShape dst = ImageBatchVarShape::Create(src.capacity()); |
| 128 | |
| 129 | nvcv::Size2D mapSize; |
| 130 | |
| 131 | if (mapValueType == NVCV_REMAP_ABSOLUTE || mapValueType == NVCV_REMAP_ABSOLUTE_NORMALIZED) |
| 132 | { |
| 133 | auto mapAccess = nvcv::TensorDataAccessStridedImagePlanar::Create(map.exportData()); |
| 134 | if (!mapAccess) |
| 135 | { |
| 136 | throw std::runtime_error("Incompatible map tensor layout"); |
| 137 | } |
| 138 | |
| 139 | mapSize.w = mapAccess->numCols(); |
| 140 | mapSize.h = mapAccess->numRows(); |
| 141 | } |
| 142 | |
| 143 | for (int i = 0; i < src.numImages(); ++i) |
| 144 | { |
| 145 | if (mapValueType == NVCV_REMAP_ABSOLUTE || mapValueType == NVCV_REMAP_ABSOLUTE_NORMALIZED) |
| 146 | { |
| 147 | dst.pushBack(Image::Create(mapSize, src[i].format())); |
| 148 | } |
| 149 | else |
| 150 | { |
| 151 | dst.pushBack(Image::Create(src[i].size(), src[i].format())); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | return VarShapeRemapInto(dst, src, map, srcInterp, mapInterp, mapValueType, alignCorners, borderMode, borderValue, |
| 156 | pstream); |
| 157 | } |
| 158 | |
| 159 | } // namespace |
| 160 |
nothing calls this directly
no test coverage detected