uTools-Manuals/docs/php/imagesetinterpolation.html
2019-04-28 19:00:34 +08:00

211 lines
8.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Set the interpolation method</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.imagesetinterpolation" class="refentry">
<div class="refnamediv">
<h1 class="refname">imagesetinterpolation</h1>
<p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7)</p><p class="refpurpose"><span class="refname">imagesetinterpolation</span> &mdash; <span class="dc-title">Set the interpolation method</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.imagesetinterpolation-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>imagesetinterpolation</strong></span>
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$image</code></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$method</code><span class="initializer"> = IMG_BILINEAR_FIXED</span></span>
] ) : <span class="type">bool</span></div>
<p class="para rdfs-comment">
Sets the interpolation method, setting an interpolation method affects the rendering
of various functions in GD, such as the <span class="function"><a href="imagerotate.html" class="function">imagerotate()</a></span> function.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.imagesetinterpolation-parameters">
<h3 class="title">参数</h3>
<p class="para">
<dl>
<dt>
<code class="parameter">image</code></dt>
<dd>
<p class="para">由图象创建函数(例如<span class="function"><a href="imagecreatetruecolor.html" class="function">imagecreatetruecolor()</a></span>)返回的图象资源。</p></dd>
<dt>
<code class="parameter">method</code></dt>
<dd>
<p class="para">
The interpolation method, which can be one of the following:
<ul class="itemizedlist">
<li class="listitem">
<span class="simpara">
<strong><code>IMG_BELL</code></strong>: Bell filter.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_BESSEL</code></strong>: Bessel filter.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_BICUBIC</code></strong>: Bicubic interpolation.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_BICUBIC_FIXED</code></strong>: Fixed point implementation of the bicubic interpolation.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_BILINEAR_FIXED</code></strong>: Fixed point implementation of the bilinear interpolation (<em>default (also on image creation)</em>).
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_BLACKMAN</code></strong>: Blackman window function.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_BOX</code></strong>: Box blur filter.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_BSPLINE</code></strong>: Spline interpolation.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_CATMULLROM</code></strong>: Cubic Hermite spline interpolation.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_GAUSSIAN</code></strong>: Gaussian function.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_GENERALIZED_CUBIC</code></strong>: Generalized cubic spline fractal interpolation.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_HERMITE</code></strong>: Hermite interpolation.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_HAMMING</code></strong>: Hamming filter.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_HANNING</code></strong>: Hanning filter.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_MITCHELL</code></strong>: Mitchell filter.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_POWER</code></strong>: Power interpolation.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_QUADRATIC</code></strong>: Inverse quadratic interpolation.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_SINC</code></strong>: Sinc function.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_NEAREST_NEIGHBOUR</code></strong>: Nearest neighbour interpolation.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_WEIGHTED4</code></strong>: Weighting filter.
</span>
</li>
<li class="listitem">
<span class="simpara">
<strong><code>IMG_TRIANGLE</code></strong>: Triangle interpolation.
</span>
</li>
</ul>
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.imagesetinterpolation-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
成功时返回 <strong><code>TRUE</code></strong> 或者在失败时返回 <strong><code>FALSE</code></strong>
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.imagesetinterpolation-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-3736">
<p><strong>Example #1 <span class="function"><strong>imagesetinterpolation()</strong></span> example</strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Load&nbsp;an&nbsp;image<br /></span><span style="color: #0000BB">$im&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">imagecreate</span><span style="color: #007700">(</span><span style="color: #0000BB">500</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">500</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;By&nbsp;default&nbsp;interpolation&nbsp;is&nbsp;IMG_BILINEAR_FIXED,&nbsp;switch&nbsp;<br />//&nbsp;to&nbsp;use&nbsp;the&nbsp;'Mitchell'&nbsp;filter:<br /></span><span style="color: #0000BB">imagesetinterpolation</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IMG_MITCHELL</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Continue&nbsp;to&nbsp;work&nbsp;with&nbsp;$im&nbsp;...<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
</div>
</p>
</div>
<div class="refsect1 notes" id="refsect1-function.imagesetinterpolation-notes">
<h3 class="title">注释</h3>
<p class="para">
Changing the interpolation method affects the following functions
when rendering:
<ul class="itemizedlist">
<li class="listitem">
<span class="simpara">
<span class="function"><a href="imageaffine.html" class="function">imageaffine()</a></span>
</span>
</li>
<li class="listitem">
<span class="simpara">
<span class="function"><a href="imagerotate.html" class="function">imagerotate()</a></span>
</span>
</li>
</ul>
</p>
</div>
</div></div></div></body></html>