/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void CheckerboardPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, OFX::EContext context ) { OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); srcClip->addSupportedComponent( OFX::ePixelComponentRGB ); srcClip->addSupportedComponent( OFX::ePixelComponentAlpha ); srcClip->setSupportsTiles( kSupportTiles ); // Create the mandated output clip OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); dstClip->setSupportsTiles( kSupportTiles ); OFX::Int2DParamDescriptor* boxes = desc.defineInt2DParam( kCheckerboardBoxes ); boxes->setDefault( 10, 10 ); boxes->setLabel( "boxes number" ); boxes->setHint( "Number of boxes of the checkerboard." ); OFX::RGBAParamDescriptor* color1 = desc.defineRGBAParam( kCheckerboardColor1 ); color1->setDefault( 0, 0, 0, 1 ); color1->setLabel( "color1" ); OFX::RGBAParamDescriptor* color2 = desc.defineRGBAParam( kCheckerboardColor2 ); color2->setDefault( 1, 1, 1, 1 ); color2->setLabel( "color2" ); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void ConvolutionPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, OFX::EContext context ) { OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); srcClip->addSupportedComponent( OFX::ePixelComponentRGB ); srcClip->addSupportedComponent( OFX::ePixelComponentAlpha ); srcClip->setSupportsTiles( kSupportTiles ); // Create the mandated output clip OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); dstClip->setSupportsTiles( kSupportTiles ); OFX::Int2DParamDescriptor* size = desc.defineInt2DParam( kParamSize ); size->setLabel( "Size" ); size->setDefault( 3, 3 ); // size->setIncrement( 2, 2 ); size->setRange( 3, 3, kParamSizeMax, kParamSizeMax ); OFX::ChoiceParamDescriptor* border = desc.defineChoiceParam( kParamBorder ); border->setLabel( "Border" ); border->appendOption( kParamBorderMirror ); border->appendOption( kParamBorderConstant ); border->appendOption( kParamBorderBlack ); border->appendOption( kParamBorderPadded ); for( unsigned int y = 0; y < kParamSizeMax; ++y ) { for( unsigned int x = 0; x < kParamSizeMax; ++x ) { const std::string name( getCoefName( y, x ) ); OFX::DoubleParamDescriptor* coef = desc.defineDoubleParam( name ); coef->setLabel( name ); coef->setDisplayRange( -10.0, 10.0 ); coef->setDefault( 0.0 ); } } }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void ResizePluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::EContext context) { OFX::ClipDescriptor* srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName); srcClip->addSupportedComponent(OFX::ePixelComponentRGBA); srcClip->addSupportedComponent(OFX::ePixelComponentRGB); srcClip->addSupportedComponent(OFX::ePixelComponentAlpha); srcClip->setSupportsTiles(kSupportTiles); // Create the mandated output clip OFX::ClipDescriptor* dstClip = desc.defineClip(kOfxImageEffectOutputClipName); dstClip->addSupportedComponent(OFX::ePixelComponentRGBA); dstClip->addSupportedComponent(OFX::ePixelComponentRGB); dstClip->addSupportedComponent(OFX::ePixelComponentAlpha); dstClip->setSupportsTiles(kSupportTiles); OFX::ChoiceParamDescriptor* method = desc.defineChoiceParam(kParamMode); method->setLabel("Mode"); method->appendOption(kParamModeFormat); method->appendOption(kParamModeSize); method->appendOption(kParamModeScale); method->setDefault(eParamModeFormat); OFX::ChoiceParamDescriptor* format = desc.defineChoiceParam(kParamFormat); format->setLabel("Format"); format->appendOption(kParamFormatPCVideo, kParamFormatPCVideoLabel); format->appendOption(kParamFormatNTSC, kParamFormatNTSCLabel); format->appendOption(kParamFormatPAL, kParamFormatPALLabel); format->appendOption(kParamFormatHD, kParamFormatHDLabel); format->appendOption(kParamFormatNTSC169, kParamFormatNTSC169Label); format->appendOption(kParamFormatPAL169, kParamFormatPAL169Label); format->appendOption(kParamFormat1kSuper35, kParamFormat1kSuper35Label); format->appendOption(kParamFormat1kCinemascope, kParamFormat1kCinemascopeLabel); format->appendOption(kParamFormat2kSuper35, kParamFormat2kSuper35Label); format->appendOption(kParamFormat2kCinemascope, kParamFormat2kCinemascopeLabel); format->appendOption(kParamFormat4kSuper35, kParamFormat4kSuper35Label); format->appendOption(kParamFormat4kCinemascope, kParamFormat4kCinemascopeLabel); format->appendOption(kParamFormatSquare256, kParamFormatSquare256Label); format->appendOption(kParamFormatSquare512, kParamFormatSquare512Label); format->appendOption(kParamFormatSquare1k, kParamFormatSquare1kLabel); format->appendOption(kParamFormatSquare2k, kParamFormatSquare2kLabel); format->setDefault(eParamFormat2kCinemascope); OFX::Double2DParamDescriptor* scale = desc.defineDouble2DParam(kParamScale); scale->setLabel("Scale"); scale->setDefault(1.0, 1.0); scale->setRange(0.01, 0.01, std::numeric_limits<double>::max(), std::numeric_limits<double>::max()); scale->setDisplayRange(0.1, 0.1, 2.5, 2.5); scale->setHint("Scale the input image [0, 0, width*scale, height*scale]."); OFX::BooleanParamDescriptor* keepRatio = desc.defineBooleanParam(kParamSizeKeepRatio); keepRatio->setLabel("Keep ratio"); keepRatio->setDefault(false); keepRatio->setHint("Keep input image ratio."); OFX::Int2DParamDescriptor* size = desc.defineInt2DParam(kParamSize); size->setLabel("Size"); size->setDefault(200, 200); size->setRange(1, 1, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); size->setHint("Set the output size (width, height)."); OFX::ChoiceParamDescriptor* direction = desc.defineChoiceParam(kParamSizeOrientation); direction->setLabel("Orientation"); direction->appendOption(kParamSizeOrientationX); direction->appendOption(kParamSizeOrientationY); direction->setDefault(eParamSizeOrientationX); OFX::IntParamDescriptor* width = desc.defineIntParam(kParamSizeWidth); width->setLabel("Width"); width->setDefault(200); width->setRange(1, std::numeric_limits<int>::max()); width->setDisplayRange(0, 3000); width->setHint("Set the width in pixels and keep the input image ratio."); OFX::IntParamDescriptor* height = desc.defineIntParam(kParamSizeHeight); height->setLabel("Height"); height->setDefault(200); height->setRange(1, std::numeric_limits<int>::max()); height->setDisplayRange(0, 3000); height->setHint("Set the height in pixels and keep the input image ratio."); #if(TUTTLE_EXPERIMENTAL) OFX::BooleanParamDescriptor* center = desc.defineBooleanParam(kParamCenter); center->setLabel("Center resizing"); center->setDefault(false); center->setHint("Resize around the center point."); OFX::Double2DParamDescriptor* centerPoint = desc.defineDouble2DParam(kParamCenterPoint); centerPoint->setDefault(100, 100); centerPoint->setLabel("Center point at"); centerPoint->setHint("Position of the center point."); #endif // sampler parameters // describeSamplerParamsInContext(desc, context); }
/** @brief The describe in context function, passed a plugin descriptor and a context */ void PropTesterPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, ContextEnum context) { // Source clip only in the filter context if(context == eContextGeneral) { // create the mandated source clip ClipDescriptor *srcClip = desc.defineClip("Extra"); srcClip->addSupportedComponent(ePixelComponentRGBA); srcClip->setTemporalClipAccess(false); srcClip->setOptional(false); srcClip->setSupportsTiles(true); srcClip->setIsMask(false); } // Source clip only in the filter context if(context == eContextFilter || context == eContextGeneral) { // create the mandated source clip ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName); srcClip->addSupportedComponent(ePixelComponentRGBA); srcClip->setTemporalClipAccess(false); //srcClip->setOptional(false); srcClip->setSupportsTiles(true); srcClip->setIsMask(false); } // create the mandated output clip ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName); dstClip->addSupportedComponent(ePixelComponentRGBA); dstClip->setTemporalClipAccess(false); //dstClip->setOptional(false); dstClip->setSupportsTiles(true); dstClip->setIsMask(false); // make some pages and to things in PageParamDescriptor *page1 = desc.definePageParam("page1"); PageParamDescriptor *page2 = desc.definePageParam("page2"); PageParamDescriptor *page3 = desc.definePageParam("page3"); // make an int param IntParamDescriptor *iParam = desc.defineIntParam("Int"); iParam->setLabels("Int", "Int", "Int"); iParam->setScriptName("int"); iParam->setHint("An integer parameter"); iParam->setDefault(0); iParam->setRange(-100, 100); iParam->setDisplayRange(-100, 100); page1->addChild(*iParam); // make a 2D int param Int2DParamDescriptor *i2DParam = desc.defineInt2DParam("Int2D"); i2DParam->setLabels("Int2D", "Int2D", "Int2D"); i2DParam->setScriptName("int2D"); i2DParam->setHint("A 2D integer parameter"); i2DParam->setDefault(0, 0); i2DParam->setRange(-100, -100, 100, 100); i2DParam->setDisplayRange(-100, -100, 100, 100); page1->addChild(*i2DParam); // make a 3D int param Int3DParamDescriptor *i3DParam = desc.defineInt3DParam("Int3D"); i3DParam->setLabels("Int3D", "Int3D", "Int2D"); i3DParam->setScriptName("int3D"); i3DParam->setHint("A 3D integer parameter"); i3DParam->setDefault(0, 0, 0); i3DParam->setRange(-100, -100, -100, 100, 100, 100); i3DParam->setDisplayRange(-100, -100, -100, 100, 100, 100); page1->addChild(*i3DParam); page1->addChild(PageParamDescriptor::gSkipColumn); // boolean BooleanParamDescriptor *boolean = desc.defineBooleanParam("bool"); boolean->setLabels("bool", "bool", "bool"); boolean->setDefault(false); page1->addChild(*boolean); // choice ChoiceParamDescriptor *choice = desc.defineChoiceParam("choice"); choice->setLabels("choice", "choice", "choice"); choice->appendOption("This", "This"); choice->appendOption("That", "That"); choice->appendOption("The Other", "The Other"); choice->resetOptions(); choice->appendOption("Tom", "Tom"); choice->appendOption("Dick", "Dick"); choice->appendOption("Harry", "Harry"); choice->setDefault(0); page1->addChild(*choice); page1->addChild(PageParamDescriptor::gSkipColumn); // push button PushButtonParamDescriptor *push = desc.definePushButtonParam("push"); push->setLabels("push me", "push me", "push me Big Nose"); page1->addChild(*push); // make a custom param CustomParamDescriptor *custom = desc.defineCustomParam("custom"); custom->setLabels("custom", "custom", "custom"); custom->setDefault("wibble"); // rgba colours RGBAParamDescriptor *rgba = desc.defineRGBAParam("rgba"); rgba->setLabels("rgba", "rgba", "rgba"); rgba->setDefault(0, 0, 0, 1); page1->addChild(*rgba); RGBParamDescriptor *rgba2 = desc.defineRGBParam("rgbaCustom"); rgba2->setLabels("RGB Custom", "RGB Custom", "RGB Custom"); rgba2->setDefault(0, 1, 1); rgba2->setInteractDescriptor(new ColourInteractDescriptor<0>); page1->addChild(*rgba2); RGBParamDescriptor *rgba3 = desc.defineRGBParam("rgbaCustom2"); rgba3->setLabels("RGB Custom 2", "RGB Custom 2", "RGB Custom 2"); rgba3->setDefault(1, 0, 1); rgba3->setInteractDescriptor(new ColourInteractDescriptor<1>); page1->addChild(*rgba3); page1->addChild(PageParamDescriptor::gSkipRow); // rgb colour RGBParamDescriptor *rgb = desc.defineRGBParam("rgb"); rgb->setLabels("rgb", "rgb", "rgb"); rgb->setDefault(0, 0, 0); page1->addChild(*rgb); // make a 1D double parameter of each type describeDoubleParam(desc, "double", eDoubleTypePlain, -100, 100, page2); describeDoubleParam(desc, "angle", eDoubleTypeAngle, -100, 100, page2); describeDoubleParam(desc, "scale", eDoubleTypeScale, -1, 1, page2); describeDoubleParam(desc, "time", eDoubleTypeTime, -100, 100, page2); describeDoubleParam(desc, "absoluteTime", eDoubleTypeAbsoluteTime, 0, 1000, page2); describeDoubleParam(desc, "X_Value", eDoubleTypeNormalisedX, -1, 1, page2); describeDoubleParam(desc, "Y_Value", eDoubleTypeNormalisedY, -1, 1, page2); describeDoubleParam(desc, "X_Position", eDoubleTypeNormalisedXAbsolute, -1, 1, page2); describeDoubleParam(desc, "Y_Position", eDoubleTypeNormalisedYAbsolute, -1, 1, page2); page2->addChild(PageParamDescriptor::gSkipColumn); // make a 2D double parameter of each type describe2DDoubleParam(desc, "double2D", eDoubleTypePlain, -100, 100, page2); describe2DDoubleParam(desc, "angle2D", eDoubleTypeAngle, -100, 100, page2); describe2DDoubleParam(desc, "scale2D", eDoubleTypeScale, -1, 1, page2); describe2DDoubleParam(desc, "XY_Value", eDoubleTypeNormalisedXY, -1, 1, page2); describe2DDoubleParam(desc, "XY_Position", eDoubleTypeNormalisedXYAbsolute, -1, 1, page2); page2->addChild(PageParamDescriptor::gSkipColumn); // make a 3D double parameter of each type describe3DDoubleParam(desc, "double3D", eDoubleTypePlain, -100, 100, page2); describe3DDoubleParam(desc, "angle3D", eDoubleTypeAngle, -100, 100, page2); describe3DDoubleParam(desc, "scale3D", eDoubleTypeScale, -1, 1, page2); // make a string param param of each type describeStringParam(desc, "singleLine", eStringTypeSingleLine, page3); describeStringParam(desc, "multiLine", eStringTypeMultiLine, page3); describeStringParam(desc, "filePath", eStringTypeFilePath, page3); describeStringParam(desc, "dirPath", eStringTypeDirectoryPath, page3); describeStringParam(desc, "label", eStringTypeLabel, page3); }
void LensCalibrationPluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::ContextEnum context) { //Input Clip OFX::ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName); srcClip->addSupportedComponent(OFX::ePixelComponentRGBA); srcClip->setTemporalClipAccess(false); srcClip->setSupportsTiles(false); srcClip->setIsMask(false); srcClip->setOptional(false); //Output clip OFX::ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName); dstClip->addSupportedComponent(OFX::ePixelComponentRGBA); dstClip->setSupportsTiles(false); //Calibration Group { OFX::GroupParamDescriptor *groupCalibration = desc.defineGroupParam(kParamGroupCalibration); groupCalibration->setLabel("Calibration"); groupCalibration->setAsTab(); { OFX::Int2DParamDescriptor *param = desc.defineInt2DParam(kParamImageSize); param->setLabel("Image Size"); param->setHint("Input image size used to calibrate the optics. Obviously, all images should have the same size."); param->setDefault(0, 0); param->setDisplayRange(0, 0, 10000, 10000); param->setAnimates(false); param->setParent(*groupCalibration); param->setEnabled(false); // should not be edited by the user } { OFX::BooleanParamDescriptor *param = desc.defineBooleanParam(kParamInputImageIsGray); param->setLabel("Input image is gray"); param->setHint("Input image is gray"); param->setParent(*groupCalibration); } { OFX::ChoiceParamDescriptor *param = desc.defineChoiceParam(kParamPatternType); param->setLabel("Pattern Type"); param->setHint("Type of pattern to detect"); param->appendOptions(kStringParamPatternType); param->setDefault(eParamPatternTypeChessboard); param->setAnimates(false); param->setParent(*groupCalibration); } { OFX::Int2DParamDescriptor *param = desc.defineInt2DParam(kParamPatternSize); param->setLabel("Pattern Size"); param->setHint("Number of inner corners per one of board dimension Width Height"); param->setDefault(10, 7); param->setRange(2, 2, kOfxFlagInfiniteMax, kOfxFlagInfiniteMax); param->setDisplayRange(2, 2, 15, 15); param->setAnimates(false); param->setParent(*groupCalibration); } { OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamSquareSize); param->setLabel("Square Size"); param->setHint("Define the size of the grid's square cells (mm)"); param->setDisplayRange(0, 100); param->setDefault(1); param->setAnimates(false); param->setParent(*groupCalibration); param->setLayoutHint(OFX::eLayoutHintDivider); } { OFX::IntParamDescriptor *param = desc.defineIntParam(kParamNbRadialCoef); param->setLabel("Nb Radial Coef"); param->setHint("Number of radial coefficient."); param->setRange(0, 6); param->setDisplayRange(0, 6); param->setDefault(3); param->setAnimates(false); param->setParent(*groupCalibration); } { OFX::IntParamDescriptor *param = desc.defineIntParam(kParamMaxFrames); param->setLabel("Max Frames"); param->setHint("Maximal number of frames to extract from the video file."); param->setRange(0, kOfxFlagInfiniteMax); param->setDisplayRange(0, 1000); param->setDefault(0); param->setAnimates(false); param->setParent(*groupCalibration); } { OFX::IntParamDescriptor *param = desc.defineIntParam(kParamMaxCalibFrames); param->setLabel("Max Calibration Frames"); param->setHint("Maximal number of frames to use to calibrate from the selected frames."); param->setRange(0, kOfxFlagInfiniteMax); param->setDisplayRange(0, 1000); param->setDefault(100); param->setAnimates(false); param->setParent(*groupCalibration); } { OFX::IntParamDescriptor *param = desc.defineIntParam(kParamCalibGridSize); param->setLabel("Max Calibration Grid Size"); param->setHint("Define the number of cells per edge."); param->setRange(0, kOfxFlagInfiniteMax); param->setDisplayRange(0, 100); param->setDefault(10); param->setAnimates(false); param->setParent(*groupCalibration); } { OFX::IntParamDescriptor *param = desc.defineIntParam(kParamMinInputFrames); param->setLabel("Min Input Frames"); param->setHint("Minimal number of frames to limit the calibration refinement loop."); param->setRange(0, kOfxFlagInfiniteMax); param->setDisplayRange(0, 1000); param->setDefault(10); param->setAnimates(false); param->setParent(*groupCalibration); } { OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamMaxTotalAvgErr); param->setLabel("Max Total Average Error"); param->setHint("Maximal limit of the total average error"); param->setRange(0, 1); param->setDisplayRange(0, 1); param->setDefault(0.1); param->setAnimates(false); param->setParent(*groupCalibration); } { OFX::PushButtonParamDescriptor *param = desc.definePushButtonParam(kParamCalibrate); param->setLabel("Calibrate"); param->setHint("calibrate"); param->setParent(*groupCalibration); } } //Output Group { OFX::GroupParamDescriptor *groupOutput = desc.defineGroupParam(kParamGroupOutput); groupOutput->setLabel("Output"); groupOutput->setAsTab(); { OFX::BooleanParamDescriptor *param = desc.defineBooleanParam(kParamOutputIsCalibrated); param->setLabel("Is calibrated"); param->setHint("Is calibrated"); param->setParent(*groupOutput); } { OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputAvgReprojErr); param->setLabel("Average Reprojection Error"); param->setDisplayRange(0, 10); param->setEvaluateOnChange(false); param->setEnabled(false); param->setAnimates(true); param->setParent(*groupOutput); param->setLayoutHint(OFX::eLayoutHintDivider); } { OFX::GroupParamDescriptor *groupCamera = desc.defineGroupParam(kParamOutputCameraGroup); groupCamera->setLabel("Intrinsics Camera Parameters"); groupCamera->setParent(*groupOutput); groupCamera->setOpen(true); { OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputFocalLenght); param->setLabel("Focal Length"); param->setDisplayRange(1, 100); param->setAnimates(true); param->setEvaluateOnChange(false); param->setEnabled(false); param->setAnimates(false); param->setParent(*groupCamera); } { OFX::Double2DParamDescriptor *param = desc.defineDouble2DParam(kParamOutputPrincipalPointOffset); param->setLabel("Principal Point"); param->setAnimates(true); param->setEvaluateOnChange(false); param->setEnabled(false); param->setAnimates(false); param->setParent(*groupCamera); } } { OFX::GroupParamDescriptor *groupLensDistortion = desc.defineGroupParam(kParamOutputLensDistortionGroup); groupLensDistortion->setLabel("Lens Distortion Coefficients"); groupLensDistortion->setParent(*groupOutput); groupLensDistortion->setOpen(true); { OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputRadialCoef1); param->setLabel("Radial Coef1"); param->setDisplayRange(0, 10); param->setAnimates(true); param->setEvaluateOnChange(false); param->setEnabled(false); param->setAnimates(false); param->setParent(*groupLensDistortion); } { OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputRadialCoef2); param->setLabel("Radial Coef2"); param->setDisplayRange(0, 10); param->setAnimates(true); param->setEvaluateOnChange(false); param->setEnabled(false); param->setAnimates(false); param->setParent(*groupLensDistortion); } { OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputRadialCoef3); param->setLabel("Radial Coef3"); param->setDisplayRange(0, 10); param->setAnimates(true); param->setEvaluateOnChange(false); param->setEnabled(false); param->setAnimates(false); param->setParent(*groupLensDistortion); } { OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputTangentialCoef1); param->setLabel("Tangential Coef1"); param->setDisplayRange(0, 10); param->setAnimates(true); param->setEvaluateOnChange(false); param->setEnabled(false); param->setAnimates(false); param->setParent(*groupLensDistortion); } { OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputTangentialCoef2); param->setLabel("Tangential Coef2"); param->setDisplayRange(0, 10); param->setAnimates(true); param->setEvaluateOnChange(false); param->setEnabled(false); param->setAnimates(false); param->setParent(*groupLensDistortion); param->setLayoutHint(OFX::eLayoutHintDivider); } } { OFX::PushButtonParamDescriptor *param = desc.definePushButtonParam(kParamOutputClear); param->setLabel("Clear"); param->setHint("clear"); param->setEnabled(false); param->setParent(*groupOutput); } } //Debug Group { OFX::GroupParamDescriptor *groupDebug = desc.defineGroupParam(kParamGroupDebug); groupDebug->setLabel("Debug"); groupDebug->setAsTab(); { OFX::BooleanParamDescriptor *param = desc.defineBooleanParam(kParamDebugEnable); param->setLabel("Enable Debug"); param->setHint("Would you want to export undistorted images?"); param->setParent(*groupDebug); } { OFX::StringParamDescriptor *param = desc.defineStringParam(kParamDebugRejectedImgFolder); param->setLabel("Rejected Frames"); param->setHint("Folder to export delete images during the calibration refinement loop."); param->setStringType(OFX::eStringTypeDirectoryPath); param->setFilePathExists(true); param->setParent(*groupDebug); } { OFX::StringParamDescriptor *param = desc.defineStringParam(kParamDebugSelectedImgFolder); param->setLabel("Selected Frames"); param->setHint("Folder to export debug images."); param->setStringType(OFX::eStringTypeDirectoryPath); param->setFilePathExists(true); param->setParent(*groupDebug); } } }
void describeGeneratorParamsInContext( OFX::ImageEffectDescriptor& desc, OFX::EContext context ) { /* to activate this // Create the mandated optional input clip OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); srcClip->addSupportedComponent( OFX::ePixelComponentRGB ); srcClip->addSupportedComponent( OFX::ePixelComponentAlpha ); srcClip->setSupportsTiles( kSupportTiles ); srcClip->setOptional(true); */ // Create the mandated output clip OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); dstClip->setSupportsTiles( kSupportTiles ); OFX::ChoiceParamDescriptor* explicitConversion = desc.defineChoiceParam( kParamGeneratorExplicitConversion ); explicitConversion->setLabel( "Explicit conversion" ); explicitConversion->appendOption( kTuttlePluginBitDepthAuto ); explicitConversion->appendOption( kTuttlePluginBitDepth8 ); explicitConversion->appendOption( kTuttlePluginBitDepth16 ); explicitConversion->appendOption( kTuttlePluginBitDepth32f ); explicitConversion->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); explicitConversion->setAnimates( false ); desc.addClipPreferencesSlaveParam( *explicitConversion ); if( OFX::getImageEffectHostDescription()->supportsMultipleClipDepths ) { explicitConversion->setDefault( 0 ); } else { explicitConversion->setIsSecret( true ); explicitConversion->setDefault( static_cast<int>( OFX::getImageEffectHostDescription()->getPixelDepth() ) ); } OFX::ChoiceParamDescriptor* method = desc.defineChoiceParam( kParamMode ); method->setLabel ( "Mode" ); method->appendOption( kParamModeFormat ); method->appendOption( kParamModeSize ); method->setDefault ( eParamModeFormat ); OFX::ChoiceParamDescriptor* format = desc.defineChoiceParam( kParamFormat ); format->setLabel( "Format" ); format->appendOption( kParamFormatPCVideo ); format->appendOption( kParamFormatNTSC ); format->appendOption( kParamFormatPAL ); format->appendOption( kParamFormatHD ); format->appendOption( kParamFormatNTSC169 ); format->appendOption( kParamFormatPAL169 ); format->appendOption( kParamFormat1kSuper35 ); format->appendOption( kParamFormat1kCinemascope ); format->appendOption( kParamFormat2kSuper35 ); format->appendOption( kParamFormat2kCinemascope ); format->appendOption( kParamFormat4kSuper35 ); format->appendOption( kParamFormat4kCinemascope ); format->appendOption( kParamFormatSquare256 ); format->appendOption( kParamFormatSquare512 ); format->appendOption( kParamFormatSquare1k ); format->appendOption( kParamFormatSquare2k ); format->setDefault( eParamFormat2kCinemascope ); OFX::BooleanParamDescriptor* specificRatio = desc.defineBooleanParam( kParamSizeSpecificRatio ); specificRatio->setLabel( "Specific ratio" ); specificRatio->setDefault( false ); specificRatio->setHint( "Specific input image ratio." ); OFX::Int2DParamDescriptor* size = desc.defineInt2DParam( kParamSize ); size->setLabel( "Size" ); size->setDefault( 200, 200 ); size->setRange( 1, 1, std::numeric_limits<int>::max(), std::numeric_limits<int>::max() ); size->setHint( "Set the output size (width, height)." ); OFX::ChoiceParamDescriptor* direction = desc.defineChoiceParam( kParamSizeOrientation ); direction->setLabel( "Orientation" ); direction->appendOption( kParamSizeOrientationX ); direction->appendOption( kParamSizeOrientationY ); direction->setDefault( eParamSizeOrientationX ); OFX::DoubleParamDescriptor* ratioValue = desc.defineDoubleParam( kParamSizeRatioValue ); ratioValue->setLabel( "Ratio Value" ); ratioValue->setDefault( 1.0 ); ratioValue->setRange( 1, std::numeric_limits<int>::max() ); ratioValue->setDisplayRange( 0, 50 ); ratioValue->setHint( "Set the ratio." ); OFX::IntParamDescriptor* width = desc.defineIntParam( kParamSizeWidth ); width->setLabel( "Width" ); width->setDefault( 200 ); width->setRange( 1, std::numeric_limits<int>::max() ); width->setDisplayRange( 0, 3000 ); width->setHint( "Set the width in pixels and specify the ratio." ); OFX::IntParamDescriptor* height = desc.defineIntParam( kParamSizeHeight ); height->setLabel( "Height" ); height->setDefault( 200 ); height->setRange( 1, std::numeric_limits<int>::max() ); height->setDisplayRange( 0, 3000 ); height->setHint( "Set the height in pixels and specify the ratio." ); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void PrintPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, OFX::EContext context ) { OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); srcClip->addSupportedComponent( OFX::ePixelComponentRGB ); srcClip->addSupportedComponent( OFX::ePixelComponentAlpha ); srcClip->setSupportsTiles( kSupportTiles ); // Create the mandated output clip OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); dstClip->setSupportsTiles( kSupportTiles ); OFX::ChoiceParamDescriptor* mode = desc.defineChoiceParam( kParamMode ); mode->setLabel( "Mode" ); mode->appendOption( kParamModeImage ); mode->appendOption( kParamModeRegion ); mode->appendOption( kParamModePixel ); OFX::Int2DParamDescriptor* pixel = desc.defineInt2DParam( kParamPixel ); pixel->setLabel( "Pixel" ); pixel->setDisplayRange( 0, 0, 2000, 2000 ); OFX::Int2DParamDescriptor* regionMin = desc.defineInt2DParam( kParamRegionMin ); regionMin->setLabel( "Region min" ); regionMin->setDisplayRange( 0, 0, 2000, 2000 ); OFX::Int2DParamDescriptor* regionMax = desc.defineInt2DParam( kParamRegionMax ); regionMax->setLabel( "Region max" ); regionMax->setDefault( 1,1 ); regionMax->setDisplayRange( 0, 0, 2000, 2000 ); OFX::IntParamDescriptor* outputColumns = desc.defineIntParam( kParamColumns ); outputColumns->setDefault(80); outputColumns->setDisplayRange(1,500); OFX::ChoiceParamDescriptor* colorType = desc.defineChoiceParam( kParamColor ); colorType->appendOption( kParamColorMono ); colorType->appendOption( kParamColorGray ); colorType->appendOption( kParamColor8 ); colorType->appendOption( kParamColor16 ); colorType->appendOption( kParamColorFullGray ); colorType->appendOption( kParamColorFull8 ); colorType->appendOption( kParamColorFull16 ); colorType->setLabel( "Color type for the output." ); OFX::ChoiceParamDescriptor* output = desc.defineChoiceParam( kParamOutput ); output->setLabel( "Output" ); output->appendOption( kParamOutputAscii ); output->appendOption( kParamOutputNumeric ); OFX::BooleanParamDescriptor* flip = desc.defineBooleanParam( kParamFlip ); flip->setLabel( "Flip" ); OFX::BooleanParamDescriptor* openGlWindow = desc.defineBooleanParam( kParamOutputOpenGL ); openGlWindow->setLabel( "Show in OpenGL Window." ); }