Education/Projects/ProcessingForTheWeb/PImage: Difference between revisions
< Education | Projects | ProcessingForTheWeb
Jump to navigation
Jump to search
No edit summary |
|||
(15 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
=== Examples === | === Examples === | ||
PImage | PImage = loadImage("laDefense.jpg"); <br /> | ||
image(b, 0, 0); <br /> | image(b, 0, 0); <br /> | ||
Line 14: | Line 13: | ||
width: the width of the image<br /> | width: the width of the image<br /> | ||
height: the height of the image<br /> | height: the height of the image<br /> | ||
[http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#imagedata| ImageData] a canvas element that contains width, height, and a pixel array. | |||
The pixel array size is width * height * 4. | |||
== Methods == | == Methods == | ||
Line 22: | Line 23: | ||
! Description | ! Description | ||
|- | |- | ||
| [ | | [https://wiki.mozilla.org/Education/Projects/ProcessingForTheWeb/PImage.get get()] | ||
| Reads the color of any pixel or grabs a rectangle of pixels | | Reads the color of any pixel or grabs a rectangle of pixels | ||
|- | |- | ||
| set() | | [https://wiki.mozilla.org/Education/Projects/ProcessingForTheWeb/PImage.set set()] | ||
| Writes a color to any pixel or writes an image into another | | Writes a color to any pixel or writes an image into another | ||
|- | |- | ||
| copy() | | [https://wiki.mozilla.org/Education/Projects/ProcessingForTheWeb/PImage.copy copy()] | ||
| Copies the entire image | | Copies the entire image | ||
|- | |- | ||
Line 65: | Line 66: | ||
|} | |} | ||
=== Tests === | === Tests === | ||
{| class="wikitable" border="1" | |||
|- | |||
! Test | |||
! Location | |||
|- | |||
| constructor | |||
| [http://matrix.senecac.on.ca/~asobiepa/Processing/PImage/PImage.html] | |||
|} |
Latest revision as of 02:15, 28 November 2009
Summary
This is a class written for Education/Projects/ProcessingForTheWeb. It is a data type for storing images. Images can be displayed in 2D and 3D. Before any image can be used it must be loaded using the loadImage() function. View official Reference
Examples
PImage = loadImage("laDefense.jpg");
image(b, 0, 0);
Fields
width: the width of the image
height: the height of the image
ImageData a canvas element that contains width, height, and a pixel array.
The pixel array size is width * height * 4.
Methods
Description | |
---|---|
get() | Reads the color of any pixel or grabs a rectangle of pixels |
set() | Writes a color to any pixel or writes an image into another |
copy() | Copies the entire image |
mask() | Masks part of the image from displaying |
blend() | Copies a pixel or rectangle of pixels using different blending modes |
filter() | Converts the image to grayscale or black and white |
save() | Saves the image to a TIFF, TARGA, PNG, or JPEG file |
resize() | Changes the size of an image to a new width and height |
loadPixels() | Loads the pixel data for the image into its pixels[] array |
updatePixels() | Updates the image with the data in its pixels[] array |
Bugs
Refer to the reference of each function for a specific bug report.
Bug Description | Fixed?(Date) |
---|---|
Tests
Test | Location |
---|---|
constructor | [1] |