TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_SAMPLERPLUGINFACTORY_HPP_ 00002 #define _TUTTLE_PLUGIN_SAMPLERPLUGINFACTORY_HPP_ 00003 00004 #include "SamplerDefinition.hpp" 00005 00006 #include <tuttle/plugin/exceptions.hpp> 00007 00008 #include <ofxsImageEffect.h> 00009 #include <ofxsMultiThread.h> 00010 00011 namespace tuttle { 00012 namespace plugin { 00013 00014 void describeSamplerParamsInContext( OFX::ImageEffectDescriptor& desc, 00015 OFX::EContext context ) 00016 { 00017 OFX::ChoiceParamDescriptor* filter = desc.defineChoiceParam( kParamFilter ); 00018 filter->setLabel ( kParamFilterLabel ); 00019 00020 filter->appendOption ( kParamFilterNearest ); 00021 filter->appendOption ( kParamFilterBilinear ); 00022 filter->appendOption ( kParamFilterBC ); 00023 filter->appendOption ( kParamFilterBicubic ); 00024 filter->appendOption ( kParamFilterCatrom ); 00025 filter->appendOption ( kParamFilterKeys ); 00026 filter->appendOption ( kParamFilterSimon ); 00027 filter->appendOption ( kParamFilterRifman ); 00028 filter->appendOption ( kParamFilterMitchell ); 00029 filter->appendOption ( kParamFilterParzen ); 00030 filter->appendOption ( kParamFilterLanczos ); 00031 filter->appendOption ( kParamFilterLanczos3 ); 00032 filter->appendOption ( kParamFilterLanczos4 ); 00033 filter->appendOption ( kParamFilterLanczos6 ); 00034 filter->appendOption ( kParamFilterLanczos12 ); 00035 #if(TUTTLE_EXPERIMENTAL) 00036 filter->appendOption ( kParamFilterGaussian ); 00037 #endif 00038 00039 filter->setDefault ( terry::sampler::eParamFilterBicubic ); 00040 filter->setHint( 00041 "Interpolation methods\n" 00042 "\n" 00043 "nearest: Nearest Neighbor sampler\n" 00044 "bilinear: Bilinear sample\n" 00045 "bc: 2nd order sampler with B-C parametrable\n" 00046 "bicubic: Cubic filter(0.0, 0.0)\n" 00047 "catmul-rom: Cubic filter(0.0, 0.5)\n" 00048 "keys: Cubic filter(0.0, 0.5)\n" 00049 "simon: Cubic filter(0.0, 0.75)\n" 00050 "rifman: Cubic filter(0.0, 1.0)\n" 00051 "mitchell: Cubic filter(1/3, 1/3)\n" 00052 "parzen: Cubic filter(1.0, 0.0)\n" 00053 "lanczos: Lanczos sampler with parametrable filter size\n" 00054 "lanczos3: Lanczos sampler with filter size = 3, sharpen = 2 \n" 00055 "lanczos4: Lanczos sampler with filter size = 4, sharpen = 2\n" 00056 "lanczos6: Lanczos sampler with filter size = 6, sharpen = 2\n" 00057 "lanczos12: Lanczos sampler with filter size = 12, sharpen = 2 \n" 00058 #if(TUTTLE_EXPERIMENTAL) 00059 "gaussian: Gaussian sampler with parametrable filter size and sigma value\n" 00060 #endif 00061 ); 00062 00063 OFX::DoubleParamDescriptor* B = desc.defineDoubleParam( kParamFilterB ); 00064 B->setLabel ( "B value" ); 00065 B->setDefault ( 1.0 ); 00066 B->setRange ( 0.0, 1.0 ); 00067 B->setDisplayRange ( 0.0, 1.0 ); 00068 B->setHint ( "Adjust the B valuye of the cubic filter." ); 00069 00070 OFX::DoubleParamDescriptor* C = desc.defineDoubleParam( kParamFilterC ); 00071 C->setLabel ( "C value" ); 00072 C->setDefault ( 0.0 ); 00073 C->setRange ( 0.0, 1.0 ); 00074 C->setDisplayRange ( 0.0, 1.0 ); 00075 C->setHint ( "Adjust the C valuye of the cubic filter." ); 00076 00077 OFX::IntParamDescriptor* filterSize = desc.defineIntParam( kParamFilterSize ); 00078 filterSize->setLabel ( "Filter size" ); 00079 filterSize->setDefault ( 3.0 ); 00080 filterSize->setRange ( 1.0, 30.0 ); 00081 filterSize->setDisplayRange ( 1.0, 30.0 ); 00082 filterSize->setHint ( "Set the filter size." ); 00083 00084 OFX::DoubleParamDescriptor* filterSigma = desc.defineDoubleParam( kParamFilterSigma ); 00085 filterSigma->setLabel ( "Sigma" ); 00086 filterSigma->setDefault ( 1.0 ); 00087 filterSigma->setRange ( 0.0001, 30.0 ); 00088 filterSigma->setDisplayRange ( 0.0001, 4.0 ); 00089 filterSigma->setHint ( "Set the gaussian sigma coefficient." ); 00090 00091 OFX::DoubleParamDescriptor* filterSharpen = desc.defineDoubleParam( kParamFilterSharpen ); 00092 filterSharpen->setLabel ( "Sharpen" ); 00093 filterSharpen->setDefault ( 2.0 ); 00094 filterSharpen->setRange ( 0.0001, 30.0 ); 00095 filterSharpen->setDisplayRange ( 0.0001, 4.0 ); 00096 filterSharpen->setHint ( "Set the lanczos detail coefficient." ); 00097 00098 OFX::ChoiceParamDescriptor* outOfImage = desc.defineChoiceParam( kParamFilterOutOfImage ); 00099 outOfImage->setLabel ( "Out of Image" ); 00100 outOfImage->appendOption ( kParamFilterOutBlack ); 00101 outOfImage->appendOption ( kParamFilterOutTransparency ); 00102 outOfImage->appendOption ( kParamFilterOutCopy ); 00103 #if(TUTTLE_EXPERIMENTAL) 00104 outOfImage->appendOption ( kParamFilterOutMirror ); 00105 #endif 00106 outOfImage->setHint ( "Select the filtering method out of the image." ); 00107 outOfImage->setDefault ( terry::sampler::eParamFilterOutCopy ); 00108 } 00109 00110 00111 } 00112 } 00113 #endif