• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5<html xmlns="http://www.w3.org/1999/xhtml">
6  <head>
7    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
9    <title>Naming Conventions - Boost.GIL  documentation</title>
10    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
11    <link rel="stylesheet" href="_static/style.css" type="text/css" />
12    <script type="text/javascript">
13      var DOCUMENTATION_OPTIONS = {
14          URL_ROOT:    './',
15          VERSION:     '',
16          COLLAPSE_MODINDEX: false,
17          FILE_SUFFIX: '.html'
18      };
19    </script>
20    <script type="text/javascript" src="_static/jquery.js"></script>
21    <script type="text/javascript" src="_static/underscore.js"></script>
22    <script type="text/javascript" src="_static/doctools.js"></script>
23    <link rel="index" title="Index" href="genindex.html" />
24    <link rel="search" title="Search" href="search.html" />
25    <link rel="top" title="Boost.GIL  documentation" href="index.html" />
26    <link rel="next" title="Design Guide" href="design/index.html" />
27    <link rel="prev" title="Tutorial: Image Gradient" href="tutorial/gradient.html" />
28  </head>
29  <body>
30    <div class="header">
31    <table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
32    "header">
33      <tr>
34        <td valign="top" width="300">
35          <h3><a href="index.html"><img
36          alt="C++ Boost" src="_static/gil.png" border="0"></a></h3>
37        </td>
38
39        <td >
40          <h1 align="center"><a href="index.html"></a></h1>
41        </td>
42	<td>
43      <div id="searchbox" style="display: none">
44        <form class="search" action="search.html" method="get">
45          <input type="text" name="q" size="18" />
46          <input type="submit" value="Search" />
47          <input type="hidden" name="check_keywords" value="yes" />
48          <input type="hidden" name="area" value="default" />
49        </form>
50      </div>
51      <script type="text/javascript">$('#searchbox').show(0);</script>
52	</td>
53      </tr>
54    </table>
55    </div>
56    <hr/>
57    <div class="content">
58    <div class="navbar" style="text-align:right;">
59
60
61      <a class="prev" title="Tutorial: Image Gradient" href="tutorial/gradient.html"><img src="_static/prev.png" alt="prev"/></a>
62      <a class="next" title="Design Guide" href="design/index.html"><img src="_static/next.png" alt="next"/></a>
63
64    </div>
65
66  <div class="section" id="naming-conventions">
67<h1>Naming Conventions</h1>
68<p>Description of established naming conventions used in source code of GIL,
69tests and examples.</p>
70<div class="section" id="concrete-types">
71<h2>Concrete Types</h2>
72<p>Concrete (non-generic) GIL types follow this naming convention:</p>
73<div class="highlight-c++"><div class="highlight"><pre><span class="n">ColorSpace</span> <span class="o">+</span> <span class="n">BitDepth</span> <span class="o">+</span> <span class="p">[</span><span class="n">f</span> <span class="o">|</span> <span class="n">s</span><span class="p">]</span><span class="o">+</span> <span class="p">[</span><span class="n">c</span><span class="p">]</span> <span class="o">+</span> <span class="p">[</span><span class="n">_planar</span><span class="p">]</span> <span class="o">+</span> <span class="p">[</span><span class="n">_step</span><span class="p">]</span> <span class="o">+</span> <span class="n">ClassType</span> <span class="o">+</span> <span class="n">_t</span>
74</pre></div>
75</div>
76<p>where:</p>
77<ul class="simple">
78<li><code class="docutils literal"><span class="pre">ColorSpace</span></code> indicates layout and ordering of components.
79For example, <code class="docutils literal"><span class="pre">rgb</span></code>, <code class="docutils literal"><span class="pre">bgr</span></code>, <code class="docutils literal"><span class="pre">cmyk</span></code>, <code class="docutils literal"><span class="pre">rgba</span></code>.</li>
80<li><code class="docutils literal"><span class="pre">BitDepth</span></code> indicates the bit depth of the color channel.
81For example, <code class="docutils literal"><span class="pre">8</span></code>,``16``,``32``.</li>
82<li>By default, type of channel is unsigned integral.
83The <code class="docutils literal"><span class="pre">s</span></code> tag indicates signed integral.
84The <code class="docutils literal"><span class="pre">f</span></code> tag indicates a floating point type, which is always signed.</li>
85<li>By default, objects operate on mutable pixels.
86The <code class="docutils literal"><span class="pre">c</span></code> tag indicates object operating over immutable pixels.</li>
87<li><code class="docutils literal"><span class="pre">_planar</span></code> indicates planar organization (as opposed to interleaved).</li>
88<li><code class="docutils literal"><span class="pre">_step</span></code> indicates special image views, locators and iterators which
89traverse the data in non-trivial way. For example, backwards or every other
90pixel.</li>
91<li><code class="docutils literal"><span class="pre">ClassType</span></code> is <code class="docutils literal"><span class="pre">_image</span></code> (image), <code class="docutils literal"><span class="pre">_view</span></code> (image view), <code class="docutils literal"><span class="pre">_loc</span></code> (pixel
922D locator) <code class="docutils literal"><span class="pre">_ptr</span></code> (pixel iterator), <code class="docutils literal"><span class="pre">_ref</span></code> (pixel reference),
93<code class="docutils literal"><span class="pre">_pixel</span></code> (pixel value).</li>
94<li><code class="docutils literal"><span class="pre">_t</span></code> suffix indicaes it is a name of a type.</li>
95</ul>
96<p>For example:</p>
97<div class="highlight-cpp"><div class="highlight"><pre><span class="n">bgr8_image_t</span>             <span class="n">a</span><span class="p">;</span>    <span class="c1">// 8-bit interleaved BGR image</span>
98<span class="n">cmyk16_pixel_t</span>           <span class="n">b</span><span class="p">;</span>    <span class="c1">// 16-bit CMYK pixel value;</span>
99<span class="n">cmyk16c_planar_ref_t</span>     <span class="nf">c</span><span class="p">(</span><span class="n">b</span><span class="p">);</span> <span class="c1">// const reference to a 16-bit planar CMYK pixel.</span>
100<span class="n">rgb32f_planar_step_ptr_t</span> <span class="n">d</span><span class="p">;</span>    <span class="c1">// step pointer to a 32-bit planar RGB pixel.</span>
101</pre></div>
102</div>
103</div>
104</div>
105
106
107    <div class="navbar" style="text-align:right;">
108
109
110      <a class="prev" title="Tutorial: Image Gradient" href="tutorial/gradient.html"><img src="_static/prev.png" alt="prev"/></a>
111      <a class="next" title="Design Guide" href="design/index.html"><img src="_static/next.png" alt="next"/></a>
112
113    </div>
114    </div>
115    <div class="footer" role="contentinfo">
116      Last updated on 2020-08-11 15:08:48.
117      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.5.6.
118    </div>
119  </body>
120</html>