void IPLUndistort::init() { // init _result = NULL; // basic settings setClassName("IPLUndistort"); setTitle("Undistort Image"); setDescription("The function transforms an image to compensate radial and tangential lens distortion."); setCategory(IPLProcess::CATEGORY_GEOMETRY); setOpenCVSupport(IPLProcess::OPENCV_ONLY); setKeywords("distortion, undistortion, barrel, lens correction"); // inputs and outputs addInput("Image", IPL_IMAGE_COLOR); addOutput("Image", IPL_IMAGE_COLOR); // properties addProcessPropertyInt("f", "f", "Focal Length", 1000, IPL_WIDGET_SLIDER, 0, 10000.0); addProcessPropertyDouble("p1", "p1", "", 0.0, IPL_WIDGET_SLIDER, -10.0, 10.0); addProcessPropertyDouble("p2", "p2", "Tangential Distortion", 0.0, IPL_WIDGET_SLIDER, -10.0, 10.0); addProcessPropertyDouble("k1", "k1", "", 0.0, IPL_WIDGET_SLIDER, -100.0, 100.0); addProcessPropertyDouble("k2", "k2", "", 0.0, IPL_WIDGET_SLIDER, -100.0, 100.0); addProcessPropertyDouble("k3", "k3", "Radial Distortion", 0.0, IPL_WIDGET_SLIDER, -100.0, 100.0); }
void TDECModuleInfo::init(KService::Ptr s) { _allLoaded = false; d = new TDECModuleInfoPrivate; if ( s ) _service = s; else { kdDebug(712) << "Could not find the service." << endl; return; } // set the modules simple attributes setName(_service->name()); setComment(_service->comment()); setIcon(_service->icon()); _fileName = ( _service->desktopEntryPath() ); // library and factory setLibrary(_service->library()); // get the keyword list setKeywords(_service->keywords()); }
NitLexer::NitLexer() { static Keywords keywords; if (keywords.empty()) { keywords["base"] = TK_BASE; keywords["switch"] = TK_SWITCH; keywords["if"] = TK_IF; keywords["else"] = TK_ELSE; keywords["while"] = TK_WHILE; keywords["break"] = TK_BREAK; keywords["for"] = TK_FOR; keywords["do"] = TK_DO; keywords["null"] = TK_NULL; keywords["foreach"] = TK_FOREACH; keywords["in"] = TK_IN; keywords["clone"] = TK_CLONE; keywords["function"] = TK_FUNCTION; keywords["return"] = TK_RETURN; keywords["typeof"] = TK_TYPEOF; keywords["continue"] = TK_CONTINUE; keywords["yield"] = TK_YIELD; keywords["try"] = TK_TRY; keywords["catch"] = TK_CATCH; keywords["throw"] = TK_THROW; keywords["resume"] = TK_RESUME; keywords["case"] = TK_CASE; keywords["default"] = TK_DEFAULT; keywords["this"] = TK_THIS; keywords["class"] = TK_CLASS; keywords["constructor"] = TK_CONSTRUCTOR; keywords["is"] = TK_IS; keywords["true"] = TK_TRUE; keywords["false"] = TK_FALSE; keywords["static"] = TK_STATIC; keywords["enum"] = TK_ENUM; keywords["const"] = TK_CONST; keywords["property"] = TK_PROPERTY; keywords["require"] = TK_REQUIRE; keywords["div"] = TK_INTDIV; keywords["mod"] = TK_INTMOD; keywords["destructor"] = TK_DESTRUCTOR; keywords["var"] = TK_VAR; keywords["with"] = TK_WITH; keywords["finally"] = TK_FINALLY; keywords["import"] = TK_IMPORT; keywords["by"] = TK_BY; } setKeywords(&keywords); }
Commands::CommandResult *Commands::CombinedEditCommand::execute(const Commands::CommandManager *commandManager) const { qInfo() << "Combined edit command: flags=" << m_EditFlags << "artworks count =" << m_ArtItemInfos.length(); QVector<int> indicesToUpdate; QVector<UndoRedo::ArtworkMetadataBackup*> artworksBackups; QVector<SpellCheck::ISpellCheckable*> itemsToCheck; int size = m_ArtItemInfos.length(); indicesToUpdate.reserve(size); artworksBackups.reserve(size); itemsToCheck.reserve(size); bool needToClear = Common::HasFlag(m_EditFlags, Common::Clear); for (int i = 0; i < size; ++i) { Models::ArtItemInfo* info = m_ArtItemInfos[i]; Models::ArtworkMetadata *metadata = info->getOrigin(); UndoRedo::ArtworkMetadataBackup *backup = new UndoRedo::ArtworkMetadataBackup(metadata); artworksBackups.append(backup); indicesToUpdate.append(info->getOriginalIndex()); setKeywords(metadata); setDescription(metadata); setTitle(metadata); // do not save if Сlear flag present // to be able to restore from .xpks if (!needToClear) { commandManager->saveMetadata(metadata); } itemsToCheck.append(metadata); } commandManager->submitForSpellCheck(itemsToCheck); UndoRedo::ModifyArtworksHistoryItem *modifyArtworksItem = new UndoRedo::ModifyArtworksHistoryItem(artworksBackups, indicesToUpdate, UndoRedo::CombinedEditModificationType); commandManager->recordHistoryItem(modifyArtworksItem); CombinedEditCommandResult *result = new CombinedEditCommandResult(indicesToUpdate); return result; }
void IPLIFFT::init() { // init _result = NULL; // basic settings setClassName("IPLIFFT"); setTitle("Inverse FFT"); setCategory(IPLProcess::CATEGORY_FOURIER); setDescription("Inverse Fast Fourier Transform."); setKeywords("IFFT"); // inputs and outputs addInput("Complex Image", IPL_IMAGE_COMPLEX); addOutput("Grayscale Image", IPL_IMAGE_GRAYSCALE); // properties //addProcessPropertyInt("mode", "Windowing Function:None|Hanning|Hamming|Blackman|Border", "", IPL_INT_RADIOBUTTONS, 0); }
void IPLCompassMask::init() { // init _result = NULL; // basic settings setClassName("IPLCompassMask"); setTitle("Compass Mask"); setKeywords("direction"); setCategory(IPLProcess::CATEGORY_LOCALOPERATIONS); setDescription("Local compass mask low-pass operator. Prewitt, Kirsch, Sobel, and ThreeLevel masks in all directions."); // inputs and outputs addInput("Image", IPLData::IMAGE_COLOR); addOutput("Image", IPLImage::IMAGE_COLOR); // properties addProcessPropertyInt("maskType", "Mask Type:Prewitt|Kirsch|ThreeLevel|Sobel", "", 0, IPL_WIDGET_COMBOBOX); addProcessPropertyInt("direction", "Direction:N|NW|W|SW|S|SE|E|NE", "", 0, IPL_WIDGET_COMBOBOX); }
void IPLGradientOperator::init() { // init _result = NULL; // basic settings setClassName("IPLGradientOperator"); setTitle("Gradient Operator"); setCategory(IPLProcess::CATEGORY_GRADIENTS); setKeywords("Fast Gradient, Roberts, Sobel, Cubic Spline"); // inputs and outputs addInput("Image", IPLData::IMAGE_GRAYSCALE); addOutput("Image", IPLData::IMAGE_ORIENTED); // set the openCV support setOpenCVSupport( IPLOpenCVSupport::OPENCV_ONLY ); // properties addProcessPropertyInt("algorithm", "Algorithm:Fast Gradient|Roberts|Sobel|Cubic Spline", "", 0, IPL_WIDGET_RADIOBUTTONS); }
void IPLCanvasSize::init() { // init _result = NULL; // basic settings setClassName("IPLCanvasSize"); setTitle("Resize Canvas"); setKeywords("crop"); setCategory(IPLProcess::CATEGORY_GEOMETRY); // inputs and outputs addInput("Image", IPL_IMAGE_COLOR); addOutput("Image", IPL_IMAGE_COLOR); // properties addProcessPropertyInt("width", "Width", "", 512, IPL_WIDGET_SLIDER, 1, 4096); addProcessPropertyInt("height", "Height", "", 512, IPL_WIDGET_SLIDER, 1, 4096); addProcessPropertyInt("anchor", "Anchor:Top Left|Top|Top Right|Left|Center|Right|Bottom Left|Bottom|Bottom Right", "", 4, IPL_WIDGET_COMBOBOX); addProcessPropertyColor("color", "Background", "If extending the canvas, the background is filled with this color", IPLColor(0,0,0), IPL_WIDGET_COLOR_RGB); }
void IPLConvolutionFilter::init() { // init _result = NULL; _offset = 0; _divisor = 0; _borders = 0; _kernel.clear(); // basic settings setClassName("IPLConvolutionFilter"); setTitle("2D Convolution"); setKeywords("filter"); setCategory(IPLProcess::CATEGORY_LOCALOPERATIONS); setDescription("Convolution of a kernel with image."); setOpenCVSupport(IPLOpenCVSupport::OPENCV_OPTIONAL); // default values // 0 0 0 // 0 1 0 // 0 0 0 int nrElements = 9; for(int i=0; i<nrElements; i++) { // set the center to 1, all others to 0 _kernel.push_back(i == nrElements/2 ? 1 : 0); } // inputs and outputs addInput("Image", IPLData::IMAGE_COLOR); addOutput("Image", IPLData::IMAGE_COLOR); // properties addProcessPropertyVectorInt("kernel", "Kernel", "", _kernel, IPL_WIDGET_KERNEL); addProcessPropertyBool("normalize", "Normalize", "Divisor is computed automatically", true, IPL_WIDGET_CHECKBOXES); addProcessPropertyInt("divisor", "Divisor", "", 1, IPL_WIDGET_SLIDER, 1, 512); addProcessPropertyDouble("offset", "Offset", "", 0.0, IPL_WIDGET_SLIDER, -1.0, 1.0); addProcessPropertyInt("borders", "Borders:Crop|Extend|Wrap", "Wrap is not available under OpenCV.", 0, IPL_WIDGET_RADIOBUTTONS, 0, 0); }
void BasicKeywordsModel::initialize(const QString &title, const QString &description, const QString &rawKeywords) { setTitle(title); setDescription(description); setKeywords(rawKeywords.split(',', QString::SkipEmptyParts)); }