Ejemplo n.º 1
0
flipbook_t::flipbook_t( int frame_rate, const std::string& display_device, const std::string& display_transform)
{
    frame_rate_ = frame_rate;
    aspect_ = 1.0f;

    display_device_ = display_device;
    display_transform_ = display_transform;

    try
    {
        OCIO::ConstConfigRcPtr config = app().ocio_manager().config();
        OCIO::ConstContextRcPtr context = get_local_context();
        transform_ = OCIO::DisplayTransform::Create();
        transform_->setInputColorSpaceName( OCIO::ROLE_SCENE_LINEAR);
        transform_->setDisplay( display_device.c_str());
        transform_->setView( display_transform.c_str());
        processor_ = config->getProcessor( context, transform_, OCIO::TRANSFORM_DIR_FORWARD);
        apply_display_transform_ = true;
    }
    catch( OCIO::Exception& e)
    {
        app().ui()->error( e.what());
        apply_display_transform_ = false;
    }
}
Ejemplo n.º 2
0
void ocio_colorspace_node_t::do_process( const image::const_image_view_t& src, const image::image_view_t& dst, const render::context_t& context)
{
    boost::gil::copy_pixels( src, dst);

	std::string in_cs = get_value<std::string>( param( "in_colorspace"));
	std::string out_cs = get_value<std::string>( param( "out_colorspace"));

	try
	{
	    OCIO::ConstConfigRcPtr config = app().ocio_manager().config();
		OCIO::ConstContextRcPtr context = get_local_context();
	    OCIO::ConstProcessorRcPtr proc = config->getProcessor( context, in_cs.c_str(), out_cs.c_str());
		image::ocio_transform( dst, proc);
	}
	catch( OCIO::Exception& exception)
	{
		#ifndef NDEBUG
			std::cout << "Exception while converting colorspaces: in = " << in_cs << ", out = " << out_cs << "\n";
		#endif
	}
}