<!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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>png++: index_pixel.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">png++&#160;<span id="projectnumber">0.2.1</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">index_pixel.hpp</div>  </div>
</div>
<div class="contents">
<a href="index__pixel_8hpp.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 (C) 2007,2008   Alex Shulgin</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * This file is part of png++ the C++ wrapper for libpng.  PNG++ is free</span>
<a name="l00005"></a>00005 <span class="comment"> * software; the exact copying conditions are as follows:</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
<a name="l00008"></a>00008 <span class="comment"> * modification, are permitted provided that the following conditions are met:</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * 1. Redistributions of source code must retain the above copyright notice,</span>
<a name="l00011"></a>00011 <span class="comment"> * this list of conditions and the following disclaimer.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
<a name="l00014"></a>00014 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
<a name="l00015"></a>00015 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> * 3. The name of the author may not be used to endorse or promote products</span>
<a name="l00018"></a>00018 <span class="comment"> * derived from this software without specific prior written permission.</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS&#39;&#39; AND ANY EXPRESS OR</span>
<a name="l00021"></a>00021 <span class="comment"> * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</span>
<a name="l00022"></a>00022 <span class="comment"> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN</span>
<a name="l00023"></a>00023 <span class="comment"> * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span>
<a name="l00024"></a>00024 <span class="comment"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED</span>
<a name="l00025"></a>00025 <span class="comment"> * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR</span>
<a name="l00026"></a>00026 <span class="comment"> * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF</span>
<a name="l00027"></a>00027 <span class="comment"> * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING</span>
<a name="l00028"></a>00028 <span class="comment"> * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
<a name="l00029"></a>00029 <span class="comment"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00030"></a>00030 <span class="comment"> */</span>
<a name="l00031"></a>00031 <span class="preprocessor">#ifndef PNGPP_INDEX_PIXEL_HPP_INCLUDED</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define PNGPP_INDEX_PIXEL_HPP_INCLUDED</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &quot;<a class="code" href="types_8hpp.html">types.hpp</a>&quot;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &quot;<a class="code" href="packed__pixel_8hpp.html">packed_pixel.hpp</a>&quot;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &quot;<a class="code" href="pixel__traits_8hpp.html">pixel_traits.hpp</a>&quot;</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="keyword">namespace </span>png
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040 
<a name="l00044"></a><a class="code" href="classpng_1_1index__pixel.html">00044</a>     <span class="keyword">class </span><a class="code" href="classpng_1_1index__pixel.html" title="The 8-bit Indexed (colormap) pixel type.">index_pixel</a>
<a name="l00045"></a>00045     {
<a name="l00046"></a>00046     <span class="keyword">public</span>:
<a name="l00047"></a><a class="code" href="classpng_1_1index__pixel.html#a16519149701f54c24cc9e09ac033d1b6">00047</a>         <a class="code" href="classpng_1_1index__pixel.html#a16519149701f54c24cc9e09ac033d1b6">index_pixel</a>(<a class="code" href="namespacepng.html#ac0e0e2e09bdd9a287618bfdc5f31ca52">byte</a> index = 0)
<a name="l00048"></a>00048             : m_index(index)
<a name="l00049"></a>00049         {
<a name="l00050"></a>00050         }
<a name="l00051"></a>00051 
<a name="l00052"></a><a class="code" href="classpng_1_1index__pixel.html#acbd240869e0002e145ed1dc1ad11ab52">00052</a>         <a class="code" href="classpng_1_1index__pixel.html#acbd240869e0002e145ed1dc1ad11ab52">operator byte</a>()<span class="keyword"> const</span>
<a name="l00053"></a>00053 <span class="keyword">        </span>{
<a name="l00054"></a>00054             <span class="keywordflow">return</span> m_index;
<a name="l00055"></a>00055         }
<a name="l00056"></a>00056 
<a name="l00057"></a>00057     <span class="keyword">private</span>:
<a name="l00058"></a>00058         <a class="code" href="namespacepng.html#ac0e0e2e09bdd9a287618bfdc5f31ca52">byte</a> m_index;
<a name="l00059"></a>00059     };
<a name="l00060"></a>00060 
<a name="l00065"></a>00065     <span class="keyword">template</span>&lt; <span class="keywordtype">size_t</span> bits &gt;
<a name="l00066"></a><a class="code" href="classpng_1_1packed__index__pixel.html">00066</a>     <span class="keyword">class </span><a class="code" href="classpng_1_1packed__index__pixel.html" title="The packed indexed pixel class template. The available specializations are for 1-, 2- and 4-bit pixels.">packed_index_pixel</a>
<a name="l00067"></a>00067         : <span class="keyword">public</span> <a class="code" href="classpng_1_1packed__pixel.html" title="The packed pixel class template.">packed_pixel</a>&lt; bits &gt;
<a name="l00068"></a>00068     {
<a name="l00069"></a>00069     <span class="keyword">public</span>:
<a name="l00070"></a><a class="code" href="classpng_1_1packed__index__pixel.html#af2998b19cb86caaf0c02c0718638cfa9">00070</a>         <a class="code" href="classpng_1_1packed__index__pixel.html#af2998b19cb86caaf0c02c0718638cfa9">packed_index_pixel</a>(<a class="code" href="namespacepng.html#ac0e0e2e09bdd9a287618bfdc5f31ca52">byte</a> value = 0)
<a name="l00071"></a>00071             : <a class="code" href="classpng_1_1packed__pixel.html" title="The packed pixel class template.">packed_pixel</a>&lt; bits &gt;(value)
<a name="l00072"></a>00072         {
<a name="l00073"></a>00073         }
<a name="l00074"></a>00074     };
<a name="l00075"></a>00075 
<a name="l00079"></a><a class="code" href="namespacepng.html#ad9bcd36130a08ef57f572cd8f5589ba5">00079</a>     <span class="keyword">typedef</span> <a class="code" href="classpng_1_1packed__index__pixel.html" title="The packed indexed pixel class template. The available specializations are for 1-, 2- and 4-bit pixels.">packed_index_pixel&lt; 1 &gt;</a> <a class="code" href="namespacepng.html#ad9bcd36130a08ef57f572cd8f5589ba5" title="The 1-bit Indexed pixel type.">index_pixel_1</a>;
<a name="l00080"></a>00080 
<a name="l00084"></a><a class="code" href="namespacepng.html#ab8275ae7a6deacae66e45e38a6493b7f">00084</a>     <span class="keyword">typedef</span> <a class="code" href="classpng_1_1packed__index__pixel.html" title="The packed indexed pixel class template. The available specializations are for 1-, 2- and 4-bit pixels.">packed_index_pixel&lt; 2 &gt;</a> <a class="code" href="namespacepng.html#ab8275ae7a6deacae66e45e38a6493b7f" title="The 1-bit Indexed pixel type.">index_pixel_2</a>;
<a name="l00085"></a>00085 
<a name="l00089"></a><a class="code" href="namespacepng.html#a303ec6fdaacd846547a7992d3bd84c29">00089</a>     <span class="keyword">typedef</span> <a class="code" href="classpng_1_1packed__index__pixel.html" title="The packed indexed pixel class template. The available specializations are for 1-, 2- and 4-bit pixels.">packed_index_pixel&lt; 4 &gt;</a> <a class="code" href="namespacepng.html#a303ec6fdaacd846547a7992d3bd84c29" title="The 1-bit Indexed pixel type.">index_pixel_4</a>;
<a name="l00090"></a>00090 
<a name="l00094"></a>00094     <span class="keyword">template</span>&lt;&gt;
<a name="l00095"></a><a class="code" href="structpng_1_1pixel__traits_3_01index__pixel_01_4.html">00095</a>     <span class="keyword">struct </span>pixel_traits&lt; <a class="code" href="classpng_1_1index__pixel.html" title="The 8-bit Indexed (colormap) pixel type.">index_pixel</a> &gt;
<a name="l00096"></a>00096         : <a class="code" href="structpng_1_1basic__pixel__traits.html" title="Basic pixel traits class template.">basic_pixel_traits</a>&lt; index_pixel, byte, color_type_palette &gt;
<a name="l00097"></a>00097     {
<a name="l00098"></a>00098     };
<a name="l00099"></a>00099 
<a name="l00103"></a>00103     <span class="keyword">template</span>&lt; <span class="keywordtype">size_t</span> bits &gt;
<a name="l00104"></a><a class="code" href="structpng_1_1pixel__traits_3_01packed__index__pixel_3_01bits_01_4_01_4.html">00104</a>     <span class="keyword">struct </span>pixel_traits&lt; <a class="code" href="classpng_1_1packed__index__pixel.html" title="The packed indexed pixel class template. The available specializations are for 1-, 2- and 4-bit pixels.">packed_index_pixel</a>&lt; bits &gt; &gt;
<a name="l00105"></a>00105         : <a class="code" href="structpng_1_1basic__pixel__traits.html" title="Basic pixel traits class template.">basic_pixel_traits</a>&lt; packed_index_pixel&lt; bits &gt;, byte,
<a name="l00106"></a>00106                               color_type_palette, <span class="comment">/* channels = */</span> 1, bits &gt;
<a name="l00107"></a>00107     {
<a name="l00108"></a>00108     };
<a name="l00109"></a>00109 
<a name="l00110"></a>00110 } <span class="comment">// namespace png</span>
<a name="l00111"></a>00111 
<a name="l00112"></a>00112 <span class="preprocessor">#endif // PNGPP_INDEX_PIXEL_HPP_INCLUDED</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Thu Apr 21 2011 22:55:12 for png++ by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>
