forked from jdf/processing-py-site
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPImage.xml
More file actions
38 lines (28 loc) · 1.48 KB
/
PImage.xml
File metadata and controls
38 lines (28 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>PImage</name>
<category>Image</category>
<subcategory></subcategory>
<type></type>
<example>
<image />
<code><![CDATA[
size(100, 100)
photo = loadImage("laDefense.jpg")
image(photo, 0, 0)
]]></code>
</example>
<!-- js_mode><description><![CDATA[
Use a "@pjs preload" directive to preload images before your sketch starts. You can easily add one with the "Playback Settings" tool in the "JavaScript" menu.
]]></description></js_mode -->
<description><![CDATA[
Datatype for storing images. Processing can display <b>.gif</b>, <b>.jpg</b>, <b>.tga</b>, and <b>.png</b> images. Images may be displayed in 2D and 3D space. Before an image is used, it must be loaded with the <b>loadImage()</b> function. The <b>PImage</b> class contains fields for the <b>width</b> and <b>height</b> of the image, as well as an array called <b>pixels</b> that contains the values for every pixel in the image. The methods described below allow easy access to the image's pixels and alpha channel and simplify the process of compositing.<br/>
<br/>
Before using the <b>pixels</b> array, be sure to use the <b>loadPixels()</b> method on the image to make sure that the pixel data is properly loaded.<br/>
<br/>
To create a new image, use the <b>createImage()</b> function. Do not instantiate the object directly with the syntax <b>PImage()</b>.
]]></description>
<related>loadImage</related>
<related>imageMode</related>
<related>createImage</related>
</root>