PageRenderTime 40ms CodeModel.GetById 13ms app.highlight 19ms RepoModel.GetById 1ms app.codeStats 1ms

/libs/gil/doc/html/g_i_l_0003.html

https://github.com/delalond/boost_1_54_0-bgq
HTML | 135 lines | 116 code | 3 blank | 16 comment | 0 complexity | ee371d3de7bc85f752e9975bb6b50623 MD5 | raw file
  1<!-- Copyright 2008 Lubomir Bourdev and Hailin Jin
  2
  3     Distributed under the Boost Software License, Version 1.0.
  4     (See accompanying file LICENSE_1_0.txt or copy at
  5     http://www.boost.org/LICENSE_1_0.txt)
  6  -->
  7
  8<!--
  9    Copyright 2005-2007 Adobe Systems Incorporated
 10    Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
 11    or a copy at http://stlab.adobe.com/licenses.html)
 12
 13    Some files are held under additional license.
 14    Please see "http://stlab.adobe.com/licenses.html" for more information.
 15-->
 16
 17<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 18        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 19<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
 20
 21<head>
 22    <TITLE>Generic Image Library: any_image_view.hpp Source File</TITLE>
 23    <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
 24    <LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
 25</head>
 26<body>
 27<table border="0" cellspacing="0" cellpadding="0" style='width: 100%; margin: 0; padding: 0'><tr>
 28<td width="100%" valign="top" style='padding-left: 10px; padding-right: 10px; padding-bottom: 10px'>
 29<div class="qindex"><a class="qindex" href="index.html">Modules</a> 
 30                  | <a class="qindex" href="classes.html">Alphabetical List</a> 
 31                  | <a class="qindex" href="annotated.html">Class List</a> 
 32                  | <a class="qindex" href="dirs.html">Directories</a> 
 33                  | <a class="qindex" href="files.html">File List</a> 
 34                  | <a class="qindex" href="../index.html">GIL Home Page</a> 
 35</div>
 36<!-- End Header -->
 37<!-- Generated by Doxygen 1.5.6 -->
 38  <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>&nbsp;&raquo&nbsp;<a class="el" href="g_i_l_0078.html">extension</a>&nbsp;&raquo&nbsp;<a class="el" href="g_i_l_0075.html">dynamic_image</a>
 39  </div>
 40<div class="contents">
 41<h1>any_image_view.hpp</h1><a href="g_i_l_0004.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
 42<a name="l00002"></a>00002 <span class="comment">    Copyright 2005-2007 Adobe Systems Incorporated</span>
 43<a name="l00003"></a>00003 <span class="comment">   </span>
 44<a name="l00004"></a>00004 <span class="comment">    Use, modification and distribution are subject to the Boost Software License,</span>
 45<a name="l00005"></a>00005 <span class="comment">    Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at</span>
 46<a name="l00006"></a>00006 <span class="comment">    http://www.boost.org/LICENSE_1_0.txt).</span>
 47<a name="l00007"></a>00007 <span class="comment"></span>
 48<a name="l00008"></a>00008 <span class="comment">    See http://opensource.adobe.com/gil for most recent version including documentation.</span>
 49<a name="l00009"></a>00009 <span class="comment">*/</span>
 50<a name="l00010"></a>00010 
 51<a name="l00011"></a>00011 <span class="comment">/*************************************************************************************************/</span>
 52<a name="l00012"></a>00012 
 53<a name="l00013"></a>00013 <span class="preprocessor">#ifndef GIL_DYNAMICIMAGE_ANY_IMAGEVIEW_HPP</span>
 54<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define GIL_DYNAMICIMAGE_ANY_IMAGEVIEW_HPP</span>
 55<a name="l00015"></a>00015 <span class="preprocessor"></span>
 56<a name="l00024"></a>00024 
 57<a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="variant_8hpp.html" title="Support for run-time instantiated types.">variant.hpp</a>"</span>
 58<a name="l00026"></a>00026 <span class="preprocessor">#include "../../image_view.hpp"</span>
 59<a name="l00027"></a>00027 <span class="preprocessor">#include "../../image.hpp"</span>
 60<a name="l00028"></a>00028 
 61<a name="l00029"></a>00029 <span class="keyword">namespace </span>boost { <span class="keyword">namespace </span>gil {
 62<a name="l00030"></a>00030 
 63<a name="l00031"></a>00031 <span class="keyword">namespace </span>detail {
 64<a name="l00032"></a>00032     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> View&gt; <span class="keyword">struct </span>get_const_t { <span class="keyword">typedef</span> <span class="keyword">typename</span> View::const_t type; };
 65<a name="l00033"></a>00033     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Views&gt; <span class="keyword">struct </span>views_get_const_t : <span class="keyword">public</span> mpl::transform&lt;Views, get_const_t&lt;mpl::_1&gt; &gt; {};
 66<a name="l00034"></a>00034 }
 67<a name="l00035"></a>00035 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> View&gt; <span class="keyword">struct </span>dynamic_xy_step_type;
 68<a name="l00036"></a>00036 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> View&gt; <span class="keyword">struct </span>dynamic_xy_step_transposed_type;
 69<a name="l00037"></a>00037 
 70<a name="l00038"></a>00038 <span class="keyword">namespace </span>detail {
 71<a name="l00039"></a>00039     <span class="keyword">struct </span>any_type_get_num_channels {   <span class="comment">// works for both image_view and image</span>
 72<a name="l00040"></a>00040         <span class="keyword">typedef</span> <span class="keywordtype">int</span> result_type;
 73<a name="l00041"></a>00041         <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; result_type operator()(<span class="keyword">const</span> T&amp; v)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> num_channels&lt;T&gt;::value; }
 74<a name="l00042"></a>00042     };
 75<a name="l00043"></a>00043     <span class="keyword">struct </span>any_type_get_dimensions {    <span class="comment">// works for both image_view and image</span>
 76<a name="l00044"></a>00044         <span class="keyword">typedef</span> point2&lt;std::ptrdiff_t&gt; result_type;
 77<a name="l00045"></a>00045         <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; result_type operator()(<span class="keyword">const</span> T&amp; v)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> v.dimensions(); }
 78<a name="l00046"></a>00046     };
 79<a name="l00047"></a>00047 }
 80<a name="l00048"></a>00048 
 81<a name="l00063"></a>00063 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ImageViewTypes&gt;
 82<a name="l00064"></a><a class="code" href="g_i_l_0020.html">00064</a> <span class="keyword">class </span><a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view</a> : <span class="keyword">public</span> <a class="code" href="g_i_l_0062.html" title="Represents a concrete instance of a run-time specified type from a set of typesA...">variant</a>&lt;ImageViewTypes&gt; {
 83<a name="l00065"></a>00065     <span class="keyword">typedef</span> <a class="code" href="g_i_l_0062.html" title="Represents a concrete instance of a run-time specified type from a set of typesA...">variant&lt;ImageViewTypes&gt;</a> <a class="code" href="g_i_l_0062.html">parent_t</a>;
 84<a name="l00066"></a>00066 <span class="keyword">public</span>:
 85<a name="l00067"></a>00067     <span class="keyword">typedef</span> <a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view&lt;typename detail::views_get_const_t&lt;ImageViewTypes&gt;::type</a>&gt; <a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">const_t</a>;
 86<a name="l00068"></a>00068     <span class="keyword">typedef</span> std::ptrdiff_t x_coord_t;
 87<a name="l00069"></a>00069     <span class="keyword">typedef</span> std::ptrdiff_t y_coord_t;
 88<a name="l00070"></a>00070     <span class="keyword">typedef</span> <a class="code" href="g_i_l_0060.html" title="2D point both axes of which have the same dimension typeModels: Point2DConcept">point2&lt;std::ptrdiff_t&gt;</a> <a class="code" href="g_i_l_0060.html">point_t</a>;
 89<a name="l00071"></a>00071 
 90<a name="l00072"></a>00072     <a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view</a>()                                                          : <a class="code" href="g_i_l_0062.html">parent_t</a>() {}
 91<a name="l00073"></a>00073     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <span class="keyword">explicit</span> <a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view</a>(<span class="keyword">const</span> T&amp; obj)               : <a class="code" href="g_i_l_0062.html">parent_t</a>(obj) {}
 92<a name="l00074"></a>00074     <a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view</a>(<span class="keyword">const</span> <a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view</a>&amp; v)                                   : <a class="code" href="g_i_l_0062.html">parent_t</a>((<span class="keyword">const</span> <a class="code" href="g_i_l_0062.html">parent_t</a>&amp;)v)    {}
 93<a name="l00075"></a>00075 
 94<a name="l00076"></a>00076     <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt; <a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view</a>&amp; operator=(<span class="keyword">const</span> T&amp; obj)             { parent_t::operator=(obj); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
 95<a name="l00077"></a>00077     <a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view</a>&amp;                       operator=(<span class="keyword">const</span> <a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view</a>&amp; v)  { parent_t::operator=((<span class="keyword">const</span> <a class="code" href="g_i_l_0062.html">parent_t</a>&amp;)v); <span class="keywordflow">return</span> *<span class="keyword">this</span>;}
 96<a name="l00078"></a>00078 
 97<a name="l00079"></a>00079     std::size_t <a class="code" href="g_i_l_0581.html" title="Returns the number of channels of a pixel-based GIL construct.">num_channels</a>()<span class="keyword">  const </span>{ <span class="keywordflow">return</span> <a class="code" href="group___variant.html#g3c8fd0f3dc2495060bf062428dccc505" title="Invokes a generic mutable operation (represented as a unary function object) on a...">apply_operation</a>(*<span class="keyword">this</span>, detail::any_type_get_num_channels()); }
 98<a name="l00080"></a>00080     <a class="code" href="g_i_l_0060.html">point_t</a>     dimensions()<span class="keyword">    const </span>{ <span class="keywordflow">return</span> <a class="code" href="group___variant.html#g3c8fd0f3dc2495060bf062428dccc505" title="Invokes a generic mutable operation (represented as a unary function object) on a...">apply_operation</a>(*<span class="keyword">this</span>, detail::any_type_get_dimensions()); }
 99<a name="l00081"></a>00081     x_coord_t   width()<span class="keyword">         const </span>{ <span class="keywordflow">return</span> dimensions().<a class="code" href="g_i_l_0060.html#9a4f74af87a76a4c3dcb729cb0e68f8d">x</a>; }
100<a name="l00082"></a>00082     y_coord_t   height()<span class="keyword">        const </span>{ <span class="keywordflow">return</span> dimensions().<a class="code" href="g_i_l_0060.html#1cb2b5ea04251d543e49356ef54eb853">y</a>; }
101<a name="l00083"></a>00083 };
102<a name="l00084"></a>00084 
103<a name="l00086"></a>00086 <span class="comment">//  HasDynamicXStepTypeConcept</span>
104<a name="l00088"></a>00088 <span class="comment"></span>
105<a name="l00089"></a>00089 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> IVTypes&gt;
106<a name="l00090"></a>00090 <span class="keyword">struct </span>dynamic_x_step_type&lt;<a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view</a>&lt;IVTypes&gt; &gt; {
107<a name="l00091"></a>00091     <span class="keyword">typedef</span> <a class="code" href="g_i_l_0020.html" title="Represents a run-time specified image view. Models HasDynamicXStepTypeConcept, HasDynamicYStepTypeCo...">any_image_view&lt;typename mpl::transform&lt;IVTypes, dynamic_x_step_type&lt;mpl::_1&gt;</a> &gt;::type&gt; type;
108<a name="l00092"></a>00092 };
109<a name="l00093"></a>00093 
110<a name="l00095"></a>00095 <span class="comment">//  HasDynamicYStepTypeConcept</span>
111<a name="l00097"></a>00097 <span class="comment"></span>
112<a name="l00098"></a>00098 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> IVTypes&gt;
113<a name="l00099"></a>00099 <span class="keyword">struct </span>dynamic_y_step_type&lt;any_image_view&lt;IVTypes&gt; &gt; {
114<a name="l00100"></a>00100     <span class="keyword">typedef</span> any_image_view&lt;typename mpl::transform&lt;IVTypes, dynamic_y_step_type&lt;mpl::_1&gt; &gt;::type&gt; type;
115<a name="l00101"></a>00101 };
116<a name="l00102"></a>00102 
117<a name="l00103"></a>00103 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> IVTypes&gt;
118<a name="l00104"></a>00104 <span class="keyword">struct </span>dynamic_xy_step_type&lt;any_image_view&lt;IVTypes&gt; &gt; {
119<a name="l00105"></a>00105     <span class="keyword">typedef</span> any_image_view&lt;typename mpl::transform&lt;IVTypes, dynamic_xy_step_type&lt;mpl::_1&gt; &gt;::type&gt; type;
120<a name="l00106"></a>00106 };
121<a name="l00107"></a>00107 
122<a name="l00108"></a>00108 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> IVTypes&gt;
123<a name="l00109"></a>00109 <span class="keyword">struct </span>dynamic_xy_step_transposed_type&lt;any_image_view&lt;IVTypes&gt; &gt; {
124<a name="l00110"></a>00110     <span class="keyword">typedef</span> any_image_view&lt;typename mpl::transform&lt;IVTypes, dynamic_xy_step_transposed_type&lt;mpl::_1&gt; &gt;::type&gt; type;
125<a name="l00111"></a>00111 };
126<a name="l00112"></a>00112 
127<a name="l00113"></a>00113 } }  <span class="comment">// namespace boost::gil</span>
128<a name="l00114"></a>00114 
129<a name="l00115"></a>00115 <span class="preprocessor">#endif</span>
130</pre></div></div>
131<hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 13:50:13 2009 for Generic Image Library by&nbsp;
132<a href="http://www.doxygen.org/index.html">
133<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
134</body>
135</html>