133 unsigned short winw, winh;
137 static bool testmode =
false;
138 static bool halt =
true;
139 static bool valt =
false;
140 static bool noalias =
true;
141 static bool showscaled =
true;
142 static bool usedma =
false;
143 static int scaledx = 0;
144 static int scaledy = 0;
149 unsigned char * pix = (
unsigned char *)img.
pixels<
unsigned char>();
151 bool oddv =
false, oddh =
false;
155 case V4L2_PIX_FMT_RGB24:
157 for (
int j = 0; j <
h; ++j)
159 bool hh = valt ? oddv : halt;
160 oddh = hh ? false : oddv;
161 for (
int i = 0; i < w; ++i)
163 if (oddh) { *pix++ = 0; *pix++ = 0; *pix++ = 0; }
164 else { *pix++ = 255; *pix++ = 255; *pix++ = 255; }
165 if (hh) oddh = !oddh;
171 case V4L2_PIX_FMT_YUYV:
173 for (
int j = 0; j <
h; ++j)
175 bool hh = valt ? oddv : halt;
176 oddh = hh ? false : oddv;
177 for (
int i = 0; i < w; ++i)
179 if (oddh) { *pix++ = 0; *pix++ = 0x80; }
180 else { *pix++ = 0xff; *pix++ = 0x80; }
181 if (hh) oddh = !oddh;
187 case V4L2_PIX_FMT_RGB32:
189 for (
int j = 0; j <
h; ++j)
191 bool hh = valt ? oddv : halt;
192 oddh = hh ? false : oddv;
193 for (
int i = 0; i < w; ++i)
195 if (oddh) { *pix++ = 0; *pix++ = 0; *pix++ = 0; *pix++ = 255; }
196 else { *pix++ = 255; *pix++ = 255; *pix++ = 255; *pix++ = 255; }
197 if (hh) oddh = !oddh;
211 int x = 0, y = 0;
unsigned short w = 0,
h = 0;
216 helper.
drawImage(
"c", img, x, y, w,
h, noalias);
221 if (inframe.hasScaledImage() && showscaled)
224 unsigned short w2 = img2.width, h2 = img2.height;
225 if (usedma) helper.
drawInputFrame2(
"ds", inframe, scaledx , scaledy, w2, h2, noalias);
226 else helper.
drawImage(
"s", img2, scaledx, scaledy, w2, h2, noalias);
234 auto dlb = ImGui::GetBackgroundDrawList();
235 ImVec2
const p = ImGui::GetMousePos();
236 dlb->AddRect(ImVec2(p.x-30, p.y-30), ImVec2(p.x+30, p.y+30), ImColor(255, 0, 0, 255) );
239 ImGuiIO & io = ImGui::GetIO();
240 if (ImGui::Begin(
"JeVois-Pro PassThrough Module"))
242 ImGui::Text(
"Framerate: %3.2f fps", io.Framerate);
243 ImGui::Text(
"Video: raw %dx%d aspect=%f, render %dx%d @ %d,%d", imgdebug.
width, imgdebug.
height,
244 float(imgdebug.
width) /
float(imgdebug.
height), w,
h, x, y);
245 if (inframe.hasScaledImage())
247 ImGui::Checkbox(
"Show ISP scaled image", &showscaled);
248 ImGui::SliderInt(
"Scaled image x", &scaledx, 0, winw);
249 ImGui::SliderInt(
"Scaled image y", &scaledy, 0, winh);
252 ImGui::Checkbox(
"Use DMABUF", &usedma);
253 ImGui::Checkbox(
"Test mode", &testmode);
256 ImGui::Checkbox(
"Pattern 1", &halt);
257 ImGui::Checkbox(
"Pattern 2", &valt);
258 ImGui::Checkbox(
"No aliasing", &noalias);
264 auto dlf = ImGui::GetForegroundDrawList();
265 dlf->AddCircle(ImVec2(p.x, p.y), 20, ImColor(0, 255, 0, 128) );