本文整理汇总了C++中ofx::ClipPreferencesSetter类的典型用法代码示例。如果您正苦于以下问题:C++ ClipPreferencesSetter类的具体用法?C++ ClipPreferencesSetter怎么用?C++ ClipPreferencesSetter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ClipPreferencesSetter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getClipPreferences
void EXRReaderPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
ReaderPlugin::getClipPreferences( clipPreferences );
if( getExplicitChannelConversion() == eParamReaderChannelAuto )
{
switch( _channelNames.size() )
{
case 1:
{
if( OFX::getImageEffectHostDescription()->supportsPixelComponent( OFX::ePixelComponentAlpha ) )
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentAlpha );
break;
}
case 2:
case 3:
{
if( OFX::getImageEffectHostDescription()->supportsPixelComponent( OFX::ePixelComponentRGB ) )
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGB );
break;
}
default:
//case 4:
{
if( OFX::getImageEffectHostDescription()->supportsPixelComponent( OFX::ePixelComponentRGBA ) )
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
break;
}
}
}
clipPreferences.setPixelAspectRatio( *this->_clipDst, _par );
}
示例2: getClipPreferences
void RawReaderPlugin::getClipPreferences(OFX::ClipPreferencesSetter& clipPreferences)
{
ReaderPlugin::getClipPreferences(clipPreferences);
// const std::string filename( getAbsoluteFirstFilename() );
if(getExplicitBitDepthConversion() == eParamReaderBitDepthAuto)
{
OFX::EBitDepth bd = OFX::eBitDepthNone;
int bitDepth = 32; // raw_read_precision( filename );
switch(bitDepth)
{
case 8:
bd = OFX::eBitDepthUByte;
break;
case 16:
bd = OFX::eBitDepthUShort;
break;
case 32:
bd = OFX::eBitDepthFloat;
break;
default:
BOOST_THROW_EXCEPTION(exception::ImageFormat());
}
clipPreferences.setClipBitDepth(*this->_clipDst, bd);
}
clipPreferences.setClipComponents(*this->_clipDst, OFX::ePixelComponentRGBA);
clipPreferences.setPixelAspectRatio(*this->_clipDst, 1.0);
}
示例3: getClipPreferences
void ColorGradientPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
GeneratorPlugin::getClipPreferences( clipPreferences );
if( getExplicitConversion() == eParamGeneratorExplicitConversionAuto )
{
clipPreferences.setClipBitDepth( *_clipDst, OFX::eBitDepthFloat );
}
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
clipPreferences.setPixelAspectRatio( *this->_clipDst, 1.0 );
}
示例4: getClipPreferences
void FFMpegReaderPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
clipPreferences.setOutputFrameVarying( true );
clipPreferences.setClipComponents( *_clipDst, OFX::ePixelComponentRGBA );
clipPreferences.setClipBitDepth( *_clipDst, OFX::eBitDepthUByte ); /// @todo tuttle: some video format may need other bit depth (how we can detect this ?)
if( !ensureVideoIsOpen() )
return;
// options depending on input file
clipPreferences.setPixelAspectRatio( *_clipDst, _reader.aspectRatio() );
clipPreferences.setOutputFrameRate( _reader.fps() );
// Setup fielding
switch( _reader.interlacment() )
{
case eInterlacmentNone:
{
clipPreferences.setOutputFielding( OFX::eFieldNone );
break;
}
case eInterlacmentUpper:
{
clipPreferences.setOutputFielding( OFX::eFieldUpper );
break;
}
case eInterlacmentLower:
{
clipPreferences.setOutputFielding( OFX::eFieldLower );
break;
}
}
}
示例5: getClipPreferences
void ComponentPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
switch( _paramToComponent->getValue() )
{
case eConvertToGray:
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentAlpha );
break;
case eConvertToRGB:
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGB );
break;
case eConvertToRGBA:
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
break;
}
}
示例6: getClipPreferences
void BitDepthPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
if( _paramOutBitDepth->getValue() != 0 )
{
clipPreferences.setClipBitDepth( *_clipDst, static_cast<OFX::EBitDepth>( _paramOutBitDepth->getValue() ) );
}
}
示例7:
void
TestOpenGLPlugin::getClipPreferences(OFX::ClipPreferencesSetter &clipPreferences)
{
// We have to do this because the processing code does not support varying components for srcClip and dstClip
// (The OFX spec doesn't state a default value for this)
clipPreferences.setClipComponents(*_dstClip, _srcClip->getPixelComponents());
}
示例8: getClipPreferences
void SobelPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
EParamOutputComponent comp = static_cast<EParamOutputComponent>(_paramOutputComponent->getValue());
switch( comp )
{
case eParamOutputComponentRGBA:
{
clipPreferences.setClipComponents( *_clipDst, OFX::ePixelComponentRGBA );
break;
}
case eParamOutputComponentRGB:
{
clipPreferences.setClipComponents( *_clipDst, OFX::ePixelComponentRGB );
break;
}
}
}
示例9: getClipPreferences
void ReaderPlugin::getClipPreferences(OFX::ClipPreferencesSetter& clipPreferences)
{
// If pattern detected (frame varying on time)
clipPreferences.setOutputFrameVarying(varyOnTime());
switch(getExplicitBitDepthConversion())
{
case eParamReaderBitDepthByte:
{
clipPreferences.setClipBitDepth(*this->_clipDst, OFX::eBitDepthUByte);
break;
}
case eParamReaderBitDepthShort:
{
clipPreferences.setClipBitDepth(*this->_clipDst, OFX::eBitDepthUShort);
break;
}
case eParamReaderBitDepthAuto:
case eParamReaderBitDepthFloat:
{
clipPreferences.setClipBitDepth(*this->_clipDst, OFX::eBitDepthFloat);
break;
}
}
switch(getExplicitChannelConversion())
{
case eParamReaderChannelGray:
{
clipPreferences.setClipComponents(*this->_clipDst, OFX::ePixelComponentAlpha);
break;
}
case eParamReaderChannelRGB:
{
if(OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentRGB))
clipPreferences.setClipComponents(*this->_clipDst, OFX::ePixelComponentRGB);
else
clipPreferences.setClipComponents(*this->_clipDst, OFX::ePixelComponentRGBA);
break;
}
case eParamReaderChannelAuto:
case eParamReaderChannelRGBA:
{
clipPreferences.setClipComponents(*this->_clipDst, OFX::ePixelComponentRGBA);
break;
}
}
clipPreferences.setPixelAspectRatio(*this->_clipDst, 1.0);
}
示例10: getClipPreferences
void DPXReaderPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
ReaderPlugin::getClipPreferences( clipPreferences );
const std::string filename( getAbsoluteFirstFilename() );
if( getExplicitConversion() == eParamReaderExplicitConversionAuto )
{
DpxImage dpxImg;
dpxImg.readHeader( filename );
OFX::EBitDepth bd = OFX::eBitDepthNone;
switch( dpxImg.componentsType() )
{
case DpxImage::eCompTypeR8G8B8:
case DpxImage::eCompTypeR8G8B8A8:
case DpxImage::eCompTypeA8B8G8R8:
{
bd = OFX::eBitDepthUByte;
break;
}
case DpxImage::eCompTypeR10G10B10:
case DpxImage::eCompTypeR10G10B10A10:
case DpxImage::eCompTypeA10B10G10R10:
case DpxImage::eCompTypeR12G12B12:
case DpxImage::eCompTypeR12G12B12A12:
case DpxImage::eCompTypeA12B12G12R12:
case DpxImage::eCompTypeR16G16B16:
case DpxImage::eCompTypeR16G16B16A16:
case DpxImage::eCompTypeA16B16G16R16:
{
bd = OFX::eBitDepthUShort;
break;
}
default:
bd = OFX::eBitDepthFloat;
}
clipPreferences.setClipBitDepth( *_clipDst, bd );
}
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
clipPreferences.setPixelAspectRatio( *this->_clipDst, 1.0 );
}
示例11: getClipPreferences
void PngReaderPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
ReaderPlugin::getClipPreferences( clipPreferences );
const std::string filename( getAbsoluteFirstFilename() );
if( getExplicitBitDepthConversion() == eParamReaderBitDepthAuto )
{
OFX::EBitDepth bd = OFX::eBitDepthNone;
if( ! boost::filesystem::exists( filename ) )
{
BOOST_THROW_EXCEPTION( exception::FileNotExist()
<< exception::user( "PNG: Unable to open file" )
<< exception::filename( filename ) );
}
int bitDepth;
bitDepth = png_read_precision( filename );
switch( bitDepth )
{
case 8:
bd = OFX::eBitDepthUByte;
break;
case 16:
bd = OFX::eBitDepthUShort;
break;
default:
BOOST_THROW_EXCEPTION( exception::ImageFormat() );
}
clipPreferences.setClipBitDepth( *this->_clipDst, bd );
}
if( getExplicitChannelConversion() == eParamReaderChannelAuto )
{
switch( png_read_color_type( filename ) )
{
case 0 :
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentAlpha );
break;
case 2 :
if( OFX::getImageEffectHostDescription()->supportsPixelComponent( OFX::ePixelComponentRGB ) )
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGB );
else
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
break;
case 6 :
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
break;
default:
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
break;
}
}
clipPreferences.setPixelAspectRatio( *this->_clipDst, 1.0 );
}
示例12: getClipPreferences
void EXRReaderPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
ReaderPlugin::getClipPreferences( clipPreferences );
if( getExplicitChannelConversion() == eParamReaderChannelAuto )
{
switch( _channels )
{
case 1:
{
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentAlpha );
break;
}
case 3:
{
if( OFX::getImageEffectHostDescription()->supportsPixelComponent( OFX::ePixelComponentRGB ) )
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGB );
else
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
break;
}
case 4:
{
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
break;
}
default:
{
std::string msg = "EXR: not support ";
msg += _channels;
msg += " channels.";
BOOST_THROW_EXCEPTION( exception::FileNotExist()
<< exception::user( msg ) );
break;
}
}
}
clipPreferences.setPixelAspectRatio( *this->_clipDst, 1.0 ); /// @todo tuttle: retrieve info from exr
}
示例13: getClipPreferences
void GeneratorPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
clipPreferences.setOutputFrameVarying( true );
switch( getExplicitConversion() )
{
case eParamGeneratorExplicitConversionByte:
{
clipPreferences.setClipBitDepth( *this->_clipDst, OFX::eBitDepthUByte );
break;
}
case eParamGeneratorExplicitConversionShort:
{
clipPreferences.setClipBitDepth( *this->_clipDst, OFX::eBitDepthUShort );
break;
}
case eParamGeneratorExplicitConversionAuto:
case eParamGeneratorExplicitConversionFloat:
{
clipPreferences.setClipBitDepth( *this->_clipDst, OFX::eBitDepthFloat );
break;
}
}
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
clipPreferences.setPixelAspectRatio( *this->_clipDst, 1.0 );
}
示例14: getClipPreferences
void ReaderPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
const std::string filename( getAbsoluteFirstFilename() );
if( !bfs::exists( filename ) )
{
BOOST_THROW_EXCEPTION( exception::File()
<< exception::user( "Unable to open file." )
<< exception::filename( filename ) );
BOOST_THROW_EXCEPTION( exception::FileNotExist( filename ) );
}
// If pattern detected (frame varying on time)
clipPreferences.setOutputFrameVarying( varyOnTime() );
switch( getExplicitConversion() )
{
case eParamReaderExplicitConversionByte:
{
clipPreferences.setClipBitDepth( *this->_clipDst, OFX::eBitDepthUByte );
break;
}
case eParamReaderExplicitConversionShort:
{
clipPreferences.setClipBitDepth( *this->_clipDst, OFX::eBitDepthUShort );
break;
}
case eParamReaderExplicitConversionAuto:
case eParamReaderExplicitConversionFloat:
{
clipPreferences.setClipBitDepth( *this->_clipDst, OFX::eBitDepthFloat );
break;
}
}
clipPreferences.setClipComponents( *this->_clipDst, OFX::ePixelComponentRGBA );
clipPreferences.setPixelAspectRatio( *this->_clipDst, 1.0 );
}
示例15: getClipPreferences
void TurboJpegReaderPlugin::getClipPreferences(OFX::ClipPreferencesSetter& clipPreferences)
{
ReaderPlugin::getClipPreferences(clipPreferences);
if(getExplicitBitDepthConversion() == eParamReaderBitDepthAuto)
{
clipPreferences.setClipBitDepth(*this->_clipDst, OFX::eBitDepthUByte);
}
if(getExplicitChannelConversion() == eParamReaderChannelAuto)
{
if(OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentRGB))
{
clipPreferences.setClipComponents(*this->_clipDst, OFX::ePixelComponentRGB);
}
else
{
clipPreferences.setClipComponents(*this->_clipDst, OFX::ePixelComponentRGBA);
}
}
clipPreferences.setPixelAspectRatio(*this->_clipDst, 1.0);
}