Skip to content

Commit 9eb15fb

Browse files
authored
Merge pull request #694 from SableRaf/master
Updated the text for the get() page to clarify what happens when call…
2 parents 1b52773 + 8d90c53 commit 9eb15fb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

content/api_en/get.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ rect(25, 25, 50, 50);
3333
<description><![CDATA[
3434
Reads the color of any pixel or grabs a section of an image. If no parameters are specified, the entire image is returned. Use the <b>x</b> and <b>y</b> parameters to get the value of one pixel. Get a section of the display window by specifying additional <b>w</b> and <b>h</b> parameters. When getting an image, the <b>x</b> and <b>y</b> parameters define the coordinates for the upper-left corner of the image, regardless of the current <b>imageMode()</b>.<br />
3535
<br />
36-
If the pixel requested is outside of the image window, black is returned. The numbers returned are scaled according to the current color ranges, but only RGB values are returned by this function. For example, even though you may have drawn a shape with <b>colorMode(HSB)</b>, the numbers returned will be in RGB format.
37-
<br /><br />
36+
If the pixel requested is outside of the image window, black is returned. The numbers returned are scaled according to the current color ranges, but only RGB values are returned by this function. For example, even though you may have drawn a shape with <b>colorMode(HSB)</b>, the numbers returned will be in RGB format.<br />
37+
<br />
38+
If a width and a height are specified, <b>get(x, y, w, h)<b/> returns a PImage corresponding to the part of the original PImage where the top left pixel is at the <b>(x, y)</b> position with a width of <b>w</b> a height of <b>h</b>.<br />
39+
<br />
3840
Getting the color of a single pixel with <b>get(x, y)</b> is easy, but not as fast as grabbing the data directly from <b>pixels[]</b>. The equivalent statement to <b>get(x, y)</b> using <b>pixels[]</b> is <b>pixels[y*width+x]</b>. See the reference for <a href="pixels.html">pixels[]</a> for more information.
3941
]]></description>
4042

0 commit comments

Comments
 (0)