void vtn_filtro::on_cb_lista_filtros_currentIndexChanged( int index ) { indice_lista = index; if ( !indice_lista ) { hide_gaussiano(); hide_laplaciano(); hide_media(); hide_sobel_prewitt(); return; } switch ( indice_lista ) { case Filtro::Operador::Gaussiano: show_gaussiano(); break; case Filtro::Operador::Laplaciano: metodo_laplaciano = 0; show_laplaciano(); ui->chb_centro_positivo->hide(); ui->cb_laplaciano->hide(); break; case Filtro::Operador::Sobel: indice_operador = 0; // El siguiente comentario es un mandato show_sobel_prewitt(); break; case Filtro::Operador::Prewitt: indice_operador = 1; // Acomodar Enum && Namespaces show_sobel_prewitt(); break; case Filtro::Operador::Media_Diez: show_media(); } }
int /* O - Exit status */ main(int argc, /* I - Number of command-line arguments */ char *argv[]) /* I - Command-line arguments */ { http_t *http; /* Connection to destination */ cups_dest_t *dest = NULL; /* Destination */ cups_dinfo_t *dinfo; /* Destination info */ if (argc < 2) usage(NULL); if (!strcmp(argv[1], "--enum")) { int i; /* Looping var */ cups_ptype_t type = 0, /* Printer type filter */ mask = 0; /* Printer type mask */ for (i = 2; i < argc; i ++) { if (!strcmp(argv[i], "grayscale")) { type |= CUPS_PRINTER_BW; mask |= CUPS_PRINTER_BW; } else if (!strcmp(argv[i], "color")) { type |= CUPS_PRINTER_COLOR; mask |= CUPS_PRINTER_COLOR; } else if (!strcmp(argv[i], "duplex")) { type |= CUPS_PRINTER_DUPLEX; mask |= CUPS_PRINTER_DUPLEX; } else if (!strcmp(argv[i], "staple")) { type |= CUPS_PRINTER_STAPLE; mask |= CUPS_PRINTER_STAPLE; } else if (!strcmp(argv[i], "small")) { type |= CUPS_PRINTER_SMALL; mask |= CUPS_PRINTER_SMALL; } else if (!strcmp(argv[i], "medium")) { type |= CUPS_PRINTER_MEDIUM; mask |= CUPS_PRINTER_MEDIUM; } else if (!strcmp(argv[i], "large")) { type |= CUPS_PRINTER_LARGE; mask |= CUPS_PRINTER_LARGE; } else usage(argv[i]); } cupsEnumDests(CUPS_DEST_FLAGS_NONE, 5000, NULL, type, mask, enum_cb, NULL); return (0); } else if (!strncmp(argv[1], "ipp://", 6) || !strncmp(argv[1], "ipps://", 7)) dest = cupsGetDestWithURI(NULL, argv[1]); else dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, argv[1], NULL); if (!dest) { printf("testdest: Unable to get destination \"%s\": %s\n", argv[1], cupsLastErrorString()); return (1); } if ((http = cupsConnectDest(dest, CUPS_DEST_FLAGS_NONE, 30000, NULL, NULL, 0, NULL, NULL)) == NULL) { printf("testdest: Unable to connect to destination \"%s\": %s\n", argv[1], cupsLastErrorString()); return (1); } if ((dinfo = cupsCopyDestInfo(http, dest)) == NULL) { printf("testdest: Unable to get information for destination \"%s\": %s\n", argv[1], cupsLastErrorString()); return (1); } if (argc == 2 || (!strcmp(argv[2], "supported") && argc < 6)) { if (argc > 3) show_supported(http, dest, dinfo, argv[3], argv[4]); else if (argc > 2) show_supported(http, dest, dinfo, argv[3], NULL); else show_supported(http, dest, dinfo, NULL, NULL); } else if (!strcmp(argv[2], "conflicts") && argc > 3) { int i, /* Looping var */ num_options = 0;/* Number of options */ cups_option_t *options = NULL;/* Options */ for (i = 3; i < argc; i ++) num_options = cupsParseOptions(argv[i], num_options, &options); show_conflicts(http, dest, dinfo, num_options, options); } else if (!strcmp(argv[2], "default") && argc == 4) { show_default(http, dest, dinfo, argv[3]); } else if (!strcmp(argv[2], "localize") && argc < 6) { if (argc > 3) localize(http, dest, dinfo, argv[3], argv[4]); else if (argc > 2) localize(http, dest, dinfo, argv[3], NULL); else localize(http, dest, dinfo, NULL, NULL); } else if (!strcmp(argv[2], "media")) { int i; /* Looping var */ const char *name = NULL; /* Media name, if any */ unsigned flags = CUPS_MEDIA_FLAGS_DEFAULT; /* Media selection flags */ for (i = 3; i < argc; i ++) { if (!strcmp(argv[i], "borderless")) flags = CUPS_MEDIA_FLAGS_BORDERLESS; else if (!strcmp(argv[i], "duplex")) flags = CUPS_MEDIA_FLAGS_DUPLEX; else if (!strcmp(argv[i], "exact")) flags = CUPS_MEDIA_FLAGS_EXACT; else if (!strcmp(argv[i], "ready")) flags = CUPS_MEDIA_FLAGS_READY; else if (name) usage(argv[i]); else name = argv[i]; } show_media(http, dest, dinfo, flags, name); } else if (!strcmp(argv[2], "print") && argc > 3) { int i, /* Looping var */ num_options = 0;/* Number of options */ cups_option_t *options = NULL;/* Options */ for (i = 4; i < argc; i ++) num_options = cupsParseOptions(argv[i], num_options, &options); print_file(http, dest, dinfo, argv[3], num_options, options); } else usage(argv[2]); return (0); }
/*---------------------------------------------------------------------- | main +---------------------------------------------------------------------*/ int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); // Utility. QStringList args = app.arguments(); POC_Mode currentMode; if (args.contains("--animations")) currentMode = MODE_ANIMATIONS; else if (args.contains("--loop")) currentMode = MODE_LOOP; else if (args.contains("--seektest")) currentMode = MODE_SEEK; else currentMode = MODE_PLAYER; POC_QMLUtils qmlUtils; QQuickView view; // Set EGL to 24bit color depth. QSurfaceFormat curSurface = view.format(); curSurface.setRedBufferSize(8); curSurface.setGreenBufferSize(8); curSurface.setBlueBufferSize(8); curSurface.setAlphaBufferSize(0); view.setFormat(curSurface); view.engine()->rootContext()->setContextProperty("utils", &qmlUtils); switch (currentMode) { case MODE_ANIMATIONS: view.setSource(QUrl("qrc:///qml/main_animations.qml")); break; case MODE_LOOP: view.setSource(QUrl("qrc:///qml/main_loop.qml")); break; case MODE_SEEK: view.setSource(QUrl(QStringLiteral("qrc:///qml/main_seektest.qml"))); break; default: view.setSource(QUrl("qrc:///qml/main.qml")); break; } qInstallMessageHandler(&log_handler); LC_QMLLogger::registerObject(view.rootContext()); view.setResizeMode(QQuickView::SizeRootObjectToView); #ifdef RASPBERRY view.showFullScreen(); #else view.resize(800, 400); view.show(); #endif // RASPBERRY qApp->connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit())); // If file path is provided from the command line, I start the player // immediately. switch (currentMode) { case MODE_LOOP: { QStringList list; for (int i = 2; i < args.size(); i++) list << args.at(i); if (list.size() < 1) return log_warn("No items to play."); if (!show_media(&view, list)) return 1; break; } case MODE_PLAYER: if (args.size() > 1) if (!show_media(&view, args.at(1))) return 1; break; default: if (args.size() > 2) if (!show_media(&view, args.at(2))) return 1; break; } return app.exec(); }