/**
 * @brief The overridden render function
 * @param[in]   args     Rendering parameters
 */
void ImageStatisticsPlugin::render( const OFX::RenderArguments& args )
{
	// instantiate the render code based on the pixel depth of the dst clip
	OFX::EBitDepth bitDepth         = _clipDst->getPixelDepth();
	OFX::EPixelComponent components = _clipDst->getPixelComponents();

	switch( components )
	{
		case OFX::ePixelComponentRGBA:
		{
			switch( bitDepth )
			{
				case OFX::eBitDepthFloat:
				{
					doGilRender<ImageStatisticsProcess, false, boost::gil::rgba_layout_t, boost::gil::bits32f>( *this, args );
					return;
				}
				case OFX::eBitDepthUByte:
				case OFX::eBitDepthUShort:
				case OFX::eBitDepthNone:
				case OFX::eBitDepthCustom:
				{
					BOOST_THROW_EXCEPTION( exception::Unsupported()
						<< exception::user() + "Bit depth (" + mapBitDepthEnumToString(bitDepth) + ") not recognized by the plugin." );
				}
			}
			break;
		}
		case OFX::ePixelComponentRGB:
		case OFX::ePixelComponentAlpha:
		case OFX::ePixelComponentCustom:
		case OFX::ePixelComponentNone:
		{
			BOOST_THROW_EXCEPTION( exception::Unsupported()
				<< exception::user() + "Pixel components (" + mapPixelComponentEnumToString(components) + ") not supported by the plugin." );
		}
	}
	BOOST_THROW_EXCEPTION( exception::Unknown() );
}
示例#2
0
	void setBitDepth( const imageEffect::EBitDepth bitDepth, const property::EModifiedBy modifiedBy = property::eModifiedByHost )
	{
		setBitDepthString( mapBitDepthEnumToString( bitDepth ), modifiedBy );
	}