Mon, 03 Aug 2009 14:09:20 +0100
added P-touch decoder source
philpem@5 | 1 | xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
philpem@5 | 2 | <head> |
philpem@5 | 3 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta> |
philpem@5 | 4 | <title>The CImg Library - C++ Template Image Processing Toolkit</title> |
philpem@5 | 5 | <meta content="David Tschumperle" name="author"></meta> |
philpem@5 | 6 | <link rel="shortcut icon" type="image/x-icon" href="http://cimg.sourceforge.net/favicon.ico"></link> |
philpem@5 | 7 | <link rel="icon" type="image/png" href="favicon.png"></link> |
philpem@5 | 8 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
philpem@5 | 9 | <link href="tabs.css" rel="stylesheet" type="text/css"> |
philpem@5 | 10 | <style type="text/css"> |
philpem@5 | 11 | <!-- |
philpem@5 | 12 | body {background-color:white; font-family:sans-serif; } |
philpem@5 | 13 | a:active{text-decoration:none; color:#303090} |
philpem@5 | 14 | a:link{text-decoration:none; color:#303090} |
philpem@5 | 15 | a:visited{text-decoration:none; color:#303090} |
philpem@5 | 16 | a:hover{text-decoration:underline; color:#4E9F71} |
philpem@5 | 17 | --> |
philpem@5 | 18 | </style> |
philpem@5 | 19 | <script language="JavaScript" type="text/javascript"> |
philpem@5 | 20 | <!-- Original: Eric King (eric_andrew_king@hotmail.com) is used to display images in popup windows --> |
philpem@5 | 21 | <!-- Web Site: http://redrival.com/eak/ --> |
philpem@5 | 22 | <!-- This script and many more are available free online at --> |
philpem@5 | 23 | <!-- The JavaScript Source!! http://javascript.internet.com --> |
philpem@5 | 24 | <!-- Begin |
philpem@5 | 25 | function NewWindow(mypage, myname, w, h, scroll) { |
philpem@5 | 26 | var winl = (screen.width - w) / 2; |
philpem@5 | 27 | var wint = (screen.height - h) / 2; |
philpem@5 | 28 | winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable' |
philpem@5 | 29 | win = window.open(mypage, myname, winprops) |
philpem@5 | 30 | if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } |
philpem@5 | 31 | } |
philpem@5 | 32 | // End --> |
philpem@5 | 33 | </script> |
philpem@5 | 34 | </head> |
philpem@5 | 35 | <body> |
philpem@5 | 36 | <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%"> |
philpem@5 | 37 | <tbody><tr><td> |
philpem@5 | 38 | <hr noshade="noshade" size="1" width="90%"></hr> |
philpem@5 | 39 | <center> |
philpem@5 | 40 | <br/> |
philpem@5 | 41 | <a href="http://cimg.sourceforge.net"><img src="http://cimg.sourceforge.net/img/CImgLogo.jpg" alt="" border="0"></img></a><br/> |
philpem@5 | 42 | <br/> |
philpem@5 | 43 | </center> |
philpem@5 | 44 | <hr noshade="noshade" size="1" width="90%"></hr> |
philpem@5 | 45 | <center> |
philpem@5 | 46 | <table bgcolor="#EEEEFF" style="width: 90%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="3" cellspacing="0"> |
philpem@5 | 47 | <tbody><tr><td style="text-align: center; vertical-align: top;"> |
philpem@5 | 48 | <font color="#FFFFFF" face="Arial,Helvetica" size="-1"> |
philpem@5 | 49 | <b>[</b> <a target="_parent" href="http://cimg.sourceforge.net/index.shtml">Main</a> <b>]</b> |
philpem@5 | 50 | <b>[</b> <a target="_parent" href="http://cimg.sourceforge.net/news.shtml">News</a><b>] </b> |
philpem@5 | 51 | <b>[</b> <a target="_parent" href="http://cimg.sourceforge.net/download.shtml">Download</a> <b>]</b> |
philpem@5 | 52 | <b>[</b> <a target="_parent" href="http://cimg.sourceforge.net/screenshots.shtml">Screenshots</a> <b>]</b> |
philpem@5 | 53 | <b>[</b> <a target="_parent" href="http://cimg.sourceforge.net/reference/group__cimg__faq.html">FAQ</a> <b>]</b> |
philpem@5 | 54 | <b>[</b> <a target="_parent" href="http://cimg.sourceforge.net/reference/group__cimg__tutorial.html">Tutorial</a> <b>]</b> |
philpem@5 | 55 | <b>[</b> <a target="_parent" href="http://cimg.sourceforge.net/reference/index.html">Documentation</a> <b>]</b> |
philpem@5 | 56 | <b>[</b> <a target="_parent" href="http://sourceforge.net/forum/forum.php?forum_id=334630">Forum</a> <b>]</b> |
philpem@5 | 57 | <b>[</b> <a target="_parent" href="http://cimg.sourceforge.net/chat.shtml">Chat</a> <b>]</b> |
philpem@5 | 58 | <b>[</b> <a target="_parent" href="http://cimg.sourceforge.net/links.shtml">Links</a> <b>]</b> |
philpem@5 | 59 | </font> |
philpem@5 | 60 | </td></tr></tbody> |
philpem@5 | 61 | </table> |
philpem@5 | 62 | </center> |
philpem@5 | 63 | <hr noshade="noshade" size="1" width="90%"></hr> |
philpem@5 | 64 | </td></tr></tbody> |
philpem@5 | 65 | </table> |
philpem@5 | 66 | <!-- Generated by Doxygen 1.5.7.1 --> |
philpem@5 | 67 | <script type="text/javascript"> |
philpem@5 | 68 | <!-- |
philpem@5 | 69 | function changeDisplayState (e){ |
philpem@5 | 70 | var num=this.id.replace(/[^[0-9]/g,''); |
philpem@5 | 71 | var button=this.firstChild; |
philpem@5 | 72 | var sectionDiv=document.getElementById('dynsection'+num); |
philpem@5 | 73 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
philpem@5 | 74 | sectionDiv.style.display='block'; |
philpem@5 | 75 | button.src='open.gif'; |
philpem@5 | 76 | }else{ |
philpem@5 | 77 | sectionDiv.style.display='none'; |
philpem@5 | 78 | button.src='closed.gif'; |
philpem@5 | 79 | } |
philpem@5 | 80 | } |
philpem@5 | 81 | function initDynSections(){ |
philpem@5 | 82 | var divs=document.getElementsByTagName('div'); |
philpem@5 | 83 | var sectionCounter=1; |
philpem@5 | 84 | for(var i=0;i<divs.length-1;i++){ |
philpem@5 | 85 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
philpem@5 | 86 | var header=divs[i]; |
philpem@5 | 87 | var section=divs[i+1]; |
philpem@5 | 88 | var button=header.firstChild; |
philpem@5 | 89 | if (button!='IMG'){ |
philpem@5 | 90 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
philpem@5 | 91 | button=document.createElement('img'); |
philpem@5 | 92 | divs[i].insertBefore(button,divs[i].firstChild); |
philpem@5 | 93 | } |
philpem@5 | 94 | header.style.cursor='pointer'; |
philpem@5 | 95 | header.onclick=changeDisplayState; |
philpem@5 | 96 | header.id='dynheader'+sectionCounter; |
philpem@5 | 97 | button.src='closed.gif'; |
philpem@5 | 98 | section.id='dynsection'+sectionCounter; |
philpem@5 | 99 | section.style.display='none'; |
philpem@5 | 100 | section.style.marginLeft='14px'; |
philpem@5 | 101 | sectionCounter++; |
philpem@5 | 102 | } |
philpem@5 | 103 | } |
philpem@5 | 104 | } |
philpem@5 | 105 | window.onload = initDynSections; |
philpem@5 | 106 | --> |
philpem@5 | 107 | </script> |
philpem@5 | 108 | <div class="navigation" id="top"> |
philpem@5 | 109 | <div class="tabs"> |
philpem@5 | 110 | <ul> |
philpem@5 | 111 | <li><a href="index.html"><span>Main Page</span></a></li> |
philpem@5 | 112 | <li><a href="modules.html"><span>Modules</span></a></li> |
philpem@5 | 113 | <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
philpem@5 | 114 | <li><a href="annotated.html"><span>Classes</span></a></li> |
philpem@5 | 115 | </ul> |
philpem@5 | 116 | </div> |
philpem@5 | 117 | </div> |
philpem@5 | 118 | <div class="contents"> |
philpem@5 | 119 | <h1>CImg Library Overview</h1><table border="0" cellpadding="0" cellspacing="0"> |
philpem@5 | 120 | <tr><td></td></tr> |
philpem@5 | 121 | </table> |
philpem@5 | 122 | The <b>CImg Library</b> is an image processing library, designed for C++ programmers. It provides useful classes and functions to load/save, display and process various types of images.<h2><a class="anchor" name="s1"> |
philpem@5 | 123 | Library structure</a></h2> |
philpem@5 | 124 | The CImg Library consists in a <b>single header file</b> CImg.h providing a set of C++ template classes that can be used in your own sources, to load/save, process and display images or list of images. Very portable (Unix/X11,Windows, MacOS X, FreeBSD,..), efficient, simple to use, it's a pleasant toolkit for coding image processing stuffs in C++.<p> |
philpem@5 | 125 | The header file CImg.h contains all the classes and functions that compose the library itself. This is one originality of the CImg Library. This particularly means that :<ul> |
philpem@5 | 126 | <li>No pre-compilation of the library is needed, since the compilation of the CImg functions is done at the same time as the compilation of your own C++ code.</li><li>No complex dependencies have to be handled : Just include the CImg.h file, and you get a working C++ image processing toolkit.</li><li>The compilation is done on the fly : only CImg functionalities really used by your program are compiled and appear in the compiled executable program. This leads to very compact code, without any unused stuffs.</li><li>Class members and functions are inlined, leading to better performance during the program execution.</li></ul> |
philpem@5 | 127 | <p> |
philpem@5 | 128 | The CImg Library is structured as follows :<p> |
philpem@5 | 129 | <ul> |
philpem@5 | 130 | <li>All library classes and functions are defined in the namespace <a class="el" href="namespacecimg__library.html">cimg_library</a>. This namespace encapsulates the library functionalities and avoid any class name collision that could happen with other includes. Generally, one uses this namespace as a default namespace : <div class="fragment"><pre class="fragment"><span class="preprocessor"> #include "CImg.h"</span> |
philpem@5 | 131 | <span class="keyword">using namespace </span>cimg_library; |
philpem@5 | 132 | ... |
philpem@5 | 133 | </pre></div></li></ul> |
philpem@5 | 134 | <p> |
philpem@5 | 135 | <ul> |
philpem@5 | 136 | <li>The namespace <a class="el" href="namespacecimg__library_1_1cimg.html">cimg_library::cimg</a> defines a set of <em>low-level</em> functions and variables used by the library. Documented functions in this namespace can be safely used in your own program. But, <b>never</b> use the <a class="el" href="namespacecimg__library_1_1cimg.html">cimg_library::cimg</a> namespace as a default namespace, since it contains functions whose names are already defined in the standard C/C++ library.</li></ul> |
philpem@5 | 137 | <p> |
philpem@5 | 138 | <ul> |
philpem@5 | 139 | <li>The class <a class="el" href="structcimg__library_1_1CImg.html">cimg_library::CImg</a><T> represents images up to 4-dimensions wide, containing pixels of type <code>T</code> (template parameter). This is actually the main class of the library.</li></ul> |
philpem@5 | 140 | <p> |
philpem@5 | 141 | <ul> |
philpem@5 | 142 | <li>The class <a class="el" href="structcimg__library_1_1CImgList.html">cimg_library::CImgList</a><T> represents lists of cimg_library::CImg<T> images. It can be used for instance to store different frames of an image sequence.</li></ul> |
philpem@5 | 143 | <p> |
philpem@5 | 144 | <ul> |
philpem@5 | 145 | <li>The class <a class="el" href="structcimg__library_1_1CImgDisplay.html">cimg_library::CImgDisplay</a> is able to display images or image lists into graphical display windows. As you may guess, the code of this class is highly system-dependent but this is transparent for the programmer, as environment variables are automatically set by the CImg library (see also <a class="el" href="group__cimg__environment.html">Setting Environment Variables</a>).</li></ul> |
philpem@5 | 146 | <p> |
philpem@5 | 147 | <ul> |
philpem@5 | 148 | <li>The class <a class="el" href="structcimg__library_1_1CImgException.html">cimg_library::CImgException</a> (and its subclasses) are used by the library to throw exceptions when errors occur. Those exceptions can be catched with a bloc <code>try { ..} catch (CImgException) { .. }</code>. Subclasses define precisely the type of encountered errors.</li></ul> |
philpem@5 | 149 | <p> |
philpem@5 | 150 | Knowing these four classes is <b>enough</b> to get benefit of the CImg Library functionalities.<h2><a class="anchor" name="s2"> |
philpem@5 | 151 | CImg version of "Hello world".</a></h2> |
philpem@5 | 152 | Below is a very simple code that creates a "Hello World" image. This shows you basically how a CImg program looks like.<p> |
philpem@5 | 153 | <div class="fragment"><pre class="fragment"><span class="preprocessor"> #include "CImg.h"</span> |
philpem@5 | 154 | <span class="keyword">using namespace </span>cimg_library; |
philpem@5 | 155 | |
philpem@5 | 156 | <span class="keywordtype">int</span> main() { |
philpem@5 | 157 | CImg<unsigned char> img(640,400,1,3); <span class="comment">// Define a 640x400 color image with 8 bits per color component.</span> |
philpem@5 | 158 | img.fill(0); <span class="comment">// Set pixel values to 0 (color : black)</span> |
philpem@5 | 159 | <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> purple[] = { 255,0,255 }; <span class="comment">// Define a purple color</span> |
philpem@5 | 160 | img.draw_text(<span class="stringliteral">"Hello World"</span>,100,100,purple); <span class="comment">// Draw a purple "Hello world" at coordinates (100,100).</span> |
philpem@5 | 161 | img.display(<span class="stringliteral">"My first CImg code"</span>); <span class="comment">// Display the image in a display window.</span> |
philpem@5 | 162 | <span class="keywordflow">return</span> 0; |
philpem@5 | 163 | } |
philpem@5 | 164 | </pre></div><p> |
philpem@5 | 165 | Which can be also written in a more compact way as :<p> |
philpem@5 | 166 | <div class="fragment"><pre class="fragment"><span class="preprocessor"> #include "CImg.h"</span> |
philpem@5 | 167 | <span class="keyword">using namespace </span>cimg_library; |
philpem@5 | 168 | |
philpem@5 | 169 | <span class="keywordtype">int</span> main() { |
philpem@5 | 170 | <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> purple[] = { 255,0,255 }; |
philpem@5 | 171 | CImg<unsigned char>(640,400,1,3,0).draw_text(<span class="stringliteral">"Hello World"</span>,100,100,purple).display(<span class="stringliteral">"My first CImg code"</span>); |
philpem@5 | 172 | <span class="keywordflow">return</span> 0; |
philpem@5 | 173 | } |
philpem@5 | 174 | </pre></div><p> |
philpem@5 | 175 | Generally, you can write very small code that performs complex image processing tasks. The CImg Library is very simple to use and provide a lot of interesting algorithms for image manipulation.<h2><a class="anchor" name="s3"> |
philpem@5 | 176 | How to compile ?</a></h2> |
philpem@5 | 177 | The CImg library is a very light and user-friendly library : only standard system libraries are used. It avoid to handle complex dependancies and problems with library compatibility. The only thing you need is a (quite modern) C++ compiler :<p> |
philpem@5 | 178 | <ul> |
philpem@5 | 179 | <li><b>Microsoft Visual C++ 6.0, Visual Studio.NET and Visual Express Edition</b> : Use project files and solution files provided in the CImg Library package (directory 'compilation/') to see how it works.</li><li><b>Intel ICL compiler</b> : Use the following command to compile a CImg-based program with ICL : <div class="fragment"><pre class="fragment"> icl /Ox hello_world.cpp user32.lib gdi32.lib |
philpem@5 | 180 | </pre></div></li><li><b>g++ (MingW windows version)</b> : Use the following command to compile a CImg-based program with g++, on Windows : <div class="fragment"><pre class="fragment"> g++ -o hello_word.exe hello_word.cpp -O2 -lgdi32 |
philpem@5 | 181 | </pre></div></li><li><b>g++ (Linux version)</b> : Use the following command to compile a CImg-based program with g++, on Linux : <div class="fragment"><pre class="fragment"> g++ -o hello_word.exe hello_world.cpp -O2 -L/usr/X11R6/lib -lm -lpthread -lX11 |
philpem@5 | 182 | </pre></div></li><li><b>g++ (Solaris version)</b> : Use the following command to compile a CImg-based program with g++, on Solaris : <div class="fragment"><pre class="fragment"> g++ -o hello_word.exe hello_world.cpp -O2 -lm -lpthread -R/usr/X11R6/lib -lrt -lnsl -lsocket |
philpem@5 | 183 | </pre></div></li><li><b>g++ (Mac OS X version)</b> : Use the following command to compile a CImg-based program with g++, on Mac OS X : <div class="fragment"><pre class="fragment"> g++ -o hello_word.exe hello_world.cpp -O2 -lm -lpthread -L/usr/X11R6/lib -lm -lpthread -lX11 |
philpem@5 | 184 | </pre></div></li><li><b>Dev-Cpp</b> : Use the project file provided in the CImg library package to see how it works.</li></ul> |
philpem@5 | 185 | <p> |
philpem@5 | 186 | If you are using another compilers and encounter problems, please <a href="http://www.greyc.ensicaen.fr/~dtschump">write me</a> since maintaining compatibility is one of the priority of the CImg Library. Nevertheless, old compilers that does not respect the C++ norm will not support the CImg Library.<h2><a class="anchor" name="s4"> |
philpem@5 | 187 | What's next ?</a></h2> |
philpem@5 | 188 | If you are ready to get more, and to start writing more serious programs with CImg, you are invited to go to the <a class="el" href="group__cimg__tutorial.html">Tutorial : Getting Started.</a> section. </div> |
philpem@5 | 189 | <hr noshade="noshade" size="1" width="100%"> |
philpem@5 | 190 | <a href="http://sourceforge.net"> |
philpem@5 | 191 | <img src="http://sourceforge.net/sflogo.php?group_id=96492&type=3" border="0" height="37" width="125"></img> |
philpem@5 | 192 | </a> |
philpem@5 | 193 | <!-- Start of StatCounter Code --> |
philpem@5 | 194 | <script type="text/javascript" language="javascript"> |
philpem@5 | 195 | <!-- |
philpem@5 | 196 | var sc_project=895001; |
philpem@5 | 197 | var sc_invisible=1; |
philpem@5 | 198 | var sc_partition=7; |
philpem@5 | 199 | var sc_security="5ea85181"; |
philpem@5 | 200 | //--> |
philpem@5 | 201 | </script> |
philpem@5 | 202 | <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c8.statcounter.com/counter.php?sc_project=895001&java=0&security=5ea85181&invisible=1" alt="counter stats" border="0"></a> </noscript> |
philpem@5 | 203 | <!-- End of StatCounter Code --> |
philpem@5 | 204 | </body> |
philpem@5 | 205 | </html> |