Initial Commit

This commit is contained in:
plane000
2018-04-20 10:15:15 +01:00
parent 49150ccfe4
commit 62101e8e61
2870 changed files with 520122 additions and 0 deletions

View File

@@ -0,0 +1,258 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>PImage::blend() \ Language (API) \ Processing 2+</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="Processing Foundation" />
<meta name="Publisher" content="Processing Foundation" />
<meta name="Keywords" content="Processing, Sketchbook, Programming, Coding, Code, Art, Design" />
<meta name="Description" content="Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology." />
<meta name="Copyright" content="All contents copyright the Processing Foundation, Ben Fry, Casey Reas, and the MIT Media Laboratory" />
<script src="javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body id="Langauge-en" onload="" >
<!-- ==================================== PAGE ============================ -->
<div id="container">
<!-- ==================================== HEADER ============================ -->
<div id="ribbon">
<ul class="left">
<li class="highlight"><a href="http://processing.org/">Processing</a></li>
<li><a href="http://p5js.org/">p5.js</a></li>
<li><a href="http://py.processing.org/">Processing.py</a></li>
<li><a href="http://android.processing.org/">Processing for Android</a></li>
</ul>
<ul class="right">
<li><a href="https://processingfoundation.org/">Processing Foundation</a></li>
</ul>
<div class="clear"></div>
</div>
<div id="header">
<a href="/" title="Back to the Processing cover."><div class="processing-logo no-cover" alt="Processing cover"></div></a>
<form name="search" method="get" action="//www.google.com/search">
<p><input type="hidden" name="as_sitesearch" value="processing.org" />
<input type="text" name="as_q" value="" size="20" class="text" />
<input type="submit" value=" " /></p>
</form>
</div>
<a id="TOP" name="TOP"></a>
<div id="navigation">
<div class="navBar" id="mainnav">
<a href="index.html" class='active'>Language</a><br>
<a href="libraries/index.html" >Libraries</a><br>
<a href="tools/index.html">Tools</a><br>
<a href="environment/index.html">Environment</a><br>
</div>
<script> document.querySelectorAll(".processing-logo")[0].className = "processing-logo"; </script>
</div>
<!-- ==================================== CONTENT - Headers ============================ -->
<div class="content">
<p class="ref-notice">This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, <a href="https://github.com/processing/processing-docs/issues?state=open">please let us know</a>. If you prefer a more technical reference, visit the <a href="http://processing.github.io/processing-javadocs/core/">Processing Core Javadoc</a> and <a href="http://processing.github.io/processing-javadocs/libraries/">Libraries Javadoc</a>.</p>
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr class=""><th scope="row">Class</th><td><p><a href="PImage.html">PImage</a></p></td></tr>
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>blend()</h3></td>
</tr>
<tr class="">
<tr class=""><th scope="row">Examples</th><td><div class="example"><img src="images/PImage_blend_0_add.png" alt="example pic" /><pre class="margin">
PImage mountains = loadImage("rockies.jpg");
PImage bricks = loadImage("bricks.jpg");
mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, ADD);
image(mountains, 0, 0);
image(bricks, 0, 0);
</pre></div>
<div class="example"><img src="images/PImage_blend_1_subtract.png" alt="example pic" /><pre class="margin">
PImage mountains = loadImage("rockies.jpg");
PImage bricks = loadImage("bricks.jpg");
mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, SUBTRACT);
image(mountains, 0, 0);
image(bricks, 0, 0);
</pre></div>
<div class="example"><img src="images/PImage_blend_2_darkest.png" alt="example pic" /><pre class="margin">
PImage mountains = loadImage("rockies.jpg");
PImage bricks = loadImage("bricks.jpg");
mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, DARKEST);
image(mountains, 0, 0);
image(bricks, 0, 0);
</pre></div>
<div class="example"><img src="images/PImage_blend_3_lightest.png" alt="example pic" /><pre class="margin">
PImage mountains = loadImage("rockies.jpg");
PImage bricks = loadImage("bricks.jpg");
mountains.blend(bricks, 0, 0, 33, 100, 67, 0, 33, 100, LIGHTEST);
image(mountains, 0, 0);
image(bricks, 0, 0);
</pre></div>
</td></tr>
<tr class="">
<th scope="row">Description</th>
<td>
Blends a region of pixels into the image specified by the <b>img</b> parameter. These copies utilize full alpha channel support and a choice of the following modes to blend the colors of source pixels (A) with the ones of pixels in the destination image (B):<br />
<br />
BLEND - linear interpolation of colours: C = A*factor + B<br />
<br />
ADD - additive blending with white clip: C = min(A*factor + B, 255)<br />
<br />
SUBTRACT - subtractive blending with black clip: C = max(B - A*factor, 0)<br />
<br />
DARKEST - only the darkest colour succeeds: C = min(A*factor, B)<br />
<br />
LIGHTEST - only the lightest colour succeeds: C = max(A*factor, B)<br />
<br />
DIFFERENCE - subtract colors from underlying image.<br />
<br />
EXCLUSION - similar to DIFFERENCE, but less extreme.<br />
<br />
MULTIPLY - Multiply the colors, result will always be darker.<br />
<br />
SCREEN - Opposite multiply, uses inverse values of the colors.<br />
<br />
OVERLAY - A mix of MULTIPLY and SCREEN. Multiplies dark values,
and screens light values.<br />
<br />
HARD_LIGHT - SCREEN when greater than 50% gray, MULTIPLY when lower.<br />
<br />
SOFT_LIGHT - Mix of DARKEST and LIGHTEST.
Works like OVERLAY, but not as harsh.<br />
<br />
DODGE - Lightens light tones and increases contrast, ignores darks.
Called "Color Dodge" in Illustrator and Photoshop.<br />
<br />
BURN - Darker areas are applied, increasing contrast, ignores lights.
Called "Color Burn" in Illustrator and Photoshop.<br />
<br />
All modes use the alpha information (highest byte) of source image pixels as the blending factor. If the source and destination regions are different sizes, the image will be automatically resized to match the destination size. If the <b>src</b> parameter is not used, the display window is used as the source image.<br />
<br />
As of release 0149, this function ignores <b>imageMode()</b>.
</td>
</tr>
<tr class=""><th scope="row">Syntax</th><td><pre><kbd>pimg</kbd>.blend(<kbd>sx</kbd>, <kbd>sy</kbd>, <kbd>sw</kbd>, <kbd>sh</kbd>, <kbd>dx</kbd>, <kbd>dy</kbd>, <kbd>dw</kbd>, <kbd>dh</kbd>, <kbd>mode</kbd>)
<kbd>pimg</kbd>.blend(<kbd>src</kbd>, <kbd>sx</kbd>, <kbd>sy</kbd>, <kbd>sw</kbd>, <kbd>sh</kbd>, <kbd>dx</kbd>, <kbd>dy</kbd>, <kbd>dw</kbd>, <kbd>dh</kbd>, <kbd>mode</kbd>)</pre></td></tr>
<tr class=""> <th scope="row">Parameters</th><td><table cellpadding="0" cellspacing="0" border="0"><tr class="">
<th scope="row" class="code">pimg</th>
<td>PImage: any object of type PImage</td>
</tr>
<tr class="">
<th scope="row" class="code">src</th>
<td>PImage: an image variable referring to the source image</td>
</tr>
<tr class="">
<th scope="row" class="code">sx</th>
<td>int: X coordinate of the source's upper left corner</td>
</tr>
<tr class="">
<th scope="row" class="code">sy</th>
<td>int: Y coordinate of the source's upper left corner</td>
</tr>
<tr class="">
<th scope="row" class="code">sw</th>
<td>int: source image width</td>
</tr>
<tr class="">
<th scope="row" class="code">sh</th>
<td>int: source image height</td>
</tr>
<tr class="">
<th scope="row" class="code">dx</th>
<td>int: X coordinate of the destinations's upper left corner</td>
</tr>
<tr class="">
<th scope="row" class="code">dy</th>
<td>int: Y coordinate of the destinations's upper left corner</td>
</tr>
<tr class="">
<th scope="row" class="code">dw</th>
<td>int: destination image width</td>
</tr>
<tr class="">
<th scope="row" class="code">dh</th>
<td>int: destination image height</td>
</tr>
<tr class="">
<th scope="row" class="code">mode</th>
<td>int: Either BLEND, ADD, SUBTRACT, LIGHTEST, DARKEST, DIFFERENCE, EXCLUSION, MULTIPLY, SCREEN, OVERLAY, HARD_LIGHT, SOFT_LIGHT, DODGE, BURN</td>
</tr></table></td> </tr>
<tr class=""><th scope="row">Returns</th><td class="code">void</td></tr>
<tr class=""><th scope="row">Related</th><td><a class="code" href="alpha_.html">alpha()</a><br />
<a class="code" href="PImage_copy_.html">copy()</a><br /></td></tr>
</table>
Updated on April 30, 2017 02:33:19pm EDT<br /><br />
<!-- Creative Commons License -->
<div class="license">
<a rel="license" href="//creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border: none" src="https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png" /></a>
</div>
<!--
<?xpacket begin='' id=''?>
<x:xmpmeta xmlns:x='adobe:ns:meta/'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<rdf:Description rdf:about=''
xmlns:xapRights='http://ns.adobe.com/xap/1.0/rights/'>
<xapRights:Marked>True</xapRights:Marked>
</rdf:Description>
<rdf:Description rdf:about=''
xmlns:xapRights='http://ns.adobe.com/xap/1.0/rights/'
>
<xapRights:UsageTerms>
<rdf:Alt>
<rdf:li xml:lang='x-default' >This work is licensed under a &lt;a rel=&#34;license&#34; href=&#34;http://creativecommons.org/licenses/by-nc-sa/4.0/&#34;&gt;Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License&lt;/a&gt;.</rdf:li>
<rdf:li xml:lang='en' >This work is licensed under a &lt;a rel=&#34;license&#34; href=&#34;http://creativecommons.org/licenses/by-nc-sa/4.0/&#34;&gt;Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License&lt;/a&gt;.</rdf:li>
</rdf:Alt>
</xapRights:UsageTerms>
</rdf:Description>
<rdf:Description rdf:about=''
xmlns:cc='http://creativecommons.org/ns#'>
<cc:license rdf:resource='http://creativecommons.org/licenses/by-nc-sa/4.0/'/>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='r'?>
-->
</div>
<!-- ==================================== FOOTER ============================ -->
<div id="footer">
<div id="copyright">Processing is an open project intiated by <a href="http://benfry.com/">Ben Fry</a> and <a href="http://reas.com">Casey Reas</a>. It is developed by a <a href="http://processing.org/about/people/">team of volunteers</a>.</div>
<div id="colophon">
<a href="copyright.html">&copy; Info</a>
</div>
</div>
</div>
<script src="javascript/jquery-1.9.1.min.js"></script>
<script src="javascript/site.js" type="text/javascript"></script>
</body>
</html>