Current Path : /usr/local/share/doc/ImageMagick/www/api/MagickCore/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/local/share/doc/ImageMagick/www/api/MagickCore/quantum_8h-source.html |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>MagickCore: quantum.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.4 --> <div class="nav"> <a class="el" href="dir_b44b349db36f8365f5234e57d3038770.html">magick</a></div> <h1>quantum.h</h1><a href="quantum_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 1999-2009 ImageMagick Studio LLC, a non-profit organization</span> <a name="l00003"></a>00003 <span class="comment"> dedicated to making software imaging solutions freely available.</span> <a name="l00004"></a>00004 <span class="comment"></span> <a name="l00005"></a>00005 <span class="comment"> You may not use this file except in compliance with the License.</span> <a name="l00006"></a>00006 <span class="comment"> obtain a copy of the License at</span> <a name="l00007"></a>00007 <span class="comment"></span> <a name="l00008"></a>00008 <span class="comment"> http://www.imagemagick.org/script/license.php</span> <a name="l00009"></a>00009 <span class="comment"></span> <a name="l00010"></a>00010 <span class="comment"> Unless required by applicable law or agreed to in writing, software</span> <a name="l00011"></a>00011 <span class="comment"> distributed under the License is distributed on an "AS IS" BASIS,</span> <a name="l00012"></a>00012 <span class="comment"> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span> <a name="l00013"></a>00013 <span class="comment"> See the License for the specific language governing permissions and</span> <a name="l00014"></a>00014 <span class="comment"> limitations under the License.</span> <a name="l00015"></a>00015 <span class="comment"></span> <a name="l00016"></a>00016 <span class="comment"> MagickCore quantum inline methods.</span> <a name="l00017"></a>00017 <span class="comment">*/</span> <a name="l00018"></a>00018 <span class="preprocessor">#ifndef _MAGICKCORE_QUANTUM_H</span> <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define _MAGICKCORE_QUANTUM_H</span> <a name="l00020"></a>00020 <span class="preprocessor"></span> <a name="l00021"></a>00021 <span class="preprocessor">#if defined(__cplusplus) || defined(c_plusplus)</span> <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { <a name="l00023"></a>00023 <span class="preprocessor">#endif</span> <a name="l00024"></a>00024 <span class="preprocessor"></span> <a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="semaphore_8h.html">magick/semaphore.h</a>"</span> <a name="l00026"></a>00026 <a name="l00027"></a><a class="code" href="quantum_8h.html#d3f8cd9685608d762e24f72b8858bdfb">00027</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00028"></a>00028 { <a name="l00029"></a><a class="code" href="quantum_8h.html#d3f8cd9685608d762e24f72b8858bdfbe1a3850586ace67deb4891ca2363a64d">00029</a> <a class="code" href="quantum_8h.html#d3f8cd9685608d762e24f72b8858bdfbe1a3850586ace67deb4891ca2363a64d">UndefinedEndian</a>, <a name="l00030"></a><a class="code" href="quantum_8h.html#d3f8cd9685608d762e24f72b8858bdfb152951d340d9d7b300b7fc8ee679af72">00030</a> <a class="code" href="quantum_8h.html#d3f8cd9685608d762e24f72b8858bdfb152951d340d9d7b300b7fc8ee679af72">LSBEndian</a>, <a name="l00031"></a><a class="code" href="quantum_8h.html#d3f8cd9685608d762e24f72b8858bdfb08ec793a4edab87b1c849c15f1122af2">00031</a> <a class="code" href="quantum_8h.html#d3f8cd9685608d762e24f72b8858bdfb08ec793a4edab87b1c849c15f1122af2">MSBEndian</a> <a name="l00032"></a>00032 } <a class="code" href="quantum_8h.html#d3f8cd9685608d762e24f72b8858bdfb">EndianType</a>; <a name="l00033"></a>00033 <a name="l00034"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd">00034</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00035"></a>00035 { <a name="l00036"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bda42e282da30a012c77232dc00b87f9c5">00036</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bda42e282da30a012c77232dc00b87f9c5">UndefinedQuantum</a>, <a name="l00037"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd1024b67e9850ac3cd0ea86cd1d242825">00037</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd1024b67e9850ac3cd0ea86cd1d242825">AlphaQuantum</a>, <a name="l00038"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd9148de80825115222b19155d0241cdda">00038</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd9148de80825115222b19155d0241cdda">BlackQuantum</a>, <a name="l00039"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bdfc33d8e8e46230219d561b2b9d65f9ee">00039</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bdfc33d8e8e46230219d561b2b9d65f9ee">BlueQuantum</a>, <a name="l00040"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd357a5daee5ef6a5c7b62672b55eeb1ba">00040</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd357a5daee5ef6a5c7b62672b55eeb1ba">CMYKAQuantum</a>, <a name="l00041"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bdd25116931859c12450a399b3b0e8fdc2">00041</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bdd25116931859c12450a399b3b0e8fdc2">CMYKQuantum</a>, <a name="l00042"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd21fa240b8fd3272a95acea97839ad530">00042</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd21fa240b8fd3272a95acea97839ad530">CyanQuantum</a>, <a name="l00043"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd1535ec9cbe35f399c053c7423d3f96c7">00043</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd1535ec9cbe35f399c053c7423d3f96c7">GrayAlphaQuantum</a>, <a name="l00044"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd8ace128318ff57fea5dccae772bc8a83">00044</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd8ace128318ff57fea5dccae772bc8a83">GrayQuantum</a>, <a name="l00045"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bdc281a50a0cfb85f6375610fd1243b567">00045</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bdc281a50a0cfb85f6375610fd1243b567">GreenQuantum</a>, <a name="l00046"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd9a10df886f14a69d3b4abdd9730de00a">00046</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd9a10df886f14a69d3b4abdd9730de00a">IndexAlphaQuantum</a>, <a name="l00047"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd13609de4fcc867e812006f71fa402882">00047</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd13609de4fcc867e812006f71fa402882">IndexQuantum</a>, <a name="l00048"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd0a95ca4cb261386bdb3e09b84efe2065">00048</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd0a95ca4cb261386bdb3e09b84efe2065">MagentaQuantum</a>, <a name="l00049"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd016a3468d44b60b0e28e36ab6708a175">00049</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd016a3468d44b60b0e28e36ab6708a175">OpacityQuantum</a>, <a name="l00050"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd98da276673ccf605817fb04d83889581">00050</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd98da276673ccf605817fb04d83889581">RedQuantum</a>, <a name="l00051"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd5a66c3ef3aa5bd909d663bf4db081a29">00051</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd5a66c3ef3aa5bd909d663bf4db081a29">RGBAQuantum</a>, <a name="l00052"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bdec3c839991fce33d0406a8a5cd18df4e">00052</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bdec3c839991fce33d0406a8a5cd18df4e">RGBOQuantum</a>, <a name="l00053"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd638375fc7dd5278b9dec031396838111">00053</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd638375fc7dd5278b9dec031396838111">RGBQuantum</a>, <a name="l00054"></a><a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bde43df0236dd62c1535d78624ba9e0578">00054</a> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bde43df0236dd62c1535d78624ba9e0578">YellowQuantum</a> <a name="l00055"></a>00055 } <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd">QuantumType</a>; <a name="l00056"></a>00056 <a name="l00057"></a><a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeea">00057</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00058"></a>00058 { <a name="l00059"></a><a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeea8dd83bd411e37d3c72d33e5d00c9c95e">00059</a> <a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeea8dd83bd411e37d3c72d33e5d00c9c95e">UndefinedQuantumFormat</a>, <a name="l00060"></a><a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeeaad11c60ed3d2cf5eac0fa2499aa2106f">00060</a> <a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeeaad11c60ed3d2cf5eac0fa2499aa2106f">FloatingPointQuantumFormat</a>, <a name="l00061"></a><a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeea98166438dc58481166f8da7dea70c2ea">00061</a> <a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeea98166438dc58481166f8da7dea70c2ea">SignedQuantumFormat</a>, <a name="l00062"></a><a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeea30c90ef14bcc4f84c91a9f1344519f5b">00062</a> <a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeea30c90ef14bcc4f84c91a9f1344519f5b">UnsignedQuantumFormat</a> <a name="l00063"></a>00063 } <a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeea">QuantumFormatType</a>; <a name="l00064"></a>00064 <a name="l00065"></a><a class="code" href="struct__QuantumInfo.html">00065</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__QuantumInfo.html">_QuantumInfo</a> <a name="l00066"></a>00066 { <a name="l00067"></a>00067 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a name="l00068"></a><a class="code" href="struct__QuantumInfo.html#2326a63408d49d5a5a4bef9c9355f5b9">00068</a> <a class="code" href="struct__QuantumInfo.html#2326a63408d49d5a5a4bef9c9355f5b9">quantum</a>; <a name="l00069"></a>00069 <a name="l00070"></a>00070 <a class="code" href="quantum_8h.html#07b2b6f89d4db5d14c717c10a7e1aeea">QuantumFormatType</a> <a name="l00071"></a><a class="code" href="struct__QuantumInfo.html#ebd6973bff27e4ff5d71ba114b5d45f8">00071</a> <a class="code" href="struct__QuantumInfo.html#ebd6973bff27e4ff5d71ba114b5d45f8">format</a>; <a name="l00072"></a>00072 <a name="l00073"></a>00073 <span class="keywordtype">double</span> <a name="l00074"></a><a class="code" href="struct__QuantumInfo.html#6de99a6b7cb88850ced0abd92a9e3768">00074</a> <a class="code" href="struct__QuantumInfo.html#dc98e99d3de0071fccc13bf583857347">minimum</a>, <a name="l00075"></a>00075 <a class="code" href="struct__QuantumInfo.html#bd0fc6d1ffe053c2496b7d19f3c653b7">maximum</a>, <a name="l00076"></a>00076 <a class="code" href="struct__QuantumInfo.html#6de99a6b7cb88850ced0abd92a9e3768">scale</a>; <a name="l00077"></a>00077 <a name="l00078"></a>00078 <span class="keywordtype">size_t</span> <a name="l00079"></a><a class="code" href="struct__QuantumInfo.html#c3fd8c0eceae576dee80216c03144619">00079</a> <a class="code" href="struct__QuantumInfo.html#c3fd8c0eceae576dee80216c03144619">pad</a>; <a name="l00080"></a>00080 <a name="l00081"></a>00081 <a class="code" href="magick-type_8h.html#c740cbce6e8928a679ae3767b49428dd">MagickBooleanType</a> <a name="l00082"></a><a class="code" href="struct__QuantumInfo.html#1357985db49e6bb2ac395f02ba3f3b4c">00082</a> <a class="code" href="struct__QuantumInfo.html#8715fadfd8f56151cda5c50df4b1693d">min_is_white</a>, <a name="l00083"></a>00083 <a class="code" href="struct__QuantumInfo.html#1357985db49e6bb2ac395f02ba3f3b4c">pack</a>; <a name="l00084"></a>00084 <a name="l00085"></a>00085 <a class="code" href="structSemaphoreInfo.html">SemaphoreInfo</a> <a name="l00086"></a><a class="code" href="struct__QuantumInfo.html#a61b9a34b1366ea2883f69d218ecb164">00086</a> *<a class="code" href="struct__QuantumInfo.html#a61b9a34b1366ea2883f69d218ecb164">semaphore</a>; <a name="l00087"></a>00087 <a name="l00088"></a>00088 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a name="l00089"></a><a class="code" href="struct__QuantumInfo.html#a7c874c758f052df5180b90847f72f99">00089</a> <a class="code" href="struct__QuantumInfo.html#a7c874c758f052df5180b90847f72f99">signature</a>; <a name="l00090"></a>00090 } <a class="code" href="struct__QuantumInfo.html">QuantumInfo</a>; <a name="l00091"></a>00091 <a name="l00092"></a><a class="code" href="quantum_8h.html#40bf610f6d90b8a26954b0cb5822d5aa">00092</a> <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a> <a class="code" href="quantum_8h.html#40bf610f6d90b8a26954b0cb5822d5aa">RoundToQuantum</a>(<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> value) <a name="l00093"></a>00093 { <a name="l00094"></a>00094 <span class="preprocessor">#if defined(MAGICKCORE_HDRI_SUPPORT)</span> <a name="l00095"></a>00095 <span class="preprocessor"></span> <span class="keywordflow">return</span>((<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) value); <a name="l00096"></a>00096 <span class="preprocessor">#else</span> <a name="l00097"></a>00097 <span class="preprocessor"></span> <span class="keywordflow">if</span> (value <= 0.0) <a name="l00098"></a>00098 <span class="keywordflow">return</span>((<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) 0); <a name="l00099"></a>00099 <span class="keywordflow">if</span> (value >= <a class="code" href="magick-type_8h.html#4f65ef78c8a53b8f6ac10db1beb44bfe">QuantumRange</a>) <a name="l00100"></a>00100 <span class="keywordflow">return</span>((<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) <a class="code" href="magick-type_8h.html#4f65ef78c8a53b8f6ac10db1beb44bfe">QuantumRange</a>); <a name="l00101"></a>00101 <span class="keywordflow">return</span>((<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) (value+0.5)); <a name="l00102"></a>00102 <span class="preprocessor">#endif</span> <a name="l00103"></a>00103 <span class="preprocessor"></span>} <a name="l00104"></a>00104 <a name="l00105"></a>00105 <span class="preprocessor">#if (MAGICKCORE_QUANTUM_DEPTH == 8)</span> <a name="l00106"></a>00106 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ScaleQuantumToChar(<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a> quantum) <a name="l00107"></a>00107 { <a name="l00108"></a>00108 <span class="preprocessor">#if !defined(MAGICKCORE_HDRI_SUPPORT)</span> <a name="l00109"></a>00109 <span class="preprocessor"></span> <span class="keywordflow">return</span>((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>) quantum); <a name="l00110"></a>00110 <span class="preprocessor">#else</span> <a name="l00111"></a>00111 <span class="preprocessor"></span> <span class="keywordflow">if</span> (quantum <= 0.0) <a name="l00112"></a>00112 <span class="keywordflow">return</span>(0UL); <a name="l00113"></a>00113 <span class="keywordflow">if</span> (quantum >= 255.0) <a name="l00114"></a>00114 <span class="keywordflow">return</span>(255); <a name="l00115"></a>00115 <span class="keywordflow">return</span>((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>) (quantum+0.5)); <a name="l00116"></a>00116 <span class="preprocessor">#endif</span> <a name="l00117"></a>00117 <span class="preprocessor"></span>} <a name="l00118"></a>00118 <span class="preprocessor">#elif (MAGICKCORE_QUANTUM_DEPTH == 16)</span> <a name="l00119"></a>00119 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ScaleQuantumToChar(<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a> quantum) <a name="l00120"></a>00120 { <a name="l00121"></a>00121 <span class="preprocessor">#if !defined(MAGICKCORE_HDRI_SUPPORT)</span> <a name="l00122"></a>00122 <span class="preprocessor"></span> <span class="keywordflow">return</span>((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>) ((quantum+128UL)/257UL)); <a name="l00123"></a>00123 <span class="preprocessor">#else</span> <a name="l00124"></a>00124 <span class="preprocessor"></span> <span class="keywordflow">if</span> (quantum <= 0.0) <a name="l00125"></a>00125 <span class="keywordflow">return</span>(0); <a name="l00126"></a>00126 <span class="keywordflow">if</span> ((quantum/257.0) >= 255.0) <a name="l00127"></a>00127 <span class="keywordflow">return</span>(255); <a name="l00128"></a>00128 <span class="keywordflow">return</span>((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>) (quantum/257.0)); <a name="l00129"></a>00129 <span class="preprocessor">#endif</span> <a name="l00130"></a>00130 <span class="preprocessor"></span>} <a name="l00131"></a>00131 <span class="preprocessor">#elif (MAGICKCORE_QUANTUM_DEPTH == 32)</span> <a name="l00132"></a>00132 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ScaleQuantumToChar(<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a> quantum) <a name="l00133"></a>00133 { <a name="l00134"></a>00134 <span class="preprocessor">#if !defined(MAGICKCORE_HDRI_SUPPORT)</span> <a name="l00135"></a>00135 <span class="preprocessor"></span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a name="l00136"></a>00136 pixel; <a name="l00137"></a>00137 <a name="l00138"></a>00138 pixel=(<span class="keywordtype">unsigned</span> char) ((quantum+<a class="code" href="magick-type_8h.html#21829bc6ce9554c6cbe50963a6838979">MagickULLConstant</a>(8421504))/ <a name="l00139"></a>00139 <a class="code" href="magick-type_8h.html#21829bc6ce9554c6cbe50963a6838979">MagickULLConstant</a>(16843009)); <a name="l00140"></a>00140 <span class="keywordflow">return</span>(pixel); <a name="l00141"></a>00141 <span class="preprocessor">#else</span> <a name="l00142"></a>00142 <span class="preprocessor"></span> <span class="keywordflow">if</span> (quantum <= 0.0) <a name="l00143"></a>00143 <span class="keywordflow">return</span>(0); <a name="l00144"></a>00144 <span class="keywordflow">if</span> ((quantum/16843009.0) >= 255.0) <a name="l00145"></a>00145 <span class="keywordflow">return</span>(255); <a name="l00146"></a>00146 <span class="keywordflow">return</span>((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>) (quantum/16843009.0)); <a name="l00147"></a>00147 <span class="preprocessor">#endif</span> <a name="l00148"></a>00148 <span class="preprocessor"></span>} <a name="l00149"></a>00149 <span class="preprocessor">#elif (MAGICKCORE_QUANTUM_DEPTH == 64)</span> <a name="l00150"></a>00150 <span class="preprocessor"></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> ScaleQuantumToChar(<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a> quantum) <a name="l00151"></a>00151 { <a name="l00152"></a>00152 <span class="preprocessor">#if !defined(MAGICKCORE_HDRI_SUPPORT)</span> <a name="l00153"></a>00153 <span class="preprocessor"></span> <span class="keywordflow">return</span>((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>) ((quantum+2155839615.0)/71777214294589695.0)); <a name="l00154"></a>00154 <span class="preprocessor">#else</span> <a name="l00155"></a>00155 <span class="preprocessor"></span> <span class="keywordflow">return</span>((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>) (quantum/71777214294589695.0)); <a name="l00156"></a>00156 <span class="preprocessor">#endif</span> <a name="l00157"></a>00157 <span class="preprocessor"></span>} <a name="l00158"></a>00158 <span class="preprocessor">#endif</span> <a name="l00159"></a>00159 <span class="preprocessor"></span> <a name="l00160"></a>00160 <span class="keyword">extern</span> <a class="code" href="MagickCore_8h.html#487cee8f0dff0607e77f6b51d6403651">MagickExport</a> <a class="code" href="magick-type_8h.html#c740cbce6e8928a679ae3767b49428dd">MagickBooleanType</a> <a name="l00161"></a>00161 <a class="code" href="quantum_8c.html#5f05f9a3b54c7454538c3063ab3ec321">ExportQuantumPixels</a>(<a class="code" href="struct__Image.html">Image</a> *,<span class="keyword">const</span> <a class="code" href="struct__QuantumInfo.html">QuantumInfo</a> *,<span class="keyword">const</span> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd">QuantumType</a>, <a name="l00162"></a>00162 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *), <a name="l00163"></a>00163 <a class="code" href="quantum_8c.html#795b85b366eec2884ab20e89699d4f7f">ImportQuantumPixels</a>(<a class="code" href="struct__Image.html">Image</a> *,<span class="keyword">const</span> <a class="code" href="struct__QuantumInfo.html">QuantumInfo</a> *,<span class="keyword">const</span> <a class="code" href="quantum_8h.html#4a90409d20ce7e4fb38bd2ec7b7060bd">QuantumType</a>, <a name="l00164"></a>00164 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *); <a name="l00165"></a>00165 <a name="l00166"></a>00166 <span class="keyword">extern</span> <a class="code" href="MagickCore_8h.html#487cee8f0dff0607e77f6b51d6403651">MagickExport</a> <a class="code" href="struct__QuantumInfo.html">QuantumInfo</a> <a name="l00167"></a>00167 *<a class="code" href="quantum_8c.html#182870c09879d50151c75d85d706f106">AcquireQuantumInfo</a>(<span class="keyword">const</span> <a class="code" href="struct__ImageInfo.html">ImageInfo</a> *), <a name="l00168"></a>00168 *<a class="code" href="quantum_8c.html#f7438224ec52e5f719f46c1baef942c2">DestroyQuantumInfo</a>(<a class="code" href="struct__QuantumInfo.html">QuantumInfo</a> *); <a name="l00169"></a>00169 <a name="l00170"></a>00170 <span class="keyword">extern</span> <a class="code" href="MagickCore_8h.html#487cee8f0dff0607e77f6b51d6403651">MagickExport</a> <span class="keywordtype">void</span> <a name="l00171"></a>00171 <a class="code" href="quantum_8c.html#4d6a63eb930cb112a764bc734024d6ce">GetQuantumInfo</a>(<span class="keyword">const</span> <a class="code" href="struct__ImageInfo.html">ImageInfo</a> *,<a class="code" href="struct__QuantumInfo.html">QuantumInfo</a> *); <a name="l00172"></a>00172 <a name="l00173"></a>00173 <span class="preprocessor">#if defined(__cplusplus) || defined(c_plusplus)</span> <a name="l00174"></a>00174 <span class="preprocessor"></span>} <a name="l00175"></a>00175 <span class="preprocessor">#endif</span> <a name="l00176"></a>00176 <span class="preprocessor"></span> <a name="l00177"></a>00177 <span class="preprocessor">#endif</span> </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Sat Jan 26 14:50:29 2008 for MagickCore by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address> </body> </html>