MCPcopy Index your code
hub / github.com/benfry/processing4 / PImage

Class PImage

core/src/processing/core/PImage.java:65–3252  ·  view source on GitHub ↗

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 class contains fields for the width

Source from the content-addressed store, hash-verified

63 * @see PApplet#createImage(int, int, int)
64 */
65@SuppressWarnings("ManualMinMaxCalculation")
66public class PImage implements PConstants, Cloneable {
67
68 /**
69 * Format for this image, one of RGB, ARGB or ALPHA.
70 * note that RGB images still require 0xff in the high byte
71 * because of how they'll be manipulated by other functions
72 */
73 public int format;
74
75 /**
76 *
77 * The <b>pixels[]</b> array contains the values for all the pixels in the image. These
78 * values are of the color datatype. This array is the size of the image,
79 * meaning if the image is 100 x 100 pixels, there will be 10,000 values and if
80 * the window is 200 x 300 pixels, there will be 60,000 values. <br />
81 * <br />
82 * Before accessing this array, the data must be loaded with the
83 * <b>loadPixels()</b> method. Failure to do so may result in a
84 * NullPointerException. After the array data has been modified, the
85 * <b>updatePixels()</b> method must be run to update the content of the display
86 * window.
87 *
88 * @webref image:pixels
89 * @webBrief Array containing the color of every pixel in the image
90 * @usage web_application
91 */
92 public int[] pixels;
93
94 /** 1 for most images, 2 for hi-dpi/retina */
95 public int pixelDensity = 1;
96
97 /** Actual dimensions of pixels array, taking into account the 2x setting. */
98 public int pixelWidth;
99 public int pixelHeight;
100
101 /**
102 *
103 * The width of the image in units of pixels.
104 *
105 * @webref pimage:field
106 * @webBrief The width of the image in units of pixels
107 * @usage web_application
108 */
109 public int width;
110
111 /**
112 *
113 * The height of the image in units of pixels.
114 *
115 * @webref pimage:field
116 * @webBrief The height of the image in units of pixels
117 * @usage web_application
118 */
119 public int height;
120
121 /**
122 * Path to parent object that will be used with save().

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected