Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 623999701586b0ea103ff2ccad7954a6 > files > 6197

boost-doc-1.44.0-1.fc14.noarch.rpm

<!-- Copyright 2008 Lubomir Bourdev and Hailin Jin

     Distributed under the Boost Software License, Version 1.0.
     (See accompanying file LICENSE_1_0.txt or copy at
     http://www.boost.org/LICENSE_1_0.txt)
  -->

<!--
    Copyright 2005-2007 Adobe Systems Incorporated
    Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
    or a copy at http://stlab.adobe.com/licenses.html)

    Some files are held under additional license.
    Please see "http://stlab.adobe.com/licenses.html" for more information.
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
    <TITLE>Generic Image Library: color_convert.hpp Source File</TITLE>
    <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
    <LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" style='width: 100%; margin: 0; padding: 0'><tr>
<td width="100%" valign="top" style='padding-left: 10px; padding-right: 10px; padding-bottom: 10px'>
<div class="qindex"><a class="qindex" href="index.html">Modules</a> 
                  | <a class="qindex" href="classes.html">Alphabetical List</a> 
                  | <a class="qindex" href="annotated.html">Class List</a> 
                  | <a class="qindex" href="dirs.html">Directories</a> 
                  | <a class="qindex" href="files.html">File List</a> 
                  | <a class="qindex" href="../index.html">GIL Home Page</a> 
</div>
<!-- End Header -->
<!-- Generated by Doxygen 1.5.6 -->
  <div class="navpath"><a class="el" href="g_i_l_0076.html">boost</a>&nbsp;&raquo&nbsp;<a class="el" href="g_i_l_0079.html">gil</a>
  </div>
<div class="contents">
<h1>color_convert.hpp</h1><a href="g_i_l_0071.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">    Copyright 2005-2007 Adobe Systems Incorporated</span>
<a name="l00003"></a>00003 <span class="comment">   </span>
<a name="l00004"></a>00004 <span class="comment">    Use, modification and distribution are subject to the Boost Software License,</span>
<a name="l00005"></a>00005 <span class="comment">    Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at</span>
<a name="l00006"></a>00006 <span class="comment">    http://www.boost.org/LICENSE_1_0.txt).</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment">    See http://opensource.adobe.com/gil for most recent version including documentation.</span>
<a name="l00009"></a>00009 <span class="comment">*/</span>
<a name="l00010"></a>00010 <span class="comment">/*************************************************************************************************/</span>
<a name="l00011"></a>00011 
<a name="l00012"></a>00012 <span class="preprocessor">#ifndef GIL_COLOR_CONVERT_HPP</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define GIL_COLOR_CONVERT_HPP</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;functional&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="g_i_l_0094.html" title="GIL configuration file.">gil_config.hpp</a>"</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="g_i_l_0016.html" title="Channel algorithms.">channel_algorithm.hpp</a>"</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="pixel_8hpp.html" title="pixel class and related utilities">pixel.hpp</a>"</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="gray_8hpp.html" title="Support for grayscale color space and variants.">gray.hpp</a>"</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="rgb_8hpp.html" title="Support for RGB color space and variants.">rgb.hpp</a>"</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="rgba_8hpp.html" title="Support for RGBA color space and variants.">rgba.hpp</a>"</span>
<a name="l00034"></a>00034 <span class="preprocessor">#include "<a class="code" href="cmyk_8hpp.html" title="Support for CMYK color space and variants.">cmyk.hpp</a>"</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include "<a class="code" href="g_i_l_0238.html" title="metafunctions that construct types or return type properties">metafunctions.hpp</a>"</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include "<a class="code" href="utilities_8hpp.html" title="Various utilities not specific to the image library. Some are non-standard STL extensions...">utilities.hpp</a>"</span>
<a name="l00037"></a>00037 <span class="preprocessor">#include "<a class="code" href="g_i_l_0069.html" title="pixel related algorithms">color_base_algorithm.hpp</a>"</span>
<a name="l00038"></a>00038 
<a name="l00039"></a>00039 <span class="keyword">namespace </span>boost { <span class="keyword">namespace </span>gil {
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 <span class="comment">// Forward-declare</span>
<a name="l00042"></a>00042 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P&gt; <span class="keyword">struct </span>channel_type;
<a name="l00043"></a>00043 
<a name="l00049"></a>00049 
<a name="l00052"></a>00052 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C1, <span class="keyword">typename</span> C2&gt;
<a name="l00053"></a><a class="code" href="g_i_l_0453.html">00053</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a> {};
<a name="l00054"></a>00054 
<a name="l00057"></a>00057 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C&gt;
<a name="l00058"></a><a class="code" href="g_i_l_0457.html">00058</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a>&lt;C,C&gt; {
<a name="l00059"></a>00059     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P1, <span class="keyword">typename</span> P2&gt;
<a name="l00060"></a>00060     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> P1&amp; src, P2&amp; dst)<span class="keyword"> const </span>{
<a name="l00061"></a>00061         static_for_each(src,dst,<a class="code" href="g_i_l_0450.html" title="Same as channel_converter, except it takes the destination channel by reference,...">default_channel_converter</a>());
<a name="l00062"></a>00062     }
<a name="l00063"></a>00063 };
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 <span class="keyword">namespace </span>detail {
<a name="l00066"></a>00066 
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 <span class="comment">// The default implementation of to_luminance uses float0..1 as the intermediate channel type</span>
<a name="l00070"></a>00070 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> RedChannel, <span class="keyword">typename</span> GreenChannel, <span class="keyword">typename</span> BlueChannel, <span class="keyword">typename</span> GrayChannelValue&gt;
<a name="l00071"></a><a class="code" href="g_i_l_0519.html">00071</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0519.html" title="red * .3 + green * .59 + blue * .11 + .5">rgb_to_luminance_fn</a> {
<a name="l00072"></a>00072     GrayChannelValue operator()(<span class="keyword">const</span> RedChannel&amp; red, <span class="keyword">const</span> GreenChannel&amp; green, <span class="keyword">const</span> BlueChannel&amp; blue)<span class="keyword"> const </span>{
<a name="l00073"></a>00073         <span class="keywordflow">return</span> channel_convert&lt;GrayChannelValue&gt;( <a class="code" href="g_i_l_0620.html" title="A channel adaptor that modifies the range of the source channel. Models: ChannelValueConcept...">bits32f</a>(
<a name="l00074"></a>00074             channel_convert&lt;bits32f&gt;(red  )*0.30f + 
<a name="l00075"></a>00075             channel_convert&lt;bits32f&gt;(green)*0.59f + 
<a name="l00076"></a>00076             channel_convert&lt;bits32f&gt;(blue )*0.11f) );
<a name="l00077"></a>00077     }
<a name="l00078"></a>00078 };
<a name="l00079"></a>00079 
<a name="l00080"></a>00080 <span class="comment">// performance specialization for unsigned char</span>
<a name="l00081"></a>00081 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> GrayChannelValue&gt;
<a name="l00082"></a>00082 <span class="keyword">struct </span><a class="code" href="g_i_l_0519.html" title="red * .3 + green * .59 + blue * .11 + .5">rgb_to_luminance_fn</a>&lt;uint8_t,uint8_t,uint8_t, GrayChannelValue&gt; {
<a name="l00083"></a>00083     GrayChannelValue operator()(uint8_t red, uint8_t green, uint8_t blue)<span class="keyword"> const </span>{
<a name="l00084"></a>00084         <span class="keywordflow">return</span> channel_convert&lt;GrayChannelValue&gt;(uint8_t(
<a name="l00085"></a>00085             ((uint32_t(red  )*4915 + uint32_t(green)*9667 + uint32_t(blue )*1802) + 8192) &gt;&gt; 14));
<a name="l00086"></a>00086     }
<a name="l00087"></a>00087 };
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> GrayChannel, <span class="keyword">typename</span> RedChannel, <span class="keyword">typename</span> GreenChannel, <span class="keyword">typename</span> BlueChannel&gt;
<a name="l00090"></a>00090 <span class="keyword">typename</span> channel_traits&lt;GrayChannel&gt;::value_type rgb_to_luminance(<span class="keyword">const</span> RedChannel&amp; red, <span class="keyword">const</span> GreenChannel&amp; green, <span class="keyword">const</span> BlueChannel&amp; blue) {
<a name="l00091"></a>00091     <span class="keywordflow">return</span> rgb_to_luminance_fn&lt;RedChannel,GreenChannel,BlueChannel,
<a name="l00092"></a>00092                                <span class="keyword">typename</span> channel_traits&lt;GrayChannel&gt;::value_type&gt;()(red,green,blue);
<a name="l00093"></a>00093 }
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 }   <span class="comment">// namespace detail</span>
<a name="l00096"></a>00096 
<a name="l00099"></a>00099 <span class="keyword">template</span> &lt;&gt;
<a name="l00100"></a><a class="code" href="g_i_l_0465.html">00100</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a>&lt;gray_t,rgb_t&gt; {
<a name="l00101"></a>00101     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P1, <span class="keyword">typename</span> P2&gt;
<a name="l00102"></a>00102     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> P1&amp; src, P2&amp; dst)<span class="keyword"> const </span>{
<a name="l00103"></a>00103         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0618.html" title="Red.">red_t</a>())  =
<a name="l00104"></a>00104             channel_convert&lt;typename color_element_type&lt;P2, red_t  &gt;::type&gt;(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0536.html" title="Gray.">gray_color_t</a>()));
<a name="l00105"></a>00105         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0537.html" title="Green.">green_t</a>())=
<a name="l00106"></a>00106             channel_convert&lt;typename color_element_type&lt;P2, green_t&gt;::type&gt;(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0536.html" title="Gray.">gray_color_t</a>()));
<a name="l00107"></a>00107         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0405.html" title="Blue.">blue_t</a>()) =
<a name="l00108"></a>00108             channel_convert&lt;typename color_element_type&lt;P2, blue_t &gt;::type&gt;(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0536.html" title="Gray.">gray_color_t</a>()));
<a name="l00109"></a>00109     }
<a name="l00110"></a>00110 };
<a name="l00111"></a>00111 
<a name="l00114"></a>00114 <span class="keyword">template</span> &lt;&gt;
<a name="l00115"></a><a class="code" href="g_i_l_0463.html">00115</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a>&lt;gray_t,cmyk_t&gt; {
<a name="l00116"></a>00116     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P1, <span class="keyword">typename</span> P2&gt;
<a name="l00117"></a>00117     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> P1&amp; src, P2&amp; dst)<span class="keyword"> const </span>{
<a name="l00118"></a>00118         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0448.html" title="Cyan.">cyan_t</a>())=
<a name="l00119"></a>00119             <a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;typename color_element_type&lt;P2, cyan_t   &gt;::type</a>&gt;::min_value();
<a name="l00120"></a>00120         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0574.html" title="Magenta.">magenta_t</a>())=
<a name="l00121"></a>00121             <a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;typename color_element_type&lt;P2, magenta_t&gt;::type</a>&gt;::min_value();
<a name="l00122"></a>00122         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0637.html" title="Yellow.">yellow_t</a>())=
<a name="l00123"></a>00123             <a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;typename color_element_type&lt;P2, yellow_t &gt;::type</a>&gt;::min_value();
<a name="l00124"></a>00124         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>())=
<a name="l00125"></a>00125             channel_convert&lt;typename color_element_type&lt;P2, black_t &gt;::type&gt;(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0536.html" title="Gray.">gray_color_t</a>()));
<a name="l00126"></a>00126     }
<a name="l00127"></a>00127 };
<a name="l00128"></a>00128 
<a name="l00131"></a>00131 <span class="keyword">template</span> &lt;&gt;
<a name="l00132"></a><a class="code" href="g_i_l_0469.html">00132</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a>&lt;rgb_t,gray_t&gt; {
<a name="l00133"></a>00133     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P1, <span class="keyword">typename</span> P2&gt;
<a name="l00134"></a>00134     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> P1&amp; src, P2&amp; dst)<span class="keyword"> const </span>{
<a name="l00135"></a>00135         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0536.html" title="Gray.">gray_color_t</a>()) = 
<a name="l00136"></a>00136             detail::rgb_to_luminance&lt;typename color_element_type&lt;P2,gray_color_t&gt;::type&gt;(
<a name="l00137"></a>00137                 <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0618.html" title="Red.">red_t</a>()), <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0537.html" title="Green.">green_t</a>()), <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0405.html" title="Blue.">blue_t</a>())
<a name="l00138"></a>00138             );
<a name="l00139"></a>00139     }
<a name="l00140"></a>00140 };
<a name="l00141"></a>00141 
<a name="l00142"></a>00142 
<a name="l00150"></a>00150 <span class="keyword">template</span> &lt;&gt;
<a name="l00151"></a><a class="code" href="g_i_l_0467.html">00151</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a>&lt;rgb_t,cmyk_t&gt; {
<a name="l00152"></a>00152     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P1, <span class="keyword">typename</span> P2&gt;
<a name="l00153"></a>00153     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> P1&amp; src, P2&amp; dst)<span class="keyword"> const </span>{
<a name="l00154"></a>00154         <span class="keyword">typedef</span> <span class="keyword">typename</span> channel_type&lt;P2&gt;::type T2;
<a name="l00155"></a>00155         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0448.html" title="Cyan.">cyan_t</a>())    = <a class="code" href="g_i_l_0101.html#ge2e0267865f89610ef26148874a04bb5" title="Default implementation. Provide overloads for performance.">channel_invert</a>(channel_convert&lt;T2&gt;(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0618.html" title="Red.">red_t</a>())));          <span class="comment">// c = 1 - r</span>
<a name="l00156"></a>00156         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0574.html" title="Magenta.">magenta_t</a>()) = <a class="code" href="g_i_l_0101.html#ge2e0267865f89610ef26148874a04bb5" title="Default implementation. Provide overloads for performance.">channel_invert</a>(channel_convert&lt;T2&gt;(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0537.html" title="Green.">green_t</a>())));        <span class="comment">// m = 1 - g</span>
<a name="l00157"></a>00157         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0637.html" title="Yellow.">yellow_t</a>())  = <a class="code" href="g_i_l_0101.html#ge2e0267865f89610ef26148874a04bb5" title="Default implementation. Provide overloads for performance.">channel_invert</a>(channel_convert&lt;T2&gt;(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0405.html" title="Blue.">blue_t</a>())));         <span class="comment">// y = 1 - b</span>
<a name="l00158"></a>00158         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>())   = (std::min)(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0448.html" title="Cyan.">cyan_t</a>()),
<a name="l00159"></a>00159                                                 (std::min)(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0574.html" title="Magenta.">magenta_t</a>()),
<a name="l00160"></a>00160                                                            <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0637.html" title="Yellow.">yellow_t</a>())));   <span class="comment">// k = minimum(c, m, y)</span>
<a name="l00161"></a>00161         T2 x = <a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;T2&gt;::max_value</a>()-<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>());                  <span class="comment">// x = 1 - k</span>
<a name="l00162"></a>00162         <span class="keywordflow">if</span> (x&gt;0.0001f) {
<a name="l00163"></a>00163             <span class="keywordtype">float</span> x1 = <a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;T2&gt;::max_value</a>()/float(x);
<a name="l00164"></a>00164             <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0448.html" title="Cyan.">cyan_t</a>())    = (T2)((<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0448.html" title="Cyan.">cyan_t</a>())    - <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>()))*x1);                <span class="comment">// c = (c - k) / x</span>
<a name="l00165"></a>00165             <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0574.html" title="Magenta.">magenta_t</a>()) = (T2)((<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0574.html" title="Magenta.">magenta_t</a>()) - <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>()))*x1);                <span class="comment">// m = (m - k) / x</span>
<a name="l00166"></a>00166             <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0637.html" title="Yellow.">yellow_t</a>())  = (T2)((<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0637.html" title="Yellow.">yellow_t</a>())  - <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>()))*x1);                <span class="comment">// y = (y - k) / x</span>
<a name="l00167"></a>00167         } <span class="keywordflow">else</span> {
<a name="l00168"></a>00168             <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0448.html" title="Cyan.">cyan_t</a>())=<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0574.html" title="Magenta.">magenta_t</a>())=<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0637.html" title="Yellow.">yellow_t</a>())=0;
<a name="l00169"></a>00169         }
<a name="l00170"></a>00170     }
<a name="l00171"></a>00171 };
<a name="l00172"></a>00172 
<a name="l00179"></a>00179 <span class="keyword">template</span> &lt;&gt;
<a name="l00180"></a><a class="code" href="g_i_l_0461.html">00180</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a>&lt;cmyk_t,rgb_t&gt; {
<a name="l00181"></a>00181     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P1, <span class="keyword">typename</span> P2&gt;
<a name="l00182"></a>00182     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> P1&amp; src, P2&amp; dst)<span class="keyword"> const </span>{
<a name="l00183"></a>00183         <span class="keyword">typedef</span> <span class="keyword">typename</span> channel_type&lt;P1&gt;::type T1;
<a name="l00184"></a>00184         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0618.html" title="Red.">red_t</a>())  =
<a name="l00185"></a>00185             channel_convert&lt;typename color_element_type&lt;P2,red_t&gt;::type&gt;(
<a name="l00186"></a>00186                 channel_invert&lt;T1&gt;(
<a name="l00187"></a>00187                     (std::min)(<a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;T1&gt;::max_value</a>(), 
<a name="l00188"></a>00188                              T1(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0448.html" title="Cyan.">cyan_t</a>())*<a class="code" href="g_i_l_0101.html#ge2e0267865f89610ef26148874a04bb5" title="Default implementation. Provide overloads for performance.">channel_invert</a>(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>()))+<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>())))));
<a name="l00189"></a>00189         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0537.html" title="Green.">green_t</a>())=
<a name="l00190"></a>00190             channel_convert&lt;typename color_element_type&lt;P2,green_t&gt;::type&gt;(
<a name="l00191"></a>00191                 channel_invert&lt;T1&gt;(
<a name="l00192"></a>00192                     (std::min)(<a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;T1&gt;::max_value</a>(), 
<a name="l00193"></a>00193                              T1(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0574.html" title="Magenta.">magenta_t</a>())*<a class="code" href="g_i_l_0101.html#ge2e0267865f89610ef26148874a04bb5" title="Default implementation. Provide overloads for performance.">channel_invert</a>(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>()))+<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>())))));
<a name="l00194"></a>00194         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0405.html" title="Blue.">blue_t</a>()) =
<a name="l00195"></a>00195             channel_convert&lt;typename color_element_type&lt;P2,blue_t&gt;::type&gt;(
<a name="l00196"></a>00196                 channel_invert&lt;T1&gt;(
<a name="l00197"></a>00197                     (std::min)(<a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;T1&gt;::max_value</a>(), 
<a name="l00198"></a>00198                              T1(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0637.html" title="Yellow.">yellow_t</a>())*<a class="code" href="g_i_l_0101.html#ge2e0267865f89610ef26148874a04bb5" title="Default implementation. Provide overloads for performance.">channel_invert</a>(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>()))+<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>())))));
<a name="l00199"></a>00199     }
<a name="l00200"></a>00200 };
<a name="l00201"></a>00201 
<a name="l00202"></a>00202 
<a name="l00207"></a>00207 <span class="keyword">template</span> &lt;&gt;
<a name="l00208"></a><a class="code" href="g_i_l_0459.html">00208</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a>&lt;cmyk_t,gray_t&gt; {
<a name="l00209"></a>00209     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P1, <span class="keyword">typename</span> P2&gt;
<a name="l00210"></a>00210     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> P1&amp; src, P2&amp; dst)<span class="keyword"> const  </span>{
<a name="l00211"></a>00211         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0536.html" title="Gray.">gray_color_t</a>())=
<a name="l00212"></a>00212             channel_convert&lt;typename color_element_type&lt;P2,gray_t&gt;::type&gt;(
<a name="l00213"></a>00213                 <a class="code" href="g_i_l_0103.html#gf73b2a47a7877767534df0eee46dda17" title="A function multiplying two channels. result = a * b / max_value.">channel_multiply</a>(
<a name="l00214"></a>00214                     <a class="code" href="g_i_l_0101.html#ge2e0267865f89610ef26148874a04bb5" title="Default implementation. Provide overloads for performance.">channel_invert</a>(
<a name="l00215"></a>00215                        detail::rgb_to_luminance&lt;<span class="keyword">typename</span> <a class="code" href="g_i_l_0444.html" title="Specifies the type of the element associated with a given color tag.">color_element_type&lt;P1,black_t&gt;::type</a>&gt;(
<a name="l00216"></a>00216                             <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0448.html" title="Cyan.">cyan_t</a>()), 
<a name="l00217"></a>00217                             <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0574.html" title="Magenta.">magenta_t</a>()), 
<a name="l00218"></a>00218                             <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0637.html" title="Yellow.">yellow_t</a>())
<a name="l00219"></a>00219                        )
<a name="l00220"></a>00220                     ), 
<a name="l00221"></a>00221                     <a class="code" href="g_i_l_0101.html#ge2e0267865f89610ef26148874a04bb5" title="Default implementation. Provide overloads for performance.">channel_invert</a>(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0404.html" title="Black.">black_t</a>()))));
<a name="l00222"></a>00222     }
<a name="l00223"></a>00223 };
<a name="l00224"></a>00224 
<a name="l00225"></a>00225 <span class="keyword">namespace </span>detail {
<a name="l00226"></a>00226 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Pixel&gt; 
<a name="l00227"></a>00227 <span class="keyword">typename</span> channel_type&lt;Pixel&gt;::type alpha_or_max_impl(<span class="keyword">const</span> Pixel&amp; p, mpl::true_) {
<a name="l00228"></a>00228     <span class="keywordflow">return</span> <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(p,<a class="code" href="g_i_l_0385.html" title="Alpha.">alpha_t</a>());
<a name="l00229"></a>00229 }
<a name="l00230"></a>00230 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Pixel&gt; 
<a name="l00231"></a>00231 <span class="keyword">typename</span> channel_type&lt;Pixel&gt;::type alpha_or_max_impl(<span class="keyword">const</span> Pixel&amp;  , mpl::false_) {
<a name="l00232"></a>00232     <span class="keywordflow">return</span> channel_traits&lt;typename channel_type&lt;Pixel&gt;::type&gt;::max_value();
<a name="l00233"></a>00233 }
<a name="l00234"></a>00234 } <span class="comment">// namespace detail</span>
<a name="l00235"></a>00235 
<a name="l00236"></a>00236 <span class="comment">// Returns max_value if the pixel has no alpha channel. Otherwise returns the alpha.</span>
<a name="l00237"></a>00237 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Pixel&gt; 
<a name="l00238"></a>00238 <span class="keyword">typename</span> channel_type&lt;Pixel&gt;::type alpha_or_max(<span class="keyword">const</span> Pixel&amp; p) {
<a name="l00239"></a>00239     <span class="keywordflow">return</span> detail::alpha_or_max_impl(p, mpl::contains&lt;<span class="keyword">typename</span> color_space_type&lt;Pixel&gt;::type,alpha_t&gt;());
<a name="l00240"></a>00240 }
<a name="l00241"></a>00241 
<a name="l00242"></a>00242 
<a name="l00245"></a>00245 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C1&gt;
<a name="l00246"></a><a class="code" href="g_i_l_0455.html">00246</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a>&lt;C1,rgba_t&gt; {
<a name="l00247"></a>00247     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P1, <span class="keyword">typename</span> P2&gt;
<a name="l00248"></a>00248     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> P1&amp; src, P2&amp; dst)<span class="keyword"> const </span>{
<a name="l00249"></a>00249         <span class="keyword">typedef</span> <span class="keyword">typename</span> channel_type&lt;P2&gt;::type T2;
<a name="l00250"></a>00250         <a class="code" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">pixel&lt;T2,rgb_layout_t&gt;</a> tmp;
<a name="l00251"></a>00251         <a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl&lt;C1,rgb_t&gt;</a>()(src,tmp);
<a name="l00252"></a>00252         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0618.html" title="Red.">red_t</a>())  =<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(tmp,<a class="code" href="g_i_l_0618.html" title="Red.">red_t</a>());
<a name="l00253"></a>00253         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0537.html" title="Green.">green_t</a>())=<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(tmp,<a class="code" href="g_i_l_0537.html" title="Green.">green_t</a>());
<a name="l00254"></a>00254         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0405.html" title="Blue.">blue_t</a>()) =<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(tmp,<a class="code" href="g_i_l_0405.html" title="Blue.">blue_t</a>());
<a name="l00255"></a>00255         <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(dst,<a class="code" href="g_i_l_0385.html" title="Alpha.">alpha_t</a>())=channel_convert&lt;T2&gt;(alpha_or_max(src));
<a name="l00256"></a>00256     }
<a name="l00257"></a>00257 };
<a name="l00258"></a>00258 
<a name="l00265"></a>00265 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C2&gt;
<a name="l00266"></a><a class="code" href="g_i_l_0471.html">00266</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a>&lt;rgba_t,C2&gt; {
<a name="l00267"></a>00267     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P1, <span class="keyword">typename</span> P2&gt;
<a name="l00268"></a>00268     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> P1&amp; src, P2&amp; dst)<span class="keyword"> const </span>{
<a name="l00269"></a>00269         <span class="keyword">typedef</span> <span class="keyword">typename</span> channel_type&lt;P1&gt;::type T1;
<a name="l00270"></a>00270         <a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl&lt;rgb_t,C2&gt;</a>()(
<a name="l00271"></a>00271             <a class="code" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">pixel&lt;T1,rgb_layout_t&gt;</a>(<a class="code" href="g_i_l_0103.html#gf73b2a47a7877767534df0eee46dda17" title="A function multiplying two channels. result = a * b / max_value.">channel_multiply</a>(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0618.html" title="Red.">red_t</a>()),  <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0385.html" title="Alpha.">alpha_t</a>())), 
<a name="l00272"></a>00272                                    <a class="code" href="g_i_l_0103.html#gf73b2a47a7877767534df0eee46dda17" title="A function multiplying two channels. result = a * b / max_value.">channel_multiply</a>(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0537.html" title="Green.">green_t</a>()),<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0385.html" title="Alpha.">alpha_t</a>())), 
<a name="l00273"></a>00273                                    <a class="code" href="g_i_l_0103.html#gf73b2a47a7877767534df0eee46dda17" title="A function multiplying two channels. result = a * b / max_value.">channel_multiply</a>(<a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0405.html" title="Blue.">blue_t</a>()), <a class="code" href="g_i_l_0106.html#g4b9fe0ec8239047ac50842800de872b9" title="Constant accessor to the element associated with a given color name.">get_color</a>(src,<a class="code" href="g_i_l_0385.html" title="Alpha.">alpha_t</a>())))
<a name="l00274"></a>00274             ,dst);
<a name="l00275"></a>00275     }
<a name="l00276"></a>00276 };
<a name="l00277"></a>00277 
<a name="l00280"></a>00280 <span class="keyword">template</span> &lt;&gt;
<a name="l00281"></a><a class="code" href="g_i_l_0473.html">00281</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl</a>&lt;rgba_t,rgba_t&gt; {
<a name="l00282"></a>00282     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P1, <span class="keyword">typename</span> P2&gt;
<a name="l00283"></a>00283     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> P1&amp; src, P2&amp; dst)<span class="keyword"> const </span>{
<a name="l00284"></a>00284         static_for_each(src,dst,<a class="code" href="g_i_l_0450.html" title="Same as channel_converter, except it takes the destination channel by reference,...">default_channel_converter</a>());
<a name="l00285"></a>00285     }
<a name="l00286"></a>00286 };
<a name="l00287"></a>00287 
<a name="l00291"></a>00291 
<a name="l00294"></a><a class="code" href="g_i_l_0452.html">00294</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0452.html" title="class for color-converting one pixel to another">default_color_converter</a> {
<a name="l00295"></a>00295     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> SrcP, <span class="keyword">typename</span> DstP&gt;
<a name="l00296"></a>00296     <span class="keywordtype">void</span> operator()(<span class="keyword">const</span> SrcP&amp; src,DstP&amp; dst)<span class="keyword"> const </span>{ 
<a name="l00297"></a>00297         <span class="keyword">typedef</span> <span class="keyword">typename</span> color_space_type&lt;SrcP&gt;::type SrcColorSpace;
<a name="l00298"></a>00298         <span class="keyword">typedef</span> <span class="keyword">typename</span> color_space_type&lt;DstP&gt;::type DstColorSpace;
<a name="l00299"></a>00299         <a class="code" href="g_i_l_0453.html" title="Color Convertion function object. To be specialized for every src/dst color space...">default_color_converter_impl&lt;SrcColorSpace,DstColorSpace&gt;</a>()(src,dst);
<a name="l00300"></a>00300     }
<a name="l00301"></a>00301 };
<a name="l00302"></a>00302 
<a name="l00307"></a>00307 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> SrcP, <span class="keyword">typename</span> DstP&gt;
<a name="l00308"></a><a class="code" href="g_i_l_0178.html#gaa258d34eafbf9d9e34a2a2ad6131af2">00308</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="g_i_l_0178.html#gaa258d34eafbf9d9e34a2a2ad6131af2" title="helper function for converting one pixel to another using GIL default color-converters...">color_convert</a>(<span class="keyword">const</span> SrcP&amp; src, DstP&amp; dst) {
<a name="l00309"></a>00309     <a class="code" href="g_i_l_0452.html" title="class for color-converting one pixel to another">default_color_converter</a>()(src,dst);
<a name="l00310"></a>00310 }
<a name="l00311"></a>00311 
<a name="l00312"></a>00312 } }  <span class="comment">// namespace boost::gil</span>
<a name="l00313"></a>00313 
<a name="l00314"></a>00314 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 13:50:13 2009 for Generic Image Library by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>