MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / ImageFormatToString

Function ImageFormatToString

python/mod_cvcuda/nvcv/ImageFormat.cpp:43–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41namespace nvcvpy::priv {
42
43static std::string ImageFormatToString(nvcv::ImageFormat fmt)
44{
45 const char *str = nvcvImageFormatGetName(fmt);
46
47 std::string_view prefix = "NVCV_IMAGE_FORMAT_";
48
49 std::ostringstream out;
50
51 out << "nvcv.";
52
53 if (prefix == str)
54 {
55 out << "Format." << str + prefix.length();
56 }
57 else
58 {
59 prefix = "ImageFormat";
60 if (prefix == str)
61 {
62 out << "Format" << str + prefix.length();
63 }
64 else
65 {
66 out << "<Unknown image format: " << str << '>';
67 }
68 }
69
70 return out.str();
71}
72
73void ExportImageFormat(py::module &m)
74{

Callers

nothing calls this directly

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected