Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 8400

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!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>Applies a color vector to each pixel in the image</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.thumbnailimage.html">Imagick::thumbnailImage</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.tostring.html">Imagick::__toString</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="imagick.tintimage" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Imagick::tintImage</h1>
  <p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">Imagick::tintImage</span> &mdash; <span class="dc-title">Applies a color vector to each pixel in the image</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-imagick.tintimage-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>Imagick::tintImage</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$tint</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$opacity</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$legacy</code><span class="initializer"> = <strong><code>FALSE</code></strong></span></span>
  ] )</div>

  <p class="para rdfs-comment">
   Applies a color vector to each pixel in the image. The length of the vector
   is 0 for black and white and at its maximum for the midtones. The vector
   weighing function is f(x)=(1-(4.0*((x-0.5)*(x-0.5)))).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-imagick.tintimage-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">tint</code></dt>

     <dd>

      <p class="para">
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">opacity</code></dt>

     <dd>

      <p class="para">
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-imagick.tintimage-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-imagick.tintimage-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   Throws ImagickException on error.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-imagick.tintimage-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>2.1.0</td>
       <td>
        Now allows a string representing the color as the first parameter and
        a float representing the opacity value as the second parameter.
        Previous versions allow only an ImagickPixel objects.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>




 <div class="refsect1 examples" id="refsect1-imagick.tintimage-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
    <div class="example" id="example-4047">
      <p><strong>Example #1  <span class="function"><strong>Imagick::tintImage()</strong></span></strong></p>
      <div class="example-contents">
      <div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">tintImage</span><span style="color: #007700">(</span><span style="color: #0000BB">$r</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$g</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$b</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$a</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$a&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$a&nbsp;</span><span style="color: #007700">/&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;\</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">newPseudoImage</span><span style="color: #007700">(</span><span style="color: #0000BB">400</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">400</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'gradient:black-white'</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$tint&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;\</span><span style="color: #0000BB">ImagickPixel</span><span style="color: #007700">(</span><span style="color: #DD0000">"rgb(</span><span style="color: #0000BB">$r</span><span style="color: #DD0000">,&nbsp;</span><span style="color: #0000BB">$g</span><span style="color: #DD0000">,&nbsp;</span><span style="color: #0000BB">$b</span><span style="color: #DD0000">)"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$opacity&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;\</span><span style="color: #0000BB">ImagickPixel</span><span style="color: #007700">(</span><span style="color: #DD0000">"rgb(128,&nbsp;128,&nbsp;128,&nbsp;</span><span style="color: #0000BB">$a</span><span style="color: #DD0000">)"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">tintImage</span><span style="color: #007700">(</span><span style="color: #0000BB">$tint</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$opacity</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setImageFormat</span><span style="color: #007700">(</span><span style="color: #DD0000">'png'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Content-Type:&nbsp;image/png"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getImageBlob</span><span style="color: #007700">();<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
      </div>

    </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.thumbnailimage.html">Imagick::thumbnailImage</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.tostring.html">Imagick::__toString</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>