Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 4f45e7bdfd4a5ff17f5f8eaab90d017f > files > 1709

albumshaper-2.1-6mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>AlbumShaper: tilt.cpp 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.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</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 class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>tilt.cpp</h1><a href="tilt_8cpp.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) 2003-2005 by Will Stokes</span>
<a name="l00003"></a>00003 <span class="comment">//==============================================</span>
<a name="l00004"></a>00004 <span class="comment">//  This program is free software; you can redistribute it</span>
<a name="l00005"></a>00005 <span class="comment">//  and/or modify it under the terms of the GNU General</span>
<a name="l00006"></a>00006 <span class="comment">//  Public License as published by the Free Software</span>
<a name="l00007"></a>00007 <span class="comment">//  Foundation; either version 2 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">//  (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment">//==============================================</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="comment">//Systemwide includes</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;qimage.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;qstring.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;qapplication.h&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="comment">//Projectwide includes</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include "<a class="code" href="tilt_8h.html">tilt.h</a>"</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include "<a class="code" href="tilt__internal_8h.html">tilt_internal.h</a>"</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include "../../gui/statusWidget.h"</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="comment">//----------------------------------------------</span>
<a name="l00023"></a>00023 <span class="comment">// Inputs:</span>
<a name="l00024"></a>00024 <span class="comment">// -------</span>
<a name="l00025"></a>00025 <span class="comment">// QString filename - location of original image on disk</span>
<a name="l00026"></a>00026 <span class="comment">// QPoint p1 and p2 - points along what should have been a vertical</span>
<a name="l00027"></a>00027 <span class="comment">//                    or horizontal edge</span>
<a name="l00028"></a>00028 <span class="comment">// StatusWidget* status - widget for making progress visible to user</span>
<a name="l00029"></a>00029 <span class="comment">//</span>
<a name="l00030"></a>00030 <span class="comment">// Outputs:</span>
<a name="l00031"></a>00031 <span class="comment">// --------</span>
<a name="l00032"></a>00032 <span class="comment">// QImage* returned - constructed image</span>
<a name="l00033"></a>00033 <span class="comment">//</span>
<a name="l00034"></a>00034 <span class="comment">// Description:</span>
<a name="l00035"></a>00035 <span class="comment">// ------------</span>
<a name="l00036"></a>00036 <span class="comment">// This method returned an image rotated as necessary to make points p1 </span>
<a name="l00037"></a>00037 <span class="comment">// and p2 lie on what should have been a vertical or horizontal edge. </span>
<a name="l00038"></a>00038 <span class="comment">// Implicitly this task can be broken up into three steps:</span>
<a name="l00039"></a>00039 <span class="comment">//</span>
<a name="l00040"></a>00040 <span class="comment">// 1.) Determining the angle by which to rotate the image about it's </span>
<a name="l00041"></a>00041 <span class="comment">// center. We do this by computing angle the line supplied makes with the </span>
<a name="l00042"></a>00042 <span class="comment">// vertical and horizontal axis. We hypothesize that the smaller angle </span>
<a name="l00043"></a>00043 <span class="comment">// indicates the correct axis the user is indicating and hence the </span>
<a name="l00044"></a>00044 <span class="comment">// correct angle by which to rotate the image.</span>
<a name="l00045"></a>00045 <span class="comment">//</span>
<a name="l00046"></a>00046 <span class="comment">// 2.) Now that we have sidestepped having the user input the number </span>
<a name="l00047"></a>00047 <span class="comment">// of degrees to rotate the image by hand, we must use the computed angle </span>
<a name="l00048"></a>00048 <span class="comment">// to rotate the image. An intermediate image is constructed that is the </span>
<a name="l00049"></a>00049 <span class="comment">// same resolution as the original image. Each pixel is set by computed the </span>
<a name="l00050"></a>00050 <span class="comment">// un-rotated float coordinates and bilinearly interpolating the original </span>
<a name="l00051"></a>00051 <span class="comment">// pixel value. Regions that when un-rotated no-longer fall on the original </span>
<a name="l00052"></a>00052 <span class="comment">// image plane remain black and will be clipped during the next step.</span>
<a name="l00053"></a>00053 <span class="comment">//</span>
<a name="l00054"></a>00054 <span class="comment">// 3.) A side-effect of the rotation by a non-90 degree angle is that </span>
<a name="l00055"></a>00055 <span class="comment">// the corners remain undefined (pixels in the corners were not previously </span>
<a name="l00056"></a>00056 <span class="comment">// on the image plane and hence we have no data for them). A simplistic </span>
<a name="l00057"></a>00057 <span class="comment">// approach would be to paint these regions black and require the user to </span>
<a name="l00058"></a>00058 <span class="comment">// handle crop the image to cut these corners out.</span>
<a name="l00059"></a>00059 <span class="comment">//</span>
<a name="l00060"></a>00060 <span class="comment">// Frankly, I find taking such an approach unacceptable.</span>
<a name="l00061"></a>00061 <span class="comment">//</span>
<a name="l00062"></a>00062 <span class="comment">// Since understood behavior is for the image to rotate about it's </span>
<a name="l00063"></a>00063 <span class="comment">// center, and most likely for the aspect ratio to remain unchanged, </span>
<a name="l00064"></a>00064 <span class="comment">// is it necessary to compute the maximal bounding region centered </span>
<a name="l00065"></a>00065 <span class="comment">// about the intermediate image center that does not contain any </span>
<a name="l00066"></a>00066 <span class="comment">// undefined corner image pixels.</span>
<a name="l00067"></a>00067 <span class="comment">//</span>
<a name="l00068"></a>00068 <span class="comment">// This seemingly difficult problem can be reduced to 4 rotations </span>
<a name="l00069"></a>00069 <span class="comment">// and a number of line intersections! First, one must compute </span>
<a name="l00070"></a>00070 <span class="comment">// the rotated locations of the corners of the image. Next, </span>
<a name="l00071"></a>00071 <span class="comment">// lines made up by the rotated corners and the the new image </span>
<a name="l00072"></a>00072 <span class="comment">// corners are used to find the 8 intersection points (marked with *'s) </span>
<a name="l00073"></a>00073 <span class="comment">// as shown in the figure below:</span>
<a name="l00074"></a>00074 <span class="comment">//</span>
<a name="l00075"></a>00075 <span class="comment">//           b</span>
<a name="l00076"></a>00076 <span class="comment">//  A _____*/_\*___ B</span>
<a name="l00077"></a>00077 <span class="comment">//   |    /     \  |</span>
<a name="l00078"></a>00078 <span class="comment">//   |  /         \*</span>
<a name="l00079"></a>00079 <span class="comment">//   */            |\ d</span>
<a name="l00080"></a>00080 <span class="comment">// a/|             |/</span>
<a name="l00081"></a>00081 <span class="comment">//  \*             *</span>
<a name="l00082"></a>00082 <span class="comment">//   |*_________*/_|</span>
<a name="l00083"></a>00083 <span class="comment">//  C  \       /    D</span>
<a name="l00084"></a>00084 <span class="comment">//       \   /</span>
<a name="l00085"></a>00085 <span class="comment">//        \/</span>
<a name="l00086"></a>00086 <span class="comment">//        c</span>
<a name="l00087"></a>00087 <span class="comment">//</span>
<a name="l00088"></a>00088 <span class="comment">// By drawing lines from the center to each new image corner (A,B,C,D) and </span>
<a name="l00089"></a>00089 <span class="comment">// intersecting these lines with the lopped corners described by the newly </span>
<a name="l00090"></a>00090 <span class="comment">// found points (*'s), we can find four new points. It is a rather straight </span>
<a name="l00091"></a>00091 <span class="comment">// forward process determing the maximal height and weight of a bounding </span>
<a name="l00092"></a>00092 <span class="comment">// area centered about the image that will fall within these four points.</span>
<a name="l00093"></a>00093 <span class="comment">//</span>
<a name="l00094"></a>00094 <span class="comment">// At this point a true edited image is constructed and returned </span>
<a name="l00095"></a>00095 <span class="comment">// by copying pixel values withn the computed maximal bounding </span>
<a name="l00096"></a>00096 <span class="comment">// rectangle from the intermediate image previously constructed.</span>
<a name="l00097"></a>00097 <span class="comment">//----------------------------------------------</span>
<a name="l00098"></a>00098 
<a name="l00099"></a>00099 <span class="comment">//==============================================</span>
<a name="l00100"></a><a class="code" href="tilt_8h.html#11568e88ec7c20a6b276512e8bc6b631">00100</a> QImage* <a class="code" href="tilt_8cpp.html#11568e88ec7c20a6b276512e8bc6b631">correctImageTilt</a>( QString filename, QPoint p1, QPoint p2,
<a name="l00101"></a>00101                              <a class="code" href="classStatusWidget.html">StatusWidget</a>* <a class="code" href="redEye__internal_8h.html#65b682074aef9e63bb1dad48c3e9e9df">status</a>)
<a name="l00102"></a>00102 {
<a name="l00103"></a>00103   <span class="comment">//first compute distance between two points or "radius"</span>
<a name="l00104"></a>00104   <span class="keywordtype">int</span> dx = p2.x() - p1.x();
<a name="l00105"></a>00105   <span class="keywordtype">int</span> dy = p2.y() - p1.y();
<a name="l00106"></a>00106   
<a name="l00107"></a>00107   <span class="comment">//determine tilt angle</span>
<a name="l00108"></a>00108   <span class="keywordtype">int</span> delta = 0;
<a name="l00109"></a>00109   
<a name="l00110"></a>00110   <span class="comment">//compute recirpocal of distance between points</span>
<a name="l00111"></a>00111   <span class="keywordtype">double</span> recip_r = 1.0 / sqrt( (<span class="keywordtype">double</span>) (dx*dx + dy*dy) );
<a name="l00112"></a>00112   
<a name="l00113"></a>00113   <span class="comment">//compute angle with horizontal axis</span>
<a name="l00114"></a>00114   <span class="keywordflow">if</span>( QABS(dx) &gt; QABS(dy) )
<a name="l00115"></a>00115   {
<a name="l00116"></a>00116     delta = dy;
<a name="l00117"></a>00117     <span class="keywordflow">if</span>(dx &gt; 0) delta = -delta;
<a name="l00118"></a>00118   }
<a name="l00119"></a>00119   <span class="comment">//compute angle with vertical axis</span>
<a name="l00120"></a>00120   <span class="keywordflow">else</span>
<a name="l00121"></a>00121   {
<a name="l00122"></a>00122     delta = dx;
<a name="l00123"></a>00123     <span class="keywordflow">if</span>(dy &lt; 0) delta = -delta;
<a name="l00124"></a>00124   }
<a name="l00125"></a>00125   
<a name="l00126"></a>00126   <span class="keywordtype">double</span> sinTheta = (delta * recip_r);
<a name="l00127"></a>00127   <span class="keywordtype">double</span> theta = asin( sinTheta );
<a name="l00128"></a>00128   <span class="keywordtype">double</span> cosTheta = cos( theta );
<a name="l00129"></a>00129   
<a name="l00130"></a>00130   <span class="comment">//if angle is 0 (improbable but possible) then quit now</span>
<a name="l00131"></a>00131   <span class="keywordflow">if</span>( theta == 0 )
<a name="l00132"></a>00132     <span class="keywordflow">return</span> NULL;
<a name="l00133"></a>00133   
<a name="l00134"></a>00134   <span class="comment">//load original and edited images</span>
<a name="l00135"></a>00135   QImage originalImage( filename );
<a name="l00136"></a>00136   
<a name="l00137"></a>00137   <span class="comment">//convert to 32-bit depth if necessary</span>
<a name="l00138"></a>00138   <span class="keywordflow">if</span>( originalImage.depth() &lt; 32 ) { originalImage = originalImage.convertDepth( 32, Qt::AutoColor ); }
<a name="l00139"></a>00139   
<a name="l00140"></a>00140   QImage rotatedImage( originalImage.width(), originalImage.height(), originalImage.depth() );
<a name="l00141"></a>00141   
<a name="l00142"></a>00142   <span class="comment">//setup progress bar</span>
<a name="l00143"></a>00143   QString statusMessage = qApp-&gt;translate( <span class="stringliteral">"correctImageTilt"</span>, <span class="stringliteral">"Correcting Tilt:"</span> );
<a name="l00144"></a>00144   status-&gt;<a class="code" href="classStatusWidget.html#57d461014070b9d651c36bd157cab9c1" title="Initializes the progress bar.">showProgressBar</a>( statusMessage, 200 );
<a name="l00145"></a>00145   qApp-&gt;processEvents();  
<a name="l00146"></a>00146   
<a name="l00147"></a>00147   <span class="comment">//during the first phase update the status bar for every 1% of image pixels that are processed</span>
<a name="l00148"></a>00148   <span class="keywordtype">int</span> <a class="code" href="redEye__internal_8h.html#32598f506d413f48cda8e1c930dae6b3">updateIncrement</a> = (int) ( 0.01 * originalImage.width() * originalImage.height() );
<a name="l00149"></a>00149   <span class="keywordtype">int</span> <a class="code" href="redEye__internal_8h.html#caa08422437cae250a76ca488cbe1567">newProgress</a> = 0;
<a name="l00150"></a>00150   
<a name="l00151"></a>00151   <span class="comment">//set each pixel to the rotated value</span>
<a name="l00152"></a>00152   <span class="keywordtype">double</span> xp, yp;
<a name="l00153"></a>00153   
<a name="l00154"></a>00154   <span class="keywordtype">double</span> w2 = 0.5 * rotatedImage.width();
<a name="l00155"></a>00155   <span class="keywordtype">double</span> h2 = 0.5 * rotatedImage.height();
<a name="l00156"></a>00156   
<a name="l00157"></a>00157   <span class="keywordtype">int</span> x,y;
<a name="l00158"></a>00158   uchar* scanLine;
<a name="l00159"></a>00159   QRgb* rgb;
<a name="l00160"></a>00160   <span class="keywordflow">for</span>( y=0; y&lt;rotatedImage.height(); y++)
<a name="l00161"></a>00161   {   
<a name="l00162"></a>00162     <span class="comment">//iterate over each selected pixel in scanline</span>
<a name="l00163"></a>00163     scanLine = rotatedImage.scanLine(y);
<a name="l00164"></a>00164     <span class="keywordflow">for</span>( x=0; x&lt;rotatedImage.width(); x++)
<a name="l00165"></a>00165     {
<a name="l00166"></a>00166       <span class="comment">//compute unrotated coordinates</span>
<a name="l00167"></a>00167       xp = cosTheta*(x-w2) + sinTheta*(y-h2) + w2;
<a name="l00168"></a>00168       yp = -sinTheta*(x-w2) + cosTheta*(y-h2) + h2;
<a name="l00169"></a>00169 
<a name="l00170"></a>00170       <span class="comment">//set unrotated value</span>
<a name="l00171"></a>00171       rgb = ((QRgb*)scanLine+x);
<a name="l00172"></a>00172       *rgb = <a class="code" href="tilt_8cpp.html#3f1d83198a2abb32c2a9e8c7bfb4772e">interpolatedPixelValue</a>( xp, yp, &amp;originalImage);
<a name="l00173"></a>00173 
<a name="l00174"></a>00174       <span class="comment">//update status bar if significant progress has been made since last update</span>
<a name="l00175"></a>00175       newProgress++;
<a name="l00176"></a>00176       <span class="keywordflow">if</span>(newProgress &gt;= updateIncrement)
<a name="l00177"></a>00177       {
<a name="l00178"></a>00178         newProgress = 0;
<a name="l00179"></a>00179         status-&gt;<a class="code" href="classStatusWidget.html#de18735223ae40506c32c96b9c9c5476" title="Updates the progress bar by one step.">incrementProgress</a>();
<a name="l00180"></a>00180         qApp-&gt;processEvents();  
<a name="l00181"></a>00181       }
<a name="l00182"></a>00182       
<a name="l00183"></a>00183     }
<a name="l00184"></a>00184   }
<a name="l00185"></a>00185   
<a name="l00186"></a>00186   <span class="comment">//find rotated corners</span>
<a name="l00187"></a>00187   <span class="keywordtype">double</span> nTheta = -theta;
<a name="l00188"></a>00188   <span class="keywordtype">double</span> sinNTheta = sin( nTheta );
<a name="l00189"></a>00189   <span class="keywordtype">double</span> cosNTheta = cos( nTheta );
<a name="l00190"></a>00190   
<a name="l00191"></a>00191   <a class="code" href="classDPoint.html">DPoint</a> <a class="code" href="redEye__internal_8h.html#6a9aebec61b1a6732045c187a6156f4f">topLeft</a> = <a class="code" href="classDPoint.html">DPoint</a>( cosNTheta*(-w2) + sinNTheta*(-h2) + w2,
<a name="l00192"></a>00192                            -sinNTheta*(-w2) + cosNTheta*(-h2) + h2 );
<a name="l00193"></a>00193 
<a name="l00194"></a>00194   <a class="code" href="classDPoint.html">DPoint</a> topRight = <a class="code" href="classDPoint.html">DPoint</a>( cosNTheta*(w2) + sinNTheta*(-h2) + w2,                           
<a name="l00195"></a>00195                             -sinNTheta*(w2) + cosNTheta*(-h2) + h2 );
<a name="l00196"></a>00196   
<a name="l00197"></a>00197   <a class="code" href="classDPoint.html">DPoint</a> bottomLeft = <a class="code" href="classDPoint.html">DPoint</a>( cosNTheta*(-w2) + sinNTheta*(h2) + w2,                           
<a name="l00198"></a>00198                               -sinNTheta*(-w2) + cosNTheta*(h2) + h2 );
<a name="l00199"></a>00199   
<a name="l00200"></a>00200   <a class="code" href="classDPoint.html">DPoint</a> <a class="code" href="redEye__internal_8h.html#75e80edb449bc9a0925be60719132bd0">bottomRight</a> = <a class="code" href="classDPoint.html">DPoint</a>( cosNTheta*(w2) + sinNTheta*(h2) + w2,                           
<a name="l00201"></a>00201                                -sinNTheta*(w2) + cosNTheta*(h2) + h2 );
<a name="l00202"></a>00202   
<a name="l00203"></a>00203   <span class="comment">//determine which of these points are which in their rotated form</span>
<a name="l00204"></a>00204   <a class="code" href="classDPoint.html">DPoint</a> top, bottom, left, right;
<a name="l00205"></a>00205   <span class="keywordflow">if</span>( theta &lt; 0 )
<a name="l00206"></a>00206   {
<a name="l00207"></a>00207     top = topRight;
<a name="l00208"></a>00208     bottom = bottomLeft;
<a name="l00209"></a>00209     left = topLeft;
<a name="l00210"></a>00210     right = bottomRight;
<a name="l00211"></a>00211   }
<a name="l00212"></a>00212   <span class="keywordflow">else</span>
<a name="l00213"></a>00213   {
<a name="l00214"></a>00214     top = topLeft;
<a name="l00215"></a>00215     bottom = bottomRight;    
<a name="l00216"></a>00216     left = bottomLeft;
<a name="l00217"></a>00217     right = topRight;
<a name="l00218"></a>00218   }
<a name="l00219"></a>00219   
<a name="l00220"></a>00220   <span class="comment">//construct true corners</span>
<a name="l00221"></a>00221   <a class="code" href="classDPoint.html">DPoint</a> trueTopLeft    ( 0, 0 );
<a name="l00222"></a>00222   <a class="code" href="classDPoint.html">DPoint</a> trueTopRight   ( rotatedImage.width()-1, 0 );
<a name="l00223"></a>00223   <a class="code" href="classDPoint.html">DPoint</a> trueBottomLeft ( 0, rotatedImage.height()-1 );
<a name="l00224"></a>00224   <a class="code" href="classDPoint.html">DPoint</a> trueBottomRight( rotatedImage.width()-1, rotatedImage.height()-1 );
<a name="l00225"></a>00225   
<a name="l00226"></a>00226   <span class="comment">//find intersections with image boundary</span>
<a name="l00227"></a>00227   <a class="code" href="classDPoint.html">DPoint</a> topEdgeL = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( left, top, trueTopLeft, trueTopRight );
<a name="l00228"></a>00228   <a class="code" href="classDPoint.html">DPoint</a> topEdgeR = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( top, right, trueTopLeft, trueTopRight );
<a name="l00229"></a>00229                                             
<a name="l00230"></a>00230   <a class="code" href="classDPoint.html">DPoint</a> bottomEdgeL = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( left, bottom, trueBottomLeft, trueBottomRight );
<a name="l00231"></a>00231   <a class="code" href="classDPoint.html">DPoint</a> bottomEdgeR = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( bottom, right, trueBottomLeft, trueBottomRight );
<a name="l00232"></a>00232 
<a name="l00233"></a>00233   <a class="code" href="classDPoint.html">DPoint</a> leftEdgeT = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( left, top, trueTopLeft, trueBottomLeft );
<a name="l00234"></a>00234   <a class="code" href="classDPoint.html">DPoint</a> leftEdgeB = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( left, bottom, trueTopLeft, trueBottomLeft );
<a name="l00235"></a>00235     
<a name="l00236"></a>00236   <a class="code" href="classDPoint.html">DPoint</a> rightEdgeT = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( right, top, trueTopRight, trueBottomRight );
<a name="l00237"></a>00237   <a class="code" href="classDPoint.html">DPoint</a> rightEdgeB = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( right, bottom, trueTopRight, trueBottomRight );
<a name="l00238"></a>00238   
<a name="l00239"></a>00239   <span class="comment">//shot rays out from image center to each true corner and find intersections with clipped corners</span>
<a name="l00240"></a>00240   <a class="code" href="classDPoint.html">DPoint</a> center( (<span class="keywordtype">int</span>)w2, (<span class="keywordtype">int</span>)h2 );
<a name="l00241"></a>00241   <a class="code" href="classDPoint.html">DPoint</a> safeTopLeft     = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( center, trueTopLeft, leftEdgeT, topEdgeL );
<a name="l00242"></a>00242   <a class="code" href="classDPoint.html">DPoint</a> safeTopRight    = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( center, trueTopRight, rightEdgeT, topEdgeR );
<a name="l00243"></a>00243   <a class="code" href="classDPoint.html">DPoint</a> safeBottomLeft  = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( center, trueBottomLeft, leftEdgeB, bottomEdgeL );
<a name="l00244"></a>00244   <a class="code" href="classDPoint.html">DPoint</a> safeBottomRight = <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>( center, trueBottomRight, rightEdgeB, bottomEdgeR );
<a name="l00245"></a>00245   
<a name="l00246"></a>00246   <span class="comment">//find constrained area</span>
<a name="l00247"></a>00247   <span class="keywordtype">double</span> minY = QMAX( safeTopLeft.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>(), safeTopRight.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() );
<a name="l00248"></a>00248   <span class="keywordtype">double</span> maxY = QMIN( safeBottomLeft.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>(), safeBottomRight.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() );
<a name="l00249"></a>00249   
<a name="l00250"></a>00250   <span class="keywordtype">double</span> minX = QMAX( safeTopLeft.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>(), safeBottomLeft.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() );
<a name="l00251"></a>00251   <span class="keywordtype">double</span> maxX = QMIN( safeTopRight.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>(), safeBottomRight.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() );
<a name="l00252"></a>00252 
<a name="l00253"></a>00253   <span class="comment">//find contrained area in integer coordinates. this is semi-tricky.</span>
<a name="l00254"></a>00254   <span class="comment">//if the minimum values decimal porition is nonzero then increment by one </span>
<a name="l00255"></a>00255   <span class="comment">// (eg 5.37 -&gt; 6)</span>
<a name="l00256"></a>00256   <span class="keywordtype">int</span> xMin = (int) minX;
<a name="l00257"></a>00257   <span class="keywordtype">int</span> xMax = (int) maxX;
<a name="l00258"></a>00258   
<a name="l00259"></a>00259   <span class="keywordtype">int</span> yMin = (int) minY;
<a name="l00260"></a>00260   <span class="keywordtype">int</span> yMax = (int) maxY;
<a name="l00261"></a>00261   
<a name="l00262"></a>00262   <span class="keywordflow">if</span>( xMin &lt; minX ) xMin++;
<a name="l00263"></a>00263   <span class="keywordflow">if</span>( yMin &lt; minY ) yMin++;
<a name="l00264"></a>00264   
<a name="l00265"></a>00265   <span class="comment">//construct cropped rotated image</span>
<a name="l00266"></a>00266   QImage* <a class="code" href="redEye__internal_8h.html#63116a8b94b4ed0e99ddcb7f6f3bd919">editedImage</a> = <span class="keyword">new</span> QImage( xMax - xMin + 1,
<a name="l00267"></a>00267                                     yMax - yMin + 1,
<a name="l00268"></a>00268                                     rotatedImage.depth() );    
<a name="l00269"></a>00269 
<a name="l00270"></a>00270   <span class="comment">//during the second phase update the status bar for every 1% of cropped pixels that are procesed</span>
<a name="l00271"></a>00271   updateIncrement = (int) ( 0.01 * editedImage-&gt;width() * editedImage-&gt;height() );
<a name="l00272"></a>00272   newProgress = 0;
<a name="l00273"></a>00273   
<a name="l00274"></a>00274   <span class="keywordtype">int</span> x2,y2;
<a name="l00275"></a>00275   uchar* scanLine2;
<a name="l00276"></a>00276   QRgb* rgb2;
<a name="l00277"></a>00277 
<a name="l00278"></a>00278   y2 = 0;
<a name="l00279"></a>00279   <span class="keywordflow">for</span>( y=yMin; y&lt;=yMax; y++, y2++)
<a name="l00280"></a>00280   {   
<a name="l00281"></a>00281     <span class="comment">//iterate over each selected pixel in scanline</span>
<a name="l00282"></a>00282     scanLine = rotatedImage.scanLine(y);
<a name="l00283"></a>00283     scanLine2 = editedImage-&gt;scanLine(y2);
<a name="l00284"></a>00284 
<a name="l00285"></a>00285     x2 = 0;
<a name="l00286"></a>00286     <span class="keywordflow">for</span>( x=xMin; x&lt;=xMax; x++, x2++)
<a name="l00287"></a>00287     {
<a name="l00288"></a>00288       rgb  = ((QRgb*)scanLine +x );
<a name="l00289"></a>00289       rgb2 = ((QRgb*)scanLine2+x2);
<a name="l00290"></a>00290       *rgb2 = *rgb;      
<a name="l00291"></a>00291 
<a name="l00292"></a>00292       <span class="comment">//update status bar if significant progress has been made since last update</span>
<a name="l00293"></a>00293       newProgress++;
<a name="l00294"></a>00294       <span class="keywordflow">if</span>(newProgress &gt;= updateIncrement)
<a name="l00295"></a>00295       {
<a name="l00296"></a>00296         newProgress = 0;
<a name="l00297"></a>00297         status-&gt;<a class="code" href="classStatusWidget.html#de18735223ae40506c32c96b9c9c5476" title="Updates the progress bar by one step.">incrementProgress</a>();
<a name="l00298"></a>00298         qApp-&gt;processEvents();  
<a name="l00299"></a>00299       }
<a name="l00300"></a>00300     
<a name="l00301"></a>00301     }
<a name="l00302"></a>00302   }
<a name="l00303"></a>00303   
<a name="l00304"></a>00304   <span class="comment">//remove status bar</span>
<a name="l00305"></a>00305   status-&gt;<a class="code" href="classStatusWidget.html#02084869ff1c15dab4bc922a49b31808" title="Update message.">setStatus</a>( <span class="stringliteral">""</span> );
<a name="l00306"></a>00306   qApp-&gt;processEvents();  
<a name="l00307"></a>00307   
<a name="l00308"></a>00308   <span class="comment">//return pointer to edited image</span>
<a name="l00309"></a>00309   <span class="keywordflow">return</span> editedImage;
<a name="l00310"></a>00310 }
<a name="l00311"></a>00311 <span class="comment">//==============================================</span>
<a name="l00312"></a><a class="code" href="tilt__internal_8h.html#3f1d83198a2abb32c2a9e8c7bfb4772e">00312</a> QRgb <a class="code" href="tilt_8cpp.html#3f1d83198a2abb32c2a9e8c7bfb4772e">interpolatedPixelValue</a>( <span class="keywordtype">double</span> xp, <span class="keywordtype">double</span> yp,
<a name="l00313"></a>00313                              QImage* image )
<a name="l00314"></a>00314 {
<a name="l00315"></a>00315   <span class="comment">//do boundary checking to </span>
<a name="l00316"></a>00316   <span class="comment">//ensure we don't read beyond image boundaries</span>
<a name="l00317"></a>00317   <span class="keywordflow">if</span>(xp &lt; 0 || xp &gt;= image-&gt;width() ||
<a name="l00318"></a>00318      yp &lt; 0 || yp &gt;= image-&gt;height() )
<a name="l00319"></a>00319     <span class="keywordflow">return</span> qRgb( 0, 0, 0 );
<a name="l00320"></a>00320 
<a name="l00321"></a>00321   <span class="comment">//get four pixel colors, </span>
<a name="l00322"></a>00322   <span class="keywordtype">int</span> x = (int)xp;
<a name="l00323"></a>00323   <span class="keywordtype">int</span> y = (int)yp;
<a name="l00324"></a>00324   
<a name="l00325"></a>00325   uchar* scanLine1 = image-&gt;scanLine( y );
<a name="l00326"></a>00326 
<a name="l00327"></a>00327   uchar* scanLine2;
<a name="l00328"></a>00328   <span class="keywordflow">if</span>( y &lt; image-&gt;<a class="code" href="blur_8cpp.html#d12fc34ce789bce6c8a05d8a17138534">height</a>() - 1 )
<a name="l00329"></a>00329     scanLine2 = image-&gt;scanLine( y+1 );
<a name="l00330"></a>00330   <span class="keywordflow">else</span>
<a name="l00331"></a>00331     scanLine2 = scanLine1;
<a name="l00332"></a>00332   
<a name="l00333"></a>00333   QRgb p1,p2,p3,p4;
<a name="l00334"></a>00334   
<a name="l00335"></a>00335   p1 = *((QRgb*)scanLine1+x);
<a name="l00336"></a>00336   p3 = *((QRgb*)scanLine2+x);
<a name="l00337"></a>00337         
<a name="l00338"></a>00338   <span class="keywordflow">if</span>( x &lt; image-&gt;<a class="code" href="blur_8cpp.html#2474a5474cbff19523a51eb1de01cda4">width</a>() - 1)
<a name="l00339"></a>00339   {
<a name="l00340"></a>00340     p2 = *((QRgb*)scanLine1+x+1);
<a name="l00341"></a>00341     p4 = *((QRgb*)scanLine2+x+1);     
<a name="l00342"></a>00342   }
<a name="l00343"></a>00343   <span class="keywordflow">else</span>
<a name="l00344"></a>00344   {
<a name="l00345"></a>00345     p2 = p1;
<a name="l00346"></a>00346     p4 = p3;
<a name="l00347"></a>00347   }
<a name="l00348"></a>00348   
<a name="l00349"></a>00349   <span class="comment">//blend four colors</span>
<a name="l00350"></a>00350   <span class="keywordtype">double</span> alphaY = yp - y;
<a name="l00351"></a>00351   <span class="keywordtype">double</span> alphaX = xp - x;
<a name="l00352"></a>00352   
<a name="l00353"></a>00353   p1 = <a class="code" href="tilt_8cpp.html#fff3aa2df7d0a8ed1d7f5929e34eed60">blendColors</a>( p1, p2, alphaX );
<a name="l00354"></a>00354   p3 = <a class="code" href="tilt_8cpp.html#fff3aa2df7d0a8ed1d7f5929e34eed60">blendColors</a>( p3, p4, alphaX );
<a name="l00355"></a>00355   p1 = <a class="code" href="tilt_8cpp.html#fff3aa2df7d0a8ed1d7f5929e34eed60">blendColors</a>( p1, p3, alphaY );
<a name="l00356"></a>00356   <span class="keywordflow">return</span> p1;
<a name="l00357"></a>00357 }
<a name="l00358"></a>00358 <span class="comment">//==============================================</span>
<a name="l00359"></a><a class="code" href="tilt__internal_8h.html#fff3aa2df7d0a8ed1d7f5929e34eed60">00359</a> QRgb <a class="code" href="tilt_8cpp.html#fff3aa2df7d0a8ed1d7f5929e34eed60">blendColors</a>( QRgb color1, QRgb color2, <span class="keywordtype">double</span> alpha )
<a name="l00360"></a>00360 {
<a name="l00361"></a>00361   <span class="keywordtype">double</span> alpha2 = 1.0-alpha;
<a name="l00362"></a>00362   <span class="keywordflow">return</span> qRgb( (<span class="keywordtype">int</span>) QMAX( QMIN( 255, alpha2*qRed  (color1) + alpha*qRed(color2)   ), 0 ),
<a name="l00363"></a>00363                (<span class="keywordtype">int</span>) QMAX( QMIN( 255, alpha2*qGreen(color1) + alpha*qGreen(color2) ), 0 ),
<a name="l00364"></a>00364                (<span class="keywordtype">int</span>) QMAX( QMIN( 255, alpha2*qBlue (color1) + alpha*qBlue(color2)  ), 0 ) );
<a name="l00365"></a>00365 }
<a name="l00366"></a>00366 <span class="comment">//==============================================</span>
<a name="l00367"></a><a class="code" href="tilt__internal_8h.html#64cdd4694c2d057ef599ab1360ff62c1">00367</a> <a class="code" href="classDPoint.html">DPoint</a> <a class="code" href="tilt_8cpp.html#64cdd4694c2d057ef599ab1360ff62c1">findTwoLineIntersection</a>(<a class="code" href="classDPoint.html">DPoint</a> p1, <a class="code" href="classDPoint.html">DPoint</a> p2,
<a name="l00368"></a>00368                                <a class="code" href="classDPoint.html">DPoint</a> p3, <a class="code" href="classDPoint.html">DPoint</a> p4)
<a name="l00369"></a>00369 {
<a name="l00370"></a>00370   <span class="comment">//----------------------------------------------</span>
<a name="l00371"></a>00371   <span class="comment">//=== Case 1: neither line has a change in X ===</span>
<a name="l00372"></a>00372   <span class="comment">//----------------------------------------------</span>
<a name="l00373"></a>00373   <span class="comment">//If there is no change in x for both lines, </span>
<a name="l00374"></a>00374   <span class="comment">//either lines will NEVER or ALWAYS intersect.</span>
<a name="l00375"></a>00375   <span class="keywordflow">if</span>(p1.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() == p2.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() &amp;&amp;
<a name="l00376"></a>00376      p4.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() == p3.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>())
<a name="l00377"></a>00377   {
<a name="l00378"></a>00378     <span class="comment">//Ok, if their x values are equal, return </span>
<a name="l00379"></a>00379     <span class="comment">//intersection point as line A's point A.</span>
<a name="l00380"></a>00380     <span class="comment">//Yes, this is a little arbitratry. But </span>
<a name="l00381"></a>00381     <span class="comment">//theoreticaly this section of code will almost</span>
<a name="l00382"></a>00382     <span class="comment">//never be executed.</span>
<a name="l00383"></a>00383     <span class="keywordflow">if</span>( p1.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() == p3.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() )
<a name="l00384"></a>00384     { <span class="keywordflow">return</span> <a class="code" href="classDPoint.html">DPoint</a>( p1.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>(), p1.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() ); }
<a name="l00385"></a>00385     <span class="comment">//Else lines will never intersect,</span>
<a name="l00386"></a>00386     <span class="comment">//return pair (-32000,-32000)</span>
<a name="l00387"></a>00387     <span class="keywordflow">else</span>
<a name="l00388"></a>00388     { <span class="keywordflow">return</span> <a class="code" href="classDPoint.html">DPoint</a>( -32000, -32000 ); }
<a name="l00389"></a>00389   } 
<a name="l00390"></a>00390   <span class="comment">//----------------------------------------------</span>
<a name="l00391"></a>00391   <span class="comment">//Else, we know at least one of the lines </span>
<a name="l00392"></a>00392   <span class="comment">//does NOT have a slope of infinity!!!</span>
<a name="l00393"></a>00393   <span class="comment">//----------------------------------------------</span>
<a name="l00394"></a>00394   
<a name="l00395"></a>00395   <span class="comment">//----------------------------------------------</span>
<a name="l00396"></a>00396   <span class="comment">//=== Case 2: line A has no change in X      ===</span>
<a name="l00397"></a>00397   <span class="comment">//----------------------------------------------</span>
<a name="l00398"></a>00398   <span class="comment">//If line A has an infinite slope (no change in x)</span>
<a name="l00399"></a>00399   <span class="comment">//we know line B does not have an infinite slope...</span>
<a name="l00400"></a>00400   <span class="keywordflow">else</span> <span class="keywordflow">if</span>( p1.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() == p2.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() )
<a name="l00401"></a>00401   {
<a name="l00402"></a>00402     <span class="keywordtype">double</span> slopeB = ((double) (p4.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() - p3.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>()) ) / (p4.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() - p3.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>());
<a name="l00403"></a>00403     
<a name="l00404"></a>00404     <span class="keywordtype">double</span> yInterceptB = p3.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() - slopeB*p3.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>();
<a name="l00405"></a>00405     
<a name="l00406"></a>00406     <span class="comment">//y = mx+b</span>
<a name="l00407"></a>00407     <span class="keywordflow">return</span> <a class="code" href="classDPoint.html">DPoint</a>( p2.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>(), slopeB*p2.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() + yInterceptB );
<a name="l00408"></a>00408   }
<a name="l00409"></a>00409   <span class="comment">//----------------------------------------------</span>
<a name="l00410"></a>00410   <span class="comment">//=== Case 3: line B has no change in X      ===</span>
<a name="l00411"></a>00411   <span class="comment">//----------------------------------------------</span>
<a name="l00412"></a>00412   <span class="comment">//If line B has an infinite slope (no change in x)</span>
<a name="l00413"></a>00413   <span class="comment">//we know line A does not have an infinite slope...</span>
<a name="l00414"></a>00414   <span class="keywordflow">else</span> <span class="keywordflow">if</span>( p4.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() == p3.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() )
<a name="l00415"></a>00415   {
<a name="l00416"></a>00416     <span class="keywordtype">double</span> slopeA = ((double) (p2.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() - p1.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>()) ) / (p2.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() - p1.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>());
<a name="l00417"></a>00417     
<a name="l00418"></a>00418     <span class="keywordtype">double</span> yInterceptA = p1.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() - slopeA*p1.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>();
<a name="l00419"></a>00419     
<a name="l00420"></a>00420     <span class="comment">//y = mx+b</span>
<a name="l00421"></a>00421     <span class="keywordflow">return</span> <a class="code" href="classDPoint.html">DPoint</a>( p4.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>(), slopeA*p4.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() + yInterceptA );
<a name="l00422"></a>00422   }
<a name="l00423"></a>00423   <span class="comment">//----------------------------------------------</span>
<a name="l00424"></a>00424   <span class="comment">//=== Case 4: both lines have non infinite slopes ===</span>
<a name="l00425"></a>00425   <span class="comment">//----------------------------------------------</span>
<a name="l00426"></a>00426   <span class="keywordflow">else</span>
<a name="l00427"></a>00427   {
<a name="l00428"></a>00428     <span class="keywordtype">double</span> slopeA = ((double) (p2.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() - p1.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>()) ) / (p2.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() - p1.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>());
<a name="l00429"></a>00429     <span class="keywordtype">double</span> slopeB = ((double) (p4.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() - p3.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>()) ) / (p4.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>() - p3.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>());
<a name="l00430"></a>00430     <span class="keywordtype">double</span> yInterceptA = p1.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() - slopeA*p1.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>();
<a name="l00431"></a>00431     <span class="keywordtype">double</span> yInterceptB = p3.<a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">y</a>() - slopeB*p3.<a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">x</a>();
<a name="l00432"></a>00432     
<a name="l00433"></a>00433     <span class="comment">//y1 = mx1+b</span>
<a name="l00434"></a>00434     <span class="comment">//y2 = nx2+c</span>
<a name="l00435"></a>00435     <span class="comment">//at intersection y1=y2 and x1 = x2 so...</span>
<a name="l00436"></a>00436     <span class="comment">//mx +b = nx + c</span>
<a name="l00437"></a>00437     <span class="comment">//x(m-n) = c-b</span>
<a name="l00438"></a>00438     <span class="comment">//x = (c-b)/(m-n)</span>
<a name="l00439"></a>00439     <span class="comment">//where m and n are slope and</span>
<a name="l00440"></a>00440     <span class="comment">//b and c are y-intercepts.</span>
<a name="l00441"></a>00441     <span class="comment">//x = (c-b)/(m-n)</span>
<a name="l00442"></a>00442     <span class="keywordtype">double</span> x = (yInterceptB - yInterceptA) / (slopeA - slopeB);
<a name="l00443"></a>00443     <span class="keywordflow">return</span> <a class="code" href="classDPoint.html">DPoint</a>( x, (slopeA * x) + yInterceptA );
<a name="l00444"></a>00444   }
<a name="l00445"></a>00445 }
<a name="l00446"></a>00446 <span class="comment">//==============================================</span>
<a name="l00447"></a><a class="code" href="classDPoint.html#761b61bb76bc69b33c799d7cbf7568f4">00447</a> <a class="code" href="classDPoint.html#761b61bb76bc69b33c799d7cbf7568f4">DPoint::DPoint</a>()
<a name="l00448"></a>00448 { <a class="code" href="classDPoint.html#85595342347f5756d820bed59079c679">xpos</a>=0; <a class="code" href="classDPoint.html#65761a5432a3e9ed011752f3ae70b9c7">ypos</a>=0; }
<a name="l00449"></a>00449 <span class="comment">//==============================================</span>
<a name="l00450"></a><a class="code" href="classDPoint.html#1e261225a50e3ac3bbe63875e727a1fd">00450</a> <a class="code" href="classDPoint.html#761b61bb76bc69b33c799d7cbf7568f4">DPoint::DPoint</a>( <span class="keywordtype">double</span> x, <span class="keywordtype">double</span> y )
<a name="l00451"></a>00451 {
<a name="l00452"></a>00452   this-&gt;<a class="code" href="classDPoint.html#85595342347f5756d820bed59079c679">xpos</a> = x;
<a name="l00453"></a>00453   this-&gt;<a class="code" href="classDPoint.html#65761a5432a3e9ed011752f3ae70b9c7">ypos</a> = y;
<a name="l00454"></a>00454 }
<a name="l00455"></a>00455 <span class="comment">//==============================================</span>
<a name="l00456"></a><a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">00456</a> <span class="keywordtype">double</span> <a class="code" href="classDPoint.html#77c659dcf610ea320fd46ab7bf338851">DPoint::x</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classDPoint.html#85595342347f5756d820bed59079c679">xpos</a>; }
<a name="l00457"></a><a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">00457</a> <span class="keywordtype">double</span> <a class="code" href="classDPoint.html#fefa46a0d128b45349fe6b05526205ad">DPoint::y</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classDPoint.html#65761a5432a3e9ed011752f3ae70b9c7">ypos</a>; }
<a name="l00458"></a>00458 <span class="comment">//==============================================</span>
<a name="l00459"></a>00459 
<a name="l00460"></a>00460 
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Aug 23 02:34:28 2009 for AlbumShaper by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>