Example #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 );
}
Example #2
0
	OFX::EBitDepth getOfxExplicitConversion() const
	{
		switch( getExplicitConversion() )
		{
			case eParamGeneratorExplicitConversionByte:
				return OFX::eBitDepthUByte;
			case eParamGeneratorExplicitConversionShort:
				return OFX::eBitDepthUShort;
			case eParamGeneratorExplicitConversionFloat:
				return OFX::eBitDepthFloat;
			case eParamGeneratorExplicitConversionAuto:
				BOOST_THROW_EXCEPTION( exception::Value() );
		}
		return OFX::eBitDepthNone;
	}