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

Function printPlane

tests/common/TensorDataUtils.cpp:24–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace nvcv::util {
23
24static void printPlane(const uint8_t *data, int width, int height, int rowStride, int bytesPC, int numC)
25{
26 std::cout << "[";
27 printf("%02x", data[0]);
28 bool endB = false;
29 int size = height * rowStride;
30 int x = 1;
31 for (int i = 1; i < size; i++)
32 {
33 if (x % (width * bytesPC * numC) == 0 && !endB)
34 {
35 std::cout << "]";
36 endB = true;
37 }
38 else if (x % bytesPC == 0)
39 {
40 if (x % (bytesPC * numC) == 0 && !endB)
41 {
42 std::cout << " |";
43 }
44 else
45 {
46 std::cout << ",";
47 }
48 }
49
50 if (i % rowStride == 0)
51 {
52 std::cout << "\n[";
53 endB = false;
54 x = 1;
55 }
56 else
57 {
58 x++;
59 std::cout << " ";
60 }
61 printf("%02x", data[i]);
62 }
63
64 if (!endB)
65 std::cout << "]";
66 else
67 std::cout << ",";
68
69 std::cout << "\n";
70}
71
72void PrintImageFromByteVector(const uint8_t *data, int width, int height, int rowStride, int bytesPC, int numC,
73 bool planar)

Callers 2

PrintImageFromByteVectorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected