예제 #1
0
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 );
}
예제 #2
0
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);
}
예제 #3
0
void WriterPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
	// If pattern detected (frame varying on time)
	clipPreferences.setOutputFrameVarying( varyOnTime() );
}