( begin auto-generated from PImage.xml ) Datatype for storing images. Processing can display .gif , .jpg , .tga , and .png images. Images may be displayed in 2D and 3D space. Before an image is used, it must be loaded with the loadImage() function. The PImage
| 60 | * @see PApplet#createImage(int, int, int) |
| 61 | */ |
| 62 | public class PImage implements PConstants, Cloneable { |
| 63 | |
| 64 | /** |
| 65 | * Format for this image, one of RGB, ARGB or ALPHA. |
| 66 | * note that RGB images still require 0xff in the high byte |
| 67 | * because of how they'll be manipulated by other functions |
| 68 | */ |
| 69 | public int format; |
| 70 | |
| 71 | /** |
| 72 | * ( begin auto-generated from pixels.xml ) |
| 73 | * |
| 74 | * Array containing the values for all the pixels in the display window. |
| 75 | * These values are of the color datatype. This array is the size of the |
| 76 | * display window. For example, if the image is 100x100 pixels, there will |
| 77 | * be 10000 values and if the window is 200x300 pixels, there will be 60000 |
| 78 | * values. The <b>index</b> value defines the position of a value within |
| 79 | * the array. For example, the statement <b>color b = pixels[230]</b> will |
| 80 | * set the variable <b>b</b> to be equal to the value at that location in |
| 81 | * the array.<br /> |
| 82 | * <br /> |
| 83 | * Before accessing this array, the data must loaded with the |
| 84 | * <b>loadPixels()</b> function. After the array data has been modified, |
| 85 | * the <b>updatePixels()</b> function must be run to update the changes. |
| 86 | * Without <b>loadPixels()</b>, running the code may (or will in future |
| 87 | * releases) result in a NullPointerException. |
| 88 | * |
| 89 | * ( end auto-generated ) |
| 90 | * |
| 91 | * @webref image:pixels |
| 92 | * @usage web_application |
| 93 | * @brief Array containing the color of every pixel in the image |
| 94 | */ |
| 95 | public int[] pixels; |
| 96 | |
| 97 | /** 1 for most images, 2 for hi-dpi/retina */ |
| 98 | public int pixelDensity = 1; |
| 99 | |
| 100 | /** Actual dimensions of pixels array, taking into account the 2x setting. */ |
| 101 | public int pixelWidth; |
| 102 | public int pixelHeight; |
| 103 | |
| 104 | /** |
| 105 | * ( begin auto-generated from PImage_width.xml ) |
| 106 | * |
| 107 | * The width of the image in units of pixels. |
| 108 | * |
| 109 | * ( end auto-generated ) |
| 110 | * @webref pimage:field |
| 111 | * @usage web_application |
| 112 | * @brief Image width |
| 113 | */ |
| 114 | public int width; |
| 115 | |
| 116 | /** |
| 117 | * ( begin auto-generated from PImage_height.xml ) |
| 118 | * |
| 119 | * The height of the image in units of pixels. |
nothing calls this directly
no outgoing calls
no test coverage detected