config root man

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
Upload File :
Current File : //usr/local/share/doc/ImageMagick/www/api/MagickCore/composite-private_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: composite-private.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>composite-private.h</h1><a href="composite-private_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 image composite private methods.</span>
<a name="l00017"></a>00017 <span class="comment">*/</span>
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef _MAGICKCORE_COMPOSITE_PRIVATE_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define _MAGICKCORE_COMPOSITE_PRIVATE_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="comment">/*</span>
<a name="l00026"></a>00026 <span class="comment">  ImageMagick Alpha Composite Inline Methods (special export)</span>
<a name="l00027"></a>00027 <span class="comment">*/</span>
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="color_8h.html">magick/color.h</a>"</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="image_8h.html">magick/image.h</a>"</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="image-private_8h.html">magick/image-private.h</a>"</span>
<a name="l00032"></a>00032 
<a name="l00033"></a><a class="code" href="composite-private_8h.html#3789f17602560cd7a134eae2bfb6397b">00033</a> <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> <a class="code" href="composite-private_8h.html#3789f17602560cd7a134eae2bfb6397b">RoundToUnity</a>(<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> value)
<a name="l00034"></a>00034 {
<a name="l00035"></a>00035   <span class="keywordflow">return</span>(value &lt; 0.0 ? 0.0 : (value &gt; 1.0) ? 1.0 : value);
<a name="l00036"></a>00036 }
<a name="l00037"></a>00037 
<a name="l00038"></a><a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">00038</a> <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> <a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>(<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> p,
<a name="l00039"></a>00039   <span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> alpha,<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> q,<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> beta)
<a name="l00040"></a>00040 {
<a name="l00041"></a>00041   <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>
<a name="l00042"></a>00042     pixel;
<a name="l00043"></a>00043 
<a name="l00044"></a>00044   pixel=(1.0-<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*alpha)*p+(1.0-<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*beta)*q*<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*alpha;
<a name="l00045"></a>00045   <span class="keywordflow">return</span>(pixel);
<a name="l00046"></a>00046 }
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 <span class="comment">/*</span>
<a name="l00049"></a>00049 <span class="comment">  Compose pixel p over pixel q with the given opacities</span>
<a name="l00050"></a>00050 <span class="comment">*/</span>
<a name="l00051"></a><a class="code" href="composite-private_8h.html#be3ecd169243ed15fba66d1a89bf4c81">00051</a> <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="composite-private_8h.html#be3ecd169243ed15fba66d1a89bf4c81">MagickCompositeOver</a>(<span class="keyword">const</span> <a class="code" href="struct__PixelPacket.html">PixelPacket</a> *p,
<a name="l00052"></a>00052   <span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> alpha,<span class="keyword">const</span> <a class="code" href="struct__PixelPacket.html">PixelPacket</a> *q,<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> beta,
<a name="l00053"></a>00053   <a class="code" href="struct__PixelPacket.html">PixelPacket</a> *composite)
<a name="l00054"></a>00054 {
<a name="l00055"></a>00055   <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>
<a name="l00056"></a>00056     gamma;
<a name="l00057"></a>00057 
<a name="l00058"></a>00058   <span class="keywordflow">if</span> (alpha == <a class="code" href="image_8h.html#c0629e4c480188ee2aa5d4b1e700656f">TransparentOpacity</a>)
<a name="l00059"></a>00059     {
<a name="l00060"></a>00060       *composite=(*q);
<a name="l00061"></a>00061       <span class="keywordflow">return</span>;
<a name="l00062"></a>00062     }
<a name="l00063"></a>00063   gamma=1.0-<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*alpha*beta;
<a name="l00064"></a>00064 <span class="preprocessor">#if !defined(MAGICKCORE_HDRI_SUPPORT)</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span>  composite-&gt;<a class="code" href="struct__PixelPacket.html#5e7890101ca154390eb9c819584e6910">opacity</a>=(<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) (<a class="code" href="magick-type_8h.html#4f65ef78c8a53b8f6ac10db1beb44bfe">QuantumRange</a>*(1.0-gamma)+0.5);
<a name="l00066"></a>00066   gamma=1.0/(gamma &lt;= <a class="code" href="magick-type_8h.html#59f985eae8a8ad8313bc45e9a6283687">MagickEpsilon</a> ? 1.0 : gamma);
<a name="l00067"></a>00067   composite-&gt;<a class="code" href="struct__PixelPacket.html#f5a6eb37a9b0d850d8aabe7a96e50d15">red</a>=(<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) (gamma*<a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>((<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) p-&gt;<a class="code" href="struct__PixelPacket.html#f5a6eb37a9b0d850d8aabe7a96e50d15">red</a>,alpha,
<a name="l00068"></a>00068     (<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) q-&gt;<a class="code" href="struct__PixelPacket.html#f5a6eb37a9b0d850d8aabe7a96e50d15">red</a>,beta)+0.5);
<a name="l00069"></a>00069   composite-&gt;<a class="code" href="struct__PixelPacket.html#6b608b2e227fd0bff9a2e7689acc2d5f">green</a>=(<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) (gamma*<a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>((<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) p-&gt;<a class="code" href="struct__PixelPacket.html#6b608b2e227fd0bff9a2e7689acc2d5f">green</a>,alpha,
<a name="l00070"></a>00070     (<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) q-&gt;<a class="code" href="struct__PixelPacket.html#6b608b2e227fd0bff9a2e7689acc2d5f">green</a>,beta)+0.5);
<a name="l00071"></a>00071   composite-&gt;<a class="code" href="struct__PixelPacket.html#70693580f436f8cbec8693ac5db73110">blue</a>=(<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) (gamma*<a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>((<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) p-&gt;<a class="code" href="struct__PixelPacket.html#70693580f436f8cbec8693ac5db73110">blue</a>,alpha,
<a name="l00072"></a>00072     (<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) q-&gt;<a class="code" href="struct__PixelPacket.html#70693580f436f8cbec8693ac5db73110">blue</a>,beta)+0.5);
<a name="l00073"></a>00073 <span class="preprocessor">#else</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span>  composite-&gt;<a class="code" href="struct__PixelPacket.html#5e7890101ca154390eb9c819584e6910">opacity</a>=(<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) (<a class="code" href="magick-type_8h.html#4f65ef78c8a53b8f6ac10db1beb44bfe">QuantumRange</a>*(1.0-gamma));
<a name="l00075"></a>00075   gamma=1.0/(gamma &lt;= <a class="code" href="magick-type_8h.html#59f985eae8a8ad8313bc45e9a6283687">MagickEpsilon</a> ? 1.0 : gamma);
<a name="l00076"></a>00076   composite-&gt;<a class="code" href="struct__PixelPacket.html#f5a6eb37a9b0d850d8aabe7a96e50d15">red</a>=(<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) (gamma*<a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>((<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) p-&gt;<a class="code" href="struct__PixelPacket.html#f5a6eb37a9b0d850d8aabe7a96e50d15">red</a>,alpha,
<a name="l00077"></a>00077     (<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) q-&gt;<a class="code" href="struct__PixelPacket.html#f5a6eb37a9b0d850d8aabe7a96e50d15">red</a>,beta));
<a name="l00078"></a>00078   composite-&gt;<a class="code" href="struct__PixelPacket.html#6b608b2e227fd0bff9a2e7689acc2d5f">green</a>=(<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) (gamma*<a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>((<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) p-&gt;<a class="code" href="struct__PixelPacket.html#6b608b2e227fd0bff9a2e7689acc2d5f">green</a>,alpha,
<a name="l00079"></a>00079     (<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) q-&gt;<a class="code" href="struct__PixelPacket.html#6b608b2e227fd0bff9a2e7689acc2d5f">green</a>,beta));
<a name="l00080"></a>00080   composite-&gt;<a class="code" href="struct__PixelPacket.html#70693580f436f8cbec8693ac5db73110">blue</a>=(<a class="code" href="magick-type_8h.html#564764e59a8480d672edfe65cf2f7b35">Quantum</a>) (gamma*<a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>((<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) p-&gt;<a class="code" href="struct__PixelPacket.html#70693580f436f8cbec8693ac5db73110">blue</a>,alpha,
<a name="l00081"></a>00081     (<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) q-&gt;<a class="code" href="struct__PixelPacket.html#70693580f436f8cbec8693ac5db73110">blue</a>,beta));
<a name="l00082"></a>00082 <span class="preprocessor">#endif</span>
<a name="l00083"></a>00083 <span class="preprocessor"></span>}
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 <span class="comment">/*</span>
<a name="l00086"></a>00086 <span class="comment">  Compose pixel p over pixel q with the given opacities</span>
<a name="l00087"></a><a class="code" href="composite-private_8h.html#57dbbd753b660c1be3790ad83af9f514">00087</a> <span class="comment">*/</span>
<a name="l00088"></a>00088 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="composite-private_8h.html#57dbbd753b660c1be3790ad83af9f514">MagickPixelCompositeOver</a>(<span class="keyword">const</span> <a class="code" href="struct__MagickPixelPacket.html">MagickPixelPacket</a> *p,
<a name="l00089"></a>00089   <span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> alpha,<span class="keyword">const</span> <a class="code" href="struct__MagickPixelPacket.html">MagickPixelPacket</a> *q,
<a name="l00090"></a>00090   <span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> beta,<a class="code" href="struct__MagickPixelPacket.html">MagickPixelPacket</a> *composite)
<a name="l00091"></a>00091 {
<a name="l00092"></a>00092   <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>
<a name="l00093"></a>00093     gamma;
<a name="l00094"></a>00094 
<a name="l00095"></a>00095   <span class="keywordflow">if</span> (alpha == <a class="code" href="image_8h.html#c0629e4c480188ee2aa5d4b1e700656f">TransparentOpacity</a>)
<a name="l00096"></a>00096     {
<a name="l00097"></a>00097       *composite=(*q);
<a name="l00098"></a>00098       <span class="keywordflow">return</span>;
<a name="l00099"></a>00099     }
<a name="l00100"></a>00100   gamma=1.0-<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*alpha*beta;
<a name="l00101"></a>00101   composite-&gt;<a class="code" href="struct__MagickPixelPacket.html#c8d93e00f1f3304acb97e9181be555d8">opacity</a>=(<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) <a class="code" href="magick-type_8h.html#4f65ef78c8a53b8f6ac10db1beb44bfe">QuantumRange</a>*(1.0-gamma);
<a name="l00102"></a>00102   gamma=1.0/(gamma &lt;= <a class="code" href="magick-type_8h.html#59f985eae8a8ad8313bc45e9a6283687">MagickEpsilon</a> ? 1.0 : gamma);
<a name="l00103"></a>00103   composite-&gt;<a class="code" href="struct__MagickPixelPacket.html#ff7ca39219d6c5f42faa9815bce9f173">red</a>=gamma*<a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>(p-&gt;<a class="code" href="struct__MagickPixelPacket.html#ff7ca39219d6c5f42faa9815bce9f173">red</a>,alpha,q-&gt;<a class="code" href="struct__MagickPixelPacket.html#ff7ca39219d6c5f42faa9815bce9f173">red</a>,beta);
<a name="l00104"></a>00104   composite-&gt;<a class="code" href="struct__MagickPixelPacket.html#ef2f6b6426929864e1eead988663e494">green</a>=gamma*<a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>(p-&gt;<a class="code" href="struct__MagickPixelPacket.html#ef2f6b6426929864e1eead988663e494">green</a>,alpha,q-&gt;<a class="code" href="struct__MagickPixelPacket.html#ef2f6b6426929864e1eead988663e494">green</a>,beta);
<a name="l00105"></a>00105   composite-&gt;<a class="code" href="struct__MagickPixelPacket.html#ade0be72303eadbf06fbe64e01cbc301">blue</a>=gamma*<a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>(p-&gt;<a class="code" href="struct__MagickPixelPacket.html#ade0be72303eadbf06fbe64e01cbc301">blue</a>,alpha,q-&gt;<a class="code" href="struct__MagickPixelPacket.html#ade0be72303eadbf06fbe64e01cbc301">blue</a>,beta);
<a name="l00106"></a>00106   <span class="keywordflow">if</span> ((p-&gt;<a class="code" href="struct__MagickPixelPacket.html#6c6f0d8c3297fc7112f9af03b30189c2">colorspace</a> == <a class="code" href="colorspace_8h.html#5d516b430fa42c1f83b557f08128f3c26e2ce6ccd573353bc25333188a47642b">CMYKColorspace</a>) &amp;&amp; (q-&gt;<a class="code" href="struct__MagickPixelPacket.html#6c6f0d8c3297fc7112f9af03b30189c2">colorspace</a> == <a class="code" href="colorspace_8h.html#5d516b430fa42c1f83b557f08128f3c26e2ce6ccd573353bc25333188a47642b">CMYKColorspace</a>))
<a name="l00107"></a>00107     composite-&gt;<a class="code" href="struct__MagickPixelPacket.html#c271bb7d0f6353699e5365599ed0f86d">index</a>=gamma*<a class="code" href="composite-private_8h.html#f4a09c18485c285d29df99d39cd9035a">MagickOver_</a>(p-&gt;<a class="code" href="struct__MagickPixelPacket.html#c271bb7d0f6353699e5365599ed0f86d">index</a>,alpha,q-&gt;<a class="code" href="struct__MagickPixelPacket.html#c271bb7d0f6353699e5365599ed0f86d">index</a>,beta);
<a name="l00108"></a>00108 }
<a name="l00109"></a>00109 
<a name="l00110"></a><a class="code" href="composite-private_8h.html#9990633233b6cc72fe1e355ea0d5de37">00110</a> 
<a name="l00111"></a>00111 <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> <a class="code" href="composite-private_8h.html#9990633233b6cc72fe1e355ea0d5de37">MagickPlus_</a>(<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> p,
<a name="l00112"></a>00112   <span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> alpha,<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> q,<span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> beta)
<a name="l00113"></a>00113 {
<a name="l00114"></a>00114   <span class="keywordflow">return</span>((1.0-<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*alpha)*p+(1.0-<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*beta)*q);
<a name="l00115"></a>00115 }
<a name="l00116"></a>00116 
<a name="l00117"></a>00117 <span class="comment">/*</span>
<a name="l00118"></a>00118 <span class="comment">  Add two pixels with the given opacities</span>
<a name="l00119"></a><a class="code" href="composite-private_8h.html#c9e9529a95a7b8bd8e0853ee90dc9199">00119</a> <span class="comment">*/</span>
<a name="l00120"></a>00120 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="composite-private_8h.html#c9e9529a95a7b8bd8e0853ee90dc9199">MagickPixelCompositePlus</a>(<span class="keyword">const</span> <a class="code" href="struct__MagickPixelPacket.html">MagickPixelPacket</a> *p,
<a name="l00121"></a>00121   <span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> alpha,<span class="keyword">const</span> <a class="code" href="struct__MagickPixelPacket.html">MagickPixelPacket</a> *q,
<a name="l00122"></a>00122   <span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> beta,<a class="code" href="struct__MagickPixelPacket.html">MagickPixelPacket</a> *composite)
<a name="l00123"></a>00123 {
<a name="l00124"></a>00124   <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>
<a name="l00125"></a>00125     gamma;
<a name="l00126"></a>00126 
<a name="l00127"></a>00127   gamma=<a class="code" href="composite-private_8h.html#3789f17602560cd7a134eae2bfb6397b">RoundToUnity</a>((1.0-<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*alpha)+(1.0-<a class="code" href="image-private_8h.html#eee7d297e9e3733c9e3b34594c582afe">QuantumScale</a>*beta));
<a name="l00128"></a>00128   composite-&gt;<a class="code" href="struct__MagickPixelPacket.html#c8d93e00f1f3304acb97e9181be555d8">opacity</a>=(<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) <a class="code" href="magick-type_8h.html#4f65ef78c8a53b8f6ac10db1beb44bfe">QuantumRange</a>*(1.0-gamma);
<a name="l00129"></a>00129   gamma=1.0/(fabs(gamma) &lt;= <a class="code" href="magick-type_8h.html#59f985eae8a8ad8313bc45e9a6283687">MagickEpsilon</a> ? 1.0 : gamma);
<a name="l00130"></a>00130   composite-&gt;<a class="code" href="struct__MagickPixelPacket.html#ff7ca39219d6c5f42faa9815bce9f173">red</a>=gamma*<a class="code" href="composite-private_8h.html#9990633233b6cc72fe1e355ea0d5de37">MagickPlus_</a>(p-&gt;<a class="code" href="struct__MagickPixelPacket.html#ff7ca39219d6c5f42faa9815bce9f173">red</a>,alpha,q-&gt;<a class="code" href="struct__MagickPixelPacket.html#ff7ca39219d6c5f42faa9815bce9f173">red</a>,beta);
<a name="l00131"></a>00131   composite-&gt;<a class="code" href="struct__MagickPixelPacket.html#ef2f6b6426929864e1eead988663e494">green</a>=gamma*<a class="code" href="composite-private_8h.html#9990633233b6cc72fe1e355ea0d5de37">MagickPlus_</a>(p-&gt;<a class="code" href="struct__MagickPixelPacket.html#ef2f6b6426929864e1eead988663e494">green</a>,alpha,q-&gt;<a class="code" href="struct__MagickPixelPacket.html#ef2f6b6426929864e1eead988663e494">green</a>,beta);
<a name="l00132"></a>00132   composite-&gt;<a class="code" href="struct__MagickPixelPacket.html#ade0be72303eadbf06fbe64e01cbc301">blue</a>=gamma*<a class="code" href="composite-private_8h.html#9990633233b6cc72fe1e355ea0d5de37">MagickPlus_</a>(p-&gt;<a class="code" href="struct__MagickPixelPacket.html#ade0be72303eadbf06fbe64e01cbc301">blue</a>,alpha,q-&gt;<a class="code" href="struct__MagickPixelPacket.html#ade0be72303eadbf06fbe64e01cbc301">blue</a>,beta);
<a name="l00133"></a>00133   <span class="keywordflow">if</span> (q-&gt;<a class="code" href="struct__MagickPixelPacket.html#6c6f0d8c3297fc7112f9af03b30189c2">colorspace</a> == <a class="code" href="colorspace_8h.html#5d516b430fa42c1f83b557f08128f3c26e2ce6ccd573353bc25333188a47642b">CMYKColorspace</a>)
<a name="l00134"></a>00134     composite-&gt;<a class="code" href="struct__MagickPixelPacket.html#c271bb7d0f6353699e5365599ed0f86d">index</a>=gamma*<a class="code" href="composite-private_8h.html#9990633233b6cc72fe1e355ea0d5de37">MagickPlus_</a>(p-&gt;<a class="code" href="struct__MagickPixelPacket.html#c271bb7d0f6353699e5365599ed0f86d">index</a>,alpha,q-&gt;<a class="code" href="struct__MagickPixelPacket.html#c271bb7d0f6353699e5365599ed0f86d">index</a>,beta);
<a name="l00135"></a>00135 }
<a name="l00136"></a>00136 
<a name="l00137"></a>00137 <span class="comment">/*</span>
<a name="l00138"></a>00138 <span class="comment">  Blend pixel colors p and q by the amount given</span>
<a name="l00139"></a><a class="code" href="composite-private_8h.html#267f44f62092831ff59ddbac40c95830">00139</a> <span class="comment">*/</span>
<a name="l00140"></a>00140 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="composite-private_8h.html#267f44f62092831ff59ddbac40c95830">MagickPixelCompositeBlend</a>(<span class="keyword">const</span> <a class="code" href="struct__MagickPixelPacket.html">MagickPixelPacket</a> *p,
<a name="l00141"></a>00141   <span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> alpha,<span class="keyword">const</span> <a class="code" href="struct__MagickPixelPacket.html">MagickPixelPacket</a> *q,
<a name="l00142"></a>00142   <span class="keyword">const</span> <a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a> beta,<a class="code" href="struct__MagickPixelPacket.html">MagickPixelPacket</a> *composite)
<a name="l00143"></a>00143 {
<a name="l00144"></a>00144   <a class="code" href="composite-private_8h.html#c9e9529a95a7b8bd8e0853ee90dc9199">MagickPixelCompositePlus</a>(p,(<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) (<a class="code" href="magick-type_8h.html#4f65ef78c8a53b8f6ac10db1beb44bfe">QuantumRange</a>-alpha*
<a name="l00145"></a>00145     (<a class="code" href="magick-type_8h.html#4f65ef78c8a53b8f6ac10db1beb44bfe">QuantumRange</a>-p-&gt;<a class="code" href="struct__MagickPixelPacket.html#c8d93e00f1f3304acb97e9181be555d8">opacity</a>)),q,(<a class="code" href="magick-type_8h.html#63ab595ab40d99ff825a4c39cc69c074">MagickRealType</a>) (<a class="code" href="magick-type_8h.html#4f65ef78c8a53b8f6ac10db1beb44bfe">QuantumRange</a>-beta*
<a name="l00146"></a>00146     (<a class="code" href="magick-type_8h.html#4f65ef78c8a53b8f6ac10db1beb44bfe">QuantumRange</a>-q-&gt;<a class="code" href="struct__MagickPixelPacket.html#c8d93e00f1f3304acb97e9181be555d8">opacity</a>)),composite);
<a name="l00147"></a>00147 }
<a name="l00148"></a>00148 
<a name="l00149"></a>00149 <span class="preprocessor">#if defined(__cplusplus) || defined(c_plusplus)</span>
<a name="l00150"></a>00150 <span class="preprocessor"></span>}
<a name="l00151"></a>00151 <span class="preprocessor">#endif</span>
<a name="l00152"></a>00152 <span class="preprocessor"></span>
<a name="l00153"></a>00153 <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&nbsp;
<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>

Man Man