Exemple #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 );
}
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 );
}
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;
		}
	}
}
void InputBufferPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
	OfxRangeD range;
	_paramTimeDomain->getValue( range.min, range.max );
	InputBufferProcessParams params = getProcessParams( range.min );
	
	clipPreferences.setOutputFrameVarying( params._mode == eParamInputModeCallbackPointer );
	clipPreferences.setClipComponents( *_clipDst, params._pixelComponents );
	clipPreferences.setClipBitDepth( *_clipDst, params._bitDepth );
	clipPreferences.setPixelAspectRatio( *_clipDst, params._pixelAspectRatio );
	clipPreferences.setOutputFrameRate( params._framerate );
	clipPreferences.setOutputFielding( params._field );
}
Exemple #5
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);
}
Exemple #6
0
void WriterPlugin::getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences )
{
	// If pattern detected (frame varying on time)
	clipPreferences.setOutputFrameVarying( varyOnTime() );
}
Exemple #7
0
/* Override the clip preferences, we need to say we are setting the frame varying flag */
void 
NoisePlugin::getClipPreferences(OFX::ClipPreferencesSetter &clipPreferences)
{
  clipPreferences.setOutputFrameVarying(true);
}