<!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>AlbumShaper: histogramInterface.h 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.6.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main 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 List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>histogramInterface.h</h1><a href="histogramInterface_8h.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="preprocessor">#ifndef GUI_EDITING_HISTOGRAMINTERFACE_H</span> <a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define GUI_EDITING_HISTOGRAMINTERFACE_H</span> <a name="l00013"></a>00013 <span class="preprocessor"></span> <a name="l00014"></a>00014 <span class="comment">//--------------------</span> <a name="l00015"></a>00015 <span class="comment">//forward declarations</span> <a name="l00016"></a>00016 <span class="comment">//--------------------</span> <a name="l00017"></a>00017 <a name="l00018"></a>00018 <span class="preprocessor">#include <qwidget.h></span> <a name="l00019"></a>00019 <a name="l00021"></a><a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8c">00021</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00022"></a>00022 { <a name="l00023"></a><a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8ca5541521f58ed91756b07fbc0df85137b">00023</a> <a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8ca5541521f58ed91756b07fbc0df85137b">LUMINOSITY</a>, <a name="l00024"></a><a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8caf80f9a890089d211842d59625e561f88">00024</a> <a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8caf80f9a890089d211842d59625e561f88">RED</a>, <a name="l00025"></a><a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8caa60bd322f93178d68184e30e162571ca">00025</a> <a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8caa60bd322f93178d68184e30e162571ca">GREEN</a>, <a name="l00026"></a><a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8ca35d6719cb4d7577c031b3d79057a1b79">00026</a> <a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8ca35d6719cb4d7577c031b3d79057a1b79">BLUE</a>, <a name="l00027"></a>00027 } <a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8c" title="chanel histogram displays">DISPLAYED_CHANNEL</a>; <a name="l00028"></a>00028 <a name="l00030"></a><a class="code" href="histogramInterface_8h.html#a4d26b3730bd5b62a87de6a6b062cc88a">00030</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00031"></a>00031 { <a name="l00032"></a><a class="code" href="histogramInterface_8h.html#a4d26b3730bd5b62a87de6a6b062cc88aa52e3d57e4410a3f781e113a401378c42">00032</a> <a class="code" href="histogramInterface_8h.html#a4d26b3730bd5b62a87de6a6b062cc88aa52e3d57e4410a3f781e113a401378c42">DRAG</a>, <a name="l00033"></a><a class="code" href="histogramInterface_8h.html#a4d26b3730bd5b62a87de6a6b062cc88aa548126d587d43d3630c45cd091e095f7">00033</a> <a class="code" href="histogramInterface_8h.html#a4d26b3730bd5b62a87de6a6b062cc88aa548126d587d43d3630c45cd091e095f7">NO_EFFECT</a> <a name="l00034"></a>00034 } <a class="code" href="histogramInterface_8h.html#a4d26b3730bd5b62a87de6a6b062cc88a" title="current drag mode, effect of mouse movement on selected range">DRAG_MODE</a>; <a name="l00035"></a>00035 <a name="l00036"></a>00036 <span class="comment">//=====================================</span> <a name="l00039"></a>00039 <span class="comment"></span><span class="comment">//=====================================</span> <a name="l00040"></a><a class="code" href="classHistogramInterface.html">00040</a> <span class="keyword">class </span><a class="code" href="classHistogramInterface.html">HistogramInterface</a> : <span class="keyword">public</span> <a class="code" href="classQWidget.html">QWidget</a> <a name="l00041"></a>00041 { <a name="l00042"></a>00042 Q_OBJECT <a name="l00043"></a>00043 <a name="l00044"></a>00044 <span class="keyword">public</span>: <a name="l00046"></a>00046 <a class="code" href="classHistogramInterface.html#a3fee62be6f7fc87cde10b9d6712095ce" title="Creates layout.">HistogramInterface</a>( QString imageFilename, <a name="l00047"></a>00047 <a class="code" href="classQWidget.html">QWidget</a> *parent=0, <a name="l00048"></a>00048 <span class="keyword">const</span> <span class="keywordtype">char</span>* name=0); <a name="l00049"></a>00049 <a name="l00051"></a>00051 <a class="code" href="classHistogramInterface.html#ac9a373a0d136a0651a6f2df94499966e" title="Deletes objects.">~HistogramInterface</a>(); <a name="l00052"></a>00052 <a name="l00054"></a>00054 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#a84ee87d1cc494c965375266d24adfd85" title="Sets currently displayed channel.">setDisplayChannel</a>( <a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8c" title="chanel histogram displays">DISPLAYED_CHANNEL</a> channel ); <a name="l00055"></a>00055 <a name="l00056"></a>00056 <span class="keyword">virtual</span> QSize <a class="code" href="classHistogramInterface.html#a0b98858f3eaa3c3070f6780d4b940804">minimumSizeHint</a>() <span class="keyword">const</span>; <a name="l00057"></a>00057 <a name="l00059"></a>00059 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#ace352a748cf063b12cd22d54f1460680" title="returns histogram boundaries">getHistBoundaries</a>(<span class="keywordtype">int</span> &lumLeft, <span class="keywordtype">int</span> &lumRight, <a name="l00060"></a>00060 <span class="keywordtype">int</span> &redLeft, <span class="keywordtype">int</span> &redRight, <a name="l00061"></a>00061 <span class="keywordtype">int</span> &greenLeft, <span class="keywordtype">int</span> &greenRight, <a name="l00062"></a>00062 <span class="keywordtype">int</span> &blueLeft, <span class="keywordtype">int</span> &blueRight); <a name="l00063"></a>00063 <a name="l00065"></a>00065 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#aa50e91749fffe828524ae0248f66b4d5" title="resets all boundaries">resetBoundaries</a>(); <a name="l00066"></a>00066 <span class="comment">//----------------------</span> <a name="l00067"></a>00067 <span class="keyword">protected</span>: <a name="l00068"></a>00068 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#afd5ec9e9e4e2fa256164ddbe36f01f15">paintEvent</a>( QPaintEvent *e); <a name="l00069"></a>00069 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#a63f3252bd55b3c14da690121d76e5522">resizeEvent</a>( QResizeEvent * ); <a name="l00070"></a>00070 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#a0aefec0585b0ec72bc61a05b507852a7">mousePressEvent</a>( QMouseEvent *e); <a name="l00071"></a>00071 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#ab22bac6176967caa35e8abbbf16835ae">mouseReleaseEvent</a>( QMouseEvent *); <a name="l00072"></a>00072 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#a767286c2880017f9c6d5569ab645d2e4">mouseMoveEvent</a>( QMouseEvent *e); <a name="l00073"></a>00073 <span class="comment">//----------------------</span> <a name="l00074"></a>00074 signals: <a name="l00075"></a>00075 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#a1440b03a986614e68d1656e7be9458ef">selectedRangeChanged</a>(); <a name="l00076"></a>00076 <span class="comment">//---------------------- </span> <a name="l00077"></a>00077 <span class="keyword">private</span> slots: <a name="l00078"></a>00078 <span class="comment">//selects entire range of current channel</span> <a name="l00079"></a>00079 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#ad0d7771f807788e772d3fa44b9d071c3">selectAll</a>(); <a name="l00080"></a>00080 <span class="comment">//----------------------</span> <a name="l00081"></a>00081 <span class="keyword">private</span>: <a name="l00083"></a>00083 <span class="keywordtype">void</span> <a class="code" href="classHistogramInterface.html#ab8fcdebab7917f3725ac3a67b1386f68" title="this utility function finds currently selected range">getSelectedRange</a>( <span class="keywordtype">int</span> &left, <span class="keywordtype">int</span> &right ); <a name="l00084"></a>00084 <a name="l00086"></a>00086 <span class="keywordtype">double</span> <a class="code" href="classHistogramInterface.html#a84b7e990d4dbbb974daff7ab3e1b9784" title="convert screen coordinate to index in 0-255 range">displayToIndex</a>(<span class="keywordtype">int</span> val); <a name="l00087"></a>00087 <a name="l00089"></a>00089 <span class="keywordtype">int</span> <a class="code" href="classHistogramInterface.html#a99a2daa291c70090c5a97c0d5afe81d1" title="converts index in 0-255 ranges to screen coordinate">indexToDisplay</a>(<span class="keywordtype">int</span> val); <a name="l00090"></a>00090 <a name="l00092"></a>00092 <span class="keywordtype">bool</span> <a class="code" href="classHistogramInterface.html#a3de7a7717a5dcec4a5f30804a93ac42c" title="determines if mouse is near boundary">nearBoundary</a>( QPoint p ); <a name="l00093"></a>00093 <a name="l00095"></a><a class="code" href="classHistogramInterface.html#a005d412a06b0a721550ad2e6771472ad">00095</a> <a class="code" href="histogramInterface_8h.html#a435afa8a7ae5dd59e451491c9e221c8c" title="chanel histogram displays">DISPLAYED_CHANNEL</a> <a class="code" href="classHistogramInterface.html#a005d412a06b0a721550ad2e6771472ad" title="Currently displayed channel.">displayedChannel</a>; <a name="l00096"></a>00096 <a name="l00098"></a><a class="code" href="classHistogramInterface.html#a264a35c05cd4a2a07a788eddc59fb1c9">00098</a> <span class="keywordtype">int</span> <a class="code" href="classHistogramInterface.html#a264a35c05cd4a2a07a788eddc59fb1c9" title="color and luminosity histograms">redVals</a>[256]; <a name="l00099"></a><a class="code" href="classHistogramInterface.html#aea8d7c5b0ef52e4830f254733e3c65c8">00099</a> <span class="keywordtype">int</span> <a class="code" href="classHistogramInterface.html#aea8d7c5b0ef52e4830f254733e3c65c8">greenVals</a>[256]; <a name="l00100"></a><a class="code" href="classHistogramInterface.html#adea84cd738a840ded8460c4ad3154414">00100</a> <span class="keywordtype">int</span> <a class="code" href="classHistogramInterface.html#adea84cd738a840ded8460c4ad3154414">blueVals</a>[256]; <a name="l00101"></a><a class="code" href="classHistogramInterface.html#a9ba8f2a0167eaf22e8547cc5f417a0c0">00101</a> <span class="keywordtype">int</span> <a class="code" href="classHistogramInterface.html#a9ba8f2a0167eaf22e8547cc5f417a0c0">grayVals</a>[256]; <a name="l00102"></a>00102 <a name="l00104"></a><a class="code" href="classHistogramInterface.html#ac121590b892cb920b6260d220b84fae7">00104</a> <span class="keywordtype">int</span> <a class="code" href="classHistogramInterface.html#ac121590b892cb920b6260d220b84fae7" title="max r,g,b, and gray counts">maxRcount</a>, <a class="code" href="classHistogramInterface.html#a03b8ff199cfe546459b6894e87eb4bc6">maxGcount</a>, <a class="code" href="classHistogramInterface.html#a8ca76cbbcb85f7a598c249b2c5df70d9">maxBcount</a>, <a class="code" href="classHistogramInterface.html#a002f958b7305f8d1f55a4c1112306b18">maxGRAYcount</a>; <a name="l00105"></a>00105 <a name="l00107"></a><a class="code" href="classHistogramInterface.html#a23ba1cfd72013e546982553419763aac">00107</a> <span class="keywordtype">int</span> <a class="code" href="classHistogramInterface.html#af3fc052e8ec7735210cbe0fe94b7c248" title="left and right bounds for each channel">lumClick</a>, <a class="code" href="classHistogramInterface.html#a23ba1cfd72013e546982553419763aac">lumDrag</a>; <a name="l00108"></a><a class="code" href="classHistogramInterface.html#a9926622cab9d0479639fe0b3ea48dece">00108</a> <span class="keywordtype">int</span> <a class="code" href="classHistogramInterface.html#abb0fff71ccb28404c55975e441880fbd">redClick</a>, <a class="code" href="classHistogramInterface.html#a9926622cab9d0479639fe0b3ea48dece">redDrag</a>; <a name="l00109"></a><a class="code" href="classHistogramInterface.html#a58a584d1a02a5fd39540bd513a1c9ef4">00109</a> <span class="keywordtype">int</span> <a class="code" href="classHistogramInterface.html#a64b0c0b295c4c3c8ccfb0ddf64e06350">greenClick</a>, <a class="code" href="classHistogramInterface.html#a58a584d1a02a5fd39540bd513a1c9ef4">greenDrag</a>; <a name="l00110"></a><a class="code" href="classHistogramInterface.html#aab53e01ee86860b86d0fad0ecd8a2a00">00110</a> <span class="keywordtype">int</span> <a class="code" href="classHistogramInterface.html#a75e62e75624002bbfa0618d5568ba5a2">blueClick</a>, <a class="code" href="classHistogramInterface.html#aab53e01ee86860b86d0fad0ecd8a2a00">blueDrag</a>; <a name="l00111"></a>00111 <a name="l00113"></a><a class="code" href="classHistogramInterface.html#a3d00d362e2f88b7ecc9c91cd4a6501f8">00113</a> QSize <a class="code" href="classHistogramInterface.html#a3d00d362e2f88b7ecc9c91cd4a6501f8" title="original image dimensions, needed for painting">origImageSize</a>; <a name="l00114"></a>00114 <a name="l00116"></a><a class="code" href="classHistogramInterface.html#a7c74c0c3c02444b6ff4b3b5c9608514a">00116</a> <a class="code" href="histogramInterface_8h.html#a4d26b3730bd5b62a87de6a6b062cc88a" title="current drag mode, effect of mouse movement on selected range">DRAG_MODE</a> <a class="code" href="classHistogramInterface.html#a7c74c0c3c02444b6ff4b3b5c9608514a" title="effect of mouse drags">dragMode</a>; <a name="l00117"></a>00117 <a name="l00120"></a><a class="code" href="classHistogramInterface.html#a8e91960530b360d49fbe0a94a0090f88">00120</a> <a class="code" href="histogramInterface_8h.html#a4d26b3730bd5b62a87de6a6b062cc88a" title="current drag mode, effect of mouse movement on selected range">DRAG_MODE</a> <a class="code" href="classHistogramInterface.html#a8e91960530b360d49fbe0a94a0090f88" title="current mouse shape.">currentMouseShape</a>; <a name="l00121"></a>00121 <span class="comment">//----------------------</span> <a name="l00122"></a>00122 }; <a name="l00123"></a>00123 <span class="comment">//======================</span> <a name="l00124"></a>00124 <a name="l00125"></a>00125 <span class="preprocessor">#endif //GUI_EDITING_HISTOGRAMINTERFACE_H</span> </pre></div></div> <hr size="1"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> </body> </html>