39 #include <Argus/Ext/DeFog.h>
41 namespace ArgusSamples
47 #define DEFAULT_CONFIG_FILE "argusAppConfig.xml"
53 printf(
"%s\n", info.c_str());
82 PROPAGATE_ERROR(Window::getInstance().requestExit());
208 : m_initialized(false)
211 , m_guiContainerConfig(NULL)
227 "The supported value range of some settings is device or sensor mode dependent.\n"
228 "Use the '--info' option to get a list of the supported values.\n"));
233 "print information on devices.",
info)));
248 "enable verbose mode.",
verbose)));
251 "enable kpi mode.",
kpi)));
254 "select camera device with INDEX.",
device)));
260 "sets the exposure time range to RANGE, in nanoseconds.",
264 "sets the gain range to RANGE.",
gainRange)));
270 "set the sensor frame rate to RATE. If RATE is 0 then VFR (variable frame rate) is "
274 "sets the focus position to POSITION, in focuser units.",
280 "set the still and video output size to WIDTHxHEIGHT (e.g. 1920x1080). If WIDTHxHEIGHT "
281 "is '0x0' the output size is the sensor mode size.",
outputSize)));
284 "set the output file path. A file name, an incrementing index and the file extension will "
285 "be appended. E.g. setting 'folder/' will result in 'folder/image0.jpg' or "
286 "'folder/video0.mp4'. '/dev/null' can be used to discard output.",
292 "set the video stabilization mode.",
vstab)));
295 "set the denoising mode.",
deNoise)));
303 "set the auto exposure lock.",
aeLock)));
306 "set the auto white balance lock.",
awbLock)));
309 "set the auto white balance mode.",
awb)));
313 "set the exposure compensation to COMPENSATION.",
321 "set the DeFog enable flag to ENABLE.",
deFogEnable)));
324 "sets the amount of fog to be removed to AMOUNT.",
deFogAmount)));
327 "sets the quality of the DeFog effect to QUALITY.",
341 PROPAGATE_ERROR_CONTINUE(
stop());
352 Window::IGuiContainer *iGuiContainerConfig)
361 UniquePointer<Window::IGuiMenu> menu;
362 UniquePointer<Window::IGuiMenuItem> item;
365 Window::IGuiMenu *fileMenu = iGuiMenuBar->getMenu(
"File");
368 PROPAGATE_ERROR(Window::IGuiMenu::create(
"File", &menu));
369 PROPAGATE_ERROR(iGuiMenuBar->add(menu.get()));
370 fileMenu = menu.get();
375 PROPAGATE_ERROR(fileMenu->add(item.get()));
379 PROPAGATE_ERROR(fileMenu->add(item.get()));
383 PROPAGATE_ERROR(fileMenu->add(item.get()));
386 Window::IGuiMenu *helpMenu = iGuiMenuBar->getMenu(
"Help");
389 PROPAGATE_ERROR(Window::IGuiMenu::create(
"Help", &menu));
390 PROPAGATE_ERROR(iGuiMenuBar->add(menu.get()));
391 helpMenu = menu.get();
396 PROPAGATE_ERROR(helpMenu->add(item.get()));
407 PROPAGATE_ERROR(Window::IGuiContainerGrid::create(&
m_guiConfig));
410 UniquePointer<Window::IGuiElement> element;
413 Window::IGuiContainerGrid::BuildHelper buildHelper(
m_guiConfig);
415 #define CREATE_GUI_ELEMENT(_NAME, _VALUE) \
416 PROPAGATE_ERROR(Window::IGuiElement::createValue(&dispatcher._VALUE, &element));\
417 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
420 #define CREATE_GUI_ELEMENT_COMBO_BOX(_NAME, _VALUE, _FROMTYPE, _TOTYPE) \
421 assert(sizeof(_FROMTYPE) == sizeof(_TOTYPE)); \
422 PROPAGATE_ERROR(Window::IGuiElement::createValue(reinterpret_cast< \
423 Value<_TOTYPE>*>(&dispatcher._VALUE), &element)); \
424 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
427 #define CREATE_GUI_ELEMENT_PATH_CHOOSER(_NAME, _VALUE) \
428 PROPAGATE_ERROR(Window::IGuiElement::createFileChooser(&dispatcher._VALUE, \
430 PROPAGATE_ERROR(buildHelper.append(_NAME, element.get())); \
441 uint32_t, Window::IGuiElement::ValueTypeEnum);
449 Argus::VideoStabilizationMode, Argus::NamedUUID);
451 Argus::DenoiseMode, Argus::NamedUUID);
454 Argus::AeAntibandingMode, Window::IGuiElement::ValueTypeEnum);
459 Argus::AwbMode, Argus::NamedUUID);
462 #undef CREATE_GUI_ELEMENT
463 #undef CREATE_GUI_ELEMENT_COMBO_BOX
464 #undef CREATE_GUI_ELEMENT_PATH_CHOOSER