( begin auto-generated from PGraphics.xml ) Main graphics and rendering context, as well as the base API implementation for processing "core". Use this class if you need to draw into an off-screen graphics buffer. A PGraphics object can be constructed with the createGraphics() function. The
| 151 | * @see PApplet#createGraphics(int, int, String) |
| 152 | */ |
| 153 | public class PGraphics extends PImage implements PConstants { |
| 154 | |
| 155 | // /// Canvas object that covers rendering this graphics on screen. |
| 156 | // public Canvas canvas; |
| 157 | |
| 158 | // ........................................................ |
| 159 | |
| 160 | // width and height are already inherited from PImage |
| 161 | |
| 162 | |
| 163 | // /// width minus one (useful for many calculations) |
| 164 | // protected int width1; |
| 165 | // |
| 166 | // /// height minus one (useful for many calculations) |
| 167 | // protected int height1; |
| 168 | |
| 169 | /// width * height (useful for many calculations) |
| 170 | public int pixelCount; |
| 171 | |
| 172 | // /// true if smoothing is enabled (read-only) |
| 173 | // public boolean smooth; |
| 174 | |
| 175 | /// the anti-aliasing level for renderers that support it |
| 176 | public int smooth; |
| 177 | |
| 178 | |
| 179 | // ........................................................ |
| 180 | |
| 181 | /// true if defaults() has been called a first time |
| 182 | protected boolean settingsInited; |
| 183 | |
| 184 | /// true if settings should be re-applied on next beginDraw() |
| 185 | protected boolean reapplySettings; |
| 186 | |
| 187 | /// set to a PGraphics object being used inside a beginRaw/endRaw() block |
| 188 | protected PGraphics raw; |
| 189 | |
| 190 | // ........................................................ |
| 191 | |
| 192 | /** path to the file being saved for this renderer (if any) */ |
| 193 | protected String path; |
| 194 | |
| 195 | /** |
| 196 | * True if this is the main graphics context for a sketch. |
| 197 | * False for offscreen buffers retrieved via createGraphics(). |
| 198 | */ |
| 199 | protected boolean primaryGraphics; |
| 200 | |
| 201 | // // TODO nervous about leaving this here since it seems likely to create |
| 202 | // // back-references where we don't want them |
| 203 | // protected PSurface surface; |
| 204 | |
| 205 | // ........................................................ |
| 206 | |
| 207 | /** |
| 208 | * Array of hint[] items. These are hacks to get around various |
| 209 | * temporary workarounds inside the environment. |
| 210 | * <p/> |