Exemplo n.º 1
0
void ocio_transform( const image_view_t& img, OCIO::ConstProcessorRcPtr proc)
{
	RAMEN_ASSERT( proc);
	
    if( !proc->isNoOp())
		tbb::parallel_for( tbb::blocked_range<int>( 0, img.height()), detail::ocio_transform_fun( img, proc), tbb::auto_partitioner());
}
Exemplo n.º 2
0
void make_color_bars( const image_view_t& view)
{
    typedef detail::color_bars_fn deref_t;
    typedef deref_t::point_t point_t;
    typedef boost::gil::virtual_2d_locator<deref_t,false> locator_t;
    typedef boost::gil::image_view<locator_t> my_virt_view_t;

    point_t dims( view.width(), view.height());
    my_virt_view_t bars( dims, locator_t( point_t(0,0), point_t(1,1), deref_t( dims)));
    boost::gil::copy_pixels( bars, view);
}
Exemplo n.º 3
0
void box_blur_rgba( const const_image_view_t& src, const image_view_t& tmp, const image_view_t& dst, float hradius, float vradius, int iters)
{
	RAMEN_ASSERT( src.width() == tmp.height());
	RAMEN_ASSERT( src.height() == tmp.width());
	
    if( hradius == 0 && vradius == 0)
    {
		boost::gil::copy_pixels( src, dst);
		return;
    }

	box_blur_rgba_( src, tmp, dst, hradius, vradius, iters);	
}
Exemplo n.º 4
0
void smart_blur_rgba( const const_image_view_t& src, const image_view_t& tmp, const image_view_t& dst, 
					  float stddevx, float stddevy, float thereshold)
{
	// create kernel here
	int sizex = (int)( stddevx * 6 + 1) | 1;
	if( sizex == 1) sizex = 3;
	
	int sizey = (int)( stddevy * 6 + 1) | 1;
	if( sizey == 1) sizey = 3;
	
	float *kernel = new float[ std::max( sizex, sizey)];
	
	make_gauss_kernel( kernel, sizex, stddevx);
    tbb::parallel_for( tbb::blocked_range<std::size_t>( 0, src.height()),
					   smart_blur_fn( src, tmp, thereshold, kernel, sizex), tbb::auto_partitioner());

	make_gauss_kernel( kernel, sizey, stddevy);
    tbb::parallel_for( tbb::blocked_range<std::size_t>( 0, tmp.height()),
					   smart_blur_fn( tmp, dst, thereshold, kernel, sizey), tbb::auto_partitioner());

	delete[] kernel;
}
Exemplo n.º 5
0
void invert_alpha( const const_image_view_t& src, const image_view_t& dst)
{
    RAMEN_ASSERT( src.width() == dst.width());
    RAMEN_ASSERT( src.height() == dst.height());
    boost::gil::tbb_transform_pixels( src, dst, detail::invert_alpha_fun());
}
Exemplo n.º 6
0
void resize( const const_image_view_t& src, const image_view_t& dst)
{
    tbb::parallel_for( tbb::blocked_range<int>( 0, dst.height() + 1), detail::resize_fn<Sampler>( src, dst), tbb::auto_partitioner());
}
Exemplo n.º 7
0
void convolve33( const const_image_view_t& src, const image_view_t& dst, const Imath::M33f& k)
{
    RAMEN_ASSERT( src.dimensions() == dst.dimensions() && "convolve33: src and dst views must have the same size");
    tbb::parallel_for( tbb::blocked_range<int>( 0, dst.height()), detail::convolve33_fun( src, dst, k), tbb::auto_partitioner());
}