void TranslationUnit::createTranslationUnitIfNeeded() const
{
    if (!d->translationUnit) {
        d->translationUnit = CXTranslationUnit();

        const auto args = commandLineArguments();
        if (isVerboseModeEnabled())
            args.print();

        CXErrorCode errorCode = clang_parseTranslationUnit2(index(),
                                                            NULL,
                                                            args.data(),
                                                            args.count(),
                                                            unsavedFiles().cxUnsavedFiles(),
                                                            unsavedFiles().count(),
                                                            defaultOptions(),
                                                            &d->translationUnit);

        checkTranslationUnitErrorCode(errorCode);

        updateIncludeFilePaths();

        updateLastProjectPartChangeTimePoint();
    }
}
void KazeDescriptorExtractor::computeImpl( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const
{
	if (usePreloadedEnvironment)
	{
		environment->Feature_Description(keypoints, descriptors);
	}
	else
	{
		toptions options;
		defaultOptions(options);
		options.img_width = image.cols;
		options.img_height = image.rows;

		KAZE evolution(options);

		cv::Mat img_32;
		cv::Mat bw;
		if (image.channels() == 1)
		{
			image.convertTo(img_32,CV_32F,1.0/255.0,0);
		}
		else
		{
			cv::cvtColor(image, bw, CV_RGB2GRAY);
			bw.convertTo(img_32,CV_32F,1.0/255.0,0);
		}

		evolution.Create_Nonlinear_Scale_Space(img_32);

		evolution.Feature_Description(keypoints, descriptors);
	}
}
Esempio n. 3
0
ClangCodeCompleteResults CodeCompleter::complete(uint line,
                                                 uint column,
                                                 CXUnsavedFile *unsavedFiles,
                                                 unsigned unsavedFileCount)
{
    return clang_codeCompleteAt(translationUnit.cxTranslationUnitWithoutReparsing(),
                                translationUnit.filePath().constData(),
                                line,
                                column,
                                unsavedFiles,
                                unsavedFileCount,
                                defaultOptions());
}
Esempio n. 4
0
ClangCodeCompleteResults CodeCompleter::completeHelper(uint line, uint column)
{
    const Utf8String nativeFilePath = FilePath::toNativeSeparators(translationUnit.filePath());
    UnsavedFilesShallowArguments unsaved = unsavedFiles.shallowArguments();

    return clang_codeCompleteAt(translationUnit.cxTranslationUnit(),
                                nativeFilePath.constData(),
                                line,
                                column,
                                unsaved.data(),
                                unsaved.count(),
                                defaultOptions());
}
void transformDicom(char *filename, char *outdir)
{
	TDCMopts opts;
	char auxFile[1024];

	defaultOptions(opts, outdir);

	changeFileExt(filename, "", auxFile);
	extractFileName(auxFile, opts.filename);
//	opts.isVerbose = 2;
	if (0)
	{
		strcpy(opts.indir, filename);
		nii_loadDir(&opts);
	}
	else singleDICOM(&opts, filename);
}
void TranslationUnit::createTranslationUnitIfNeeded() const
{
    if (!d->translationUnit) {
        d->translationUnit = CXTranslationUnit();
        CXErrorCode errorCode = clang_parseTranslationUnit2(index(),
                                                            d->filePath.constData(),
                                                            d->projectPart.cxArguments(),
                                                            d->projectPart.argumentCount(),
                                                            unsavedFiles().cxUnsavedFiles(),
                                                            unsavedFiles().count(),
                                                            defaultOptions(),
                                                            &d->translationUnit);

        checkTranslationUnitErrorCode(errorCode);

        updateIncludeFilePaths();


        updateLastProjectPartChangeTimePoint();
    }
}