| 55 | } |
| 56 | |
| 57 | Tensor CvtColor(Tensor &input, NVCVColorConversionCode code, std::optional<Stream> pstream) |
| 58 | { |
| 59 | nvcv::ImageFormat outputFormat = GetOutputFormat(input.dtype(), code); |
| 60 | nvcv::TensorShape outputShape = GetOutputTensorShape(input.shape(), outputFormat, code); |
| 61 | nvcv::DataType outputDType = outputFormat.planeDataType(0).channelType(0); |
| 62 | |
| 63 | #ifndef NDEBUG |
| 64 | assert(outputFormat.numPlanes() == 1); |
| 65 | nvcv::DataType channelDType = outputFormat.planeDataType(0).channelType(0); |
| 66 | for (int c = 1; c < outputFormat.planeDataType(0).numChannels(); ++c) |
| 67 | { |
| 68 | assert(channelDType == outputFormat.planeDataType(0).channelType(c)); |
| 69 | } |
| 70 | #endif |
| 71 | |
| 72 | Tensor output = Tensor::Create(outputShape, outputDType); |
| 73 | |
| 74 | return CvtColorInto(output, input, code, pstream); |
| 75 | } |
| 76 | |
| 77 | ImageBatchVarShape CvtColorVarShapeInto(ImageBatchVarShape &output, ImageBatchVarShape &input, |
| 78 | NVCVColorConversionCode code, std::optional<Stream> pstream) |
nothing calls this directly
no test coverage detected