TuttleOFX  1
color.hpp
Go to the documentation of this file.
00001 #ifndef _TERRY_COLOR_HPP_
00002 #define _TERRY_COLOR_HPP_
00003 
00004 #include <terry/numeric/operations.hpp>
00005 #include <terry/colorspace/colorspace.hpp>
00006 
00007 namespace terry {
00008 
00009 /**
00010  * @brief Set each pixel in the destination view as the result of a color transformation over the source view
00011  * @ingroup ImageAlgorithms
00012  *
00013  * The provided implementation works for 2D image views only
00014  *
00015 template <
00016                 typename SrcView, // Models RandomAccess2DImageViewConcept
00017                 typename DstView> // Models MutableRandomAccess2DImageViewConcept
00018 void colorspace_pixels_progress(
00019                 ColorSpaceAPI* colorSpaceAPI,
00020                 const EParamGradationLaw eGradationLawIn,
00021                 const EParamLayout eLayoutIn,
00022                 const EColorTemperature eTempIn,
00023                 const EParamGradationLaw eGradationLawOut,
00024                 const EParamLayout eLayoutOut,
00025                 const EColorTemperature eTempOut,
00026                 const SrcView& src_view,
00027                 const DstView& dst_view,
00028                 tuttle::plugin::IProgress* p )
00029 {
00030         for( int y = 0; y < src_view.height(); ++y )
00031         {
00032                 typename SrcView::x_iterator src_it = src_view.row_begin( y );
00033                 typename DstView::x_iterator dst_it = dst_view.row_begin( y );
00034 
00035                 for( int x = 0; x < src_view.width(); ++x, ++src_it, ++dst_it )
00036                 {
00037                         // *dst_it = *src_it;
00038                         colorSpaceAPI->colorspace_convert( eGradationLawIn, eLayoutIn, eTempIn, eGradationLawOut, eLayoutOut, eTempOut , *src_it , *dst_it  );
00039                 }
00040                 if( p->progressForward( dsl_view.width() ) )
00041                         return;
00042         }
00043 }
00044 */
00045 
00046 }
00047 
00048 #endif
00049