|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectprocessing.core.PImage
processing.core.PGraphics
processing.core.PGraphicsJava2D
processing.pdf.PGraphicsPDF
| Field Summary |
| Fields inherited from class processing.core.PGraphicsJava2D |
fillGradient, fillGradientObject, g2, strokeGradient, strokeGradientObject |
| Fields inherited from class processing.core.PImage |
cache, format, height, imageMode, modified, mx1, mx2, my1, my2, parent, pixels, smooth, width |
| Constructor Summary | |
PGraphicsPDF(int width,
int height,
PApplet applet)
|
|
PGraphicsPDF(int width,
int height,
PApplet applet,
java.lang.String path)
|
|
| Method Summary | |
void |
addFonts(java.lang.String directory)
Add a directory that should be searched for font data. |
void |
beginDraw()
Prepares the PGraphics for drawing. |
void |
blend(int sx,
int sy,
int dx,
int dy,
int mode)
|
void |
blend(int sx1,
int sy1,
int sx2,
int sy2,
int dx1,
int dy1,
int dx2,
int dy2,
int mode)
Blends one area of this image to another area. |
void |
blend(PImage src,
int sx,
int sy,
int dx,
int dy,
int mode)
|
void |
blend(PImage src,
int sx1,
int sy1,
int sx2,
int sy2,
int dx1,
int dy1,
int dx2,
int dy2,
int mode)
Copies area of one image into another PImage object. |
void |
copy(int sx1,
int sy1,
int sx2,
int sy2,
int dx1,
int dy1,
int dx2,
int dy2)
Copy things from one area of this image to another area in the same image. |
void |
copy(PImage src,
int sx1,
int sy1,
int sx2,
int sy2,
int dx1,
int dy1,
int dx2,
int dy2)
Copies area of one image into another PImage object. |
boolean |
displayable()
Don't open a window for this renderer, it won't be used. |
void |
dispose()
Handle any takedown for this graphics context. |
void |
endDraw()
This will finalize rendering so that it can be shown on-screen. |
void |
filter(int kind)
Method to apply a variety of basic filters to this image. |
void |
filter(int kind,
float param)
Method to apply a variety of basic filters to this image. |
PImage |
get()
Grab a copy of the current pixel buffer. |
int |
get(int x,
int y)
Returns an ARGB "color" type (a packed 32 bit int with the color. |
PImage |
get(int x,
int y,
int c,
int d)
Grab a subsection of a PImage, and copy it into a fresh PImage. |
java.lang.String[] |
listFonts()
List the fonts known to the PDF renderer. |
void |
loadPixels()
Call this when you want to mess with the pixels[] array. |
void |
mask(int[] alpha)
Use with caution on PGraphics. |
void |
mask(PImage alpha)
Use with caution on PGraphics. |
void |
nextPage()
Call to explicitly go to the next page from within a single draw(). |
void |
save(java.lang.String filename)
Save this image to disk. |
void |
set(int x,
int y,
int argb)
Silently ignores if the coordinate is outside the image. |
void |
set(int x,
int y,
PImage image)
|
void |
setMainDrawingSurface()
Set this as the main drawing surface. |
void |
textMode(int mode)
Change the textMode() to either SHAPE or MODEL. |
void |
updatePixels()
Update the pixels[] buffer to the PGraphics image. |
void |
updatePixels(int x,
int y,
int c,
int d)
Update the pixels[] buffer to the PGraphics image. |
| Methods inherited from class processing.core.PGraphicsJava2D |
applyMatrix, background, beginRaw, beginShape, bezierDetail, bezierVertex, breakShape, clear, curveDetail, curveVertex, endRaw, endShape, line, loadMatrix, noSmooth, point, popMatrix, pushMatrix, quad, resetMatrix, resize, rotate, scale, scale, screenX, screenY, smooth, strokeCap, strokeJoin, strokeWeight, textAscent, textDescent, textSize, texture, textureMode, translate, triangle, vertex, vertex, vertex, vertex |
| Methods inherited from class processing.core.PImage |
blendColor, clone, imageMode, init |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PGraphicsPDF(int width,
int height,
PApplet applet)
public PGraphicsPDF(int width,
int height,
PApplet applet,
java.lang.String path)
| Method Detail |
public void setMainDrawingSurface()
PGraphics
setMainDrawingSurface in class PGraphicspublic void beginDraw()
PGraphics
beginDraw in class PGraphicsJava2Dpublic void textMode(int mode)
textMode in class PGraphicspublic void nextPage()
public void endDraw()
PGraphics
endDraw in class PGraphicsJava2Dpublic void dispose()
PGraphicsThis is called when a sketch is shut down and this renderer was specified using the size() command, or inside endRecord() and endRaw(), in order to shut things off.
dispose in class PGraphicspublic boolean displayable()
displayable in class PGraphicspublic void loadPixels()
PImage
loadPixels in class PGraphicsJava2Dpublic void updatePixels()
PGraphicsJava2DUnlike in PImage, where updatePixels() only requests that the update happens, in PGraphicsJava2D, this will happen immediately.
updatePixels in class PGraphicsJava2D
public void updatePixels(int x,
int y,
int c,
int d)
PGraphicsJava2DUnlike in PImage, where updatePixels() only requests that the update happens, in PGraphicsJava2D, this will happen immediately.
updatePixels in class PGraphicsJava2D
public int get(int x,
int y)
PImageIf the image is in RGB format (i.e. on a PVideo object), the value will get its high bits set, just to avoid cases where they haven't been set already.
If the image is in ALPHA format, this returns a white with its alpha value set.
This function is included primarily for beginners. It is quite slow because it has to check to see if the x, y that was provided is inside the bounds, and then has to check to see what image type it is. If you want things to be more efficient, access the pixels[] array directly.
get in class PGraphicsJava2D
public PImage get(int x,
int y,
int c,
int d)
PImage
get in class PGraphicsJava2Dpublic PImage get()
PGraphicsJava2D
get in class PGraphicsJava2D
public void set(int x,
int y,
int argb)
PImage
set in class PGraphicsJava2D
public void set(int x,
int y,
PImage image)
set in class PImagepublic void mask(int[] alpha)
PGraphics
mask in class PGraphicsJava2Dpublic void mask(PImage alpha)
PGraphics
mask in class PGraphicsJava2Dpublic void filter(int kind)
PImage
filter in class PGraphicsJava2D
public void filter(int kind,
float param)
PImage
filter in class PGraphicsJava2D
public void copy(int sx1,
int sy1,
int sx2,
int sy2,
int dx1,
int dy1,
int dx2,
int dy2)
PImage
copy in class PGraphicsJava2D
public void copy(PImage src,
int sx1,
int sy1,
int sx2,
int sy2,
int dx1,
int dy1,
int dx2,
int dy2)
PImage
copy in class PGraphicsJava2D
public void blend(int sx,
int sy,
int dx,
int dy,
int mode)
public void blend(PImage src,
int sx,
int sy,
int dx,
int dy,
int mode)
public void blend(int sx1,
int sy1,
int sx2,
int sy2,
int dx1,
int dy1,
int dx2,
int dy2,
int mode)
PImage
blend in class PGraphicsJava2D
public void blend(PImage src,
int sx1,
int sy1,
int sx2,
int sy2,
int dx1,
int dy1,
int dx2,
int dy2,
int mode)
PImage
blend in class PGraphicsJava2Dpublic void save(java.lang.String filename)
PImageAs of revision 0100, this function requires an absolute path, in order to avoid confusion. To save inside the sketch folder, use the function savePath() from PApplet, or use saveFrame() instead.
As of revision 0115, when using Java 1.4 and later, you can write
to several formats besides tga and tiff. If Java 1.4 is installed
and the extension used is supported (usually png, jpg, jpeg, bmp,
and tiff), then those methods will be used to write the image.
To get a list of the supported formats for writing, use:
println(javax.imageio.ImageIO.getReaderFormatNames())
To use the original built-in image writers, use .tga as the extension, or don't include an extension, in which case .tif will be added.
The ImageIO API claims to support wbmp files, however they probably require a black and white image. Basic testing produced a zero-length file with no error.
As of revision 0116, savePath() is not needed if this object has been created (as recommended) via createImage() or createGraphics() or one of its neighbors.
save in class PGraphicsJava2Dpublic void addFonts(java.lang.String directory)
public java.lang.String[] listFonts()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||