|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object processing.core.PImage processing.core.PGraphics processing.core.PGraphicsJava2D processing.pdf.PGraphicsPDF
public class PGraphicsPDF
Field Summary |
---|
Fields inherited from class processing.core.PGraphicsJava2D |
---|
fillGradient, fillGradientObject, g2, strokeGradient, strokeGradientObject |
Fields inherited from class processing.core.PGraphics |
---|
ambientB, ambientG, ambientR, backgroundColor, bezierDetail, colorMode, colorModeA, colorModeX, colorModeY, colorModeZ, curveTightness, edge, ellipseMode, emissiveB, emissiveG, emissiveR, fill, fillColor, image, imageMode, normalX, normalY, normalZ, pixelCount, rectMode, shapeMode, shininess, smooth, specularB, specularG, specularR, sphereDetailU, sphereDetailV, stroke, strokeCap, strokeColor, strokeJoin, strokeWeight, textAlign, textAlignY, textFont, textLeading, textMode, textSize, textureImage, textureMode, textureU, textureV, tint, tintColor |
Fields inherited from class processing.core.PImage |
---|
format, height, parent, pixels, width |
Constructor Summary | |
---|---|
PGraphicsPDF()
|
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()
Returns a copy of this PImage. |
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)
Set alpha channel for an image. |
void |
mask(PImage alpha)
Set alpha channel for an image using another image as the source. |
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)
Set a single pixel to the specified color. |
void |
set(int x,
int y,
PImage image)
Efficient method of drawing an image's pixels directly to this surface. |
void |
setPath(java.lang.String path)
|
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, applyMatrix, backgroundImpl, beginRaw, beginShape, bezierDetail, bezierVertex, bezierVertex, box, breakShape, canDraw, curveDetail, curveVertex, endRaw, endShape, getImpl, getMatrix, getMatrix, getMatrix, line, noSmooth, point, popMatrix, printMatrix, pushMatrix, quad, resetMatrix, resize, rotate, rotate, rotateX, rotateY, rotateZ, scale, scale, scale, screenX, screenX, screenY, screenY, screenZ, setMatrix, setMatrix, setSize, smooth, sphere, strokeCap, strokeJoin, strokeWeight, textAscent, textDescent, textSize, texture, translate, triangle, vertex, vertex, vertex, vertex |
Methods inherited from class processing.core.PImage |
---|
blendColor, clone, getCache, getImage, init, isModified, removeCache, setCache, setModified, setModified |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PGraphicsPDF()
Method Detail |
---|
public void setPath(java.lang.String path)
setPath
in class PGraphics
public void beginDraw()
PGraphics
beginDraw
in class PGraphicsJava2D
public void endDraw()
PGraphics
endDraw
in class PGraphicsJava2D
public void textMode(int mode)
textMode
in class PGraphics
public void nextPage()
public void dispose()
PGraphics
This 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 PGraphics
public boolean displayable()
displayable
in class PGraphics
public void loadPixels()
PImage
loadPixels
in class PGraphicsJava2D
public void updatePixels()
PGraphicsJava2D
Unlike 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)
PGraphicsJava2D
Unlike 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)
PImage
If 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 PImage
public PImage get()
PImage
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)
PImage
set
in class PImage
public void mask(int[] alpha)
PImage
Strictly speaking the "blue" value from the source image is used as the alpha color. For a fully grayscale image, this is correct, but for a color image it's not 100% accurate. For a more accurate conversion, first use filter(GRAY) which will make the image into a "correct" grayscake by performing a proper luminance-based conversion.
mask
in class PGraphicsJava2D
public void mask(PImage alpha)
PImage
mask
in class PGraphicsJava2D
public void filter(int kind)
PImage
filter
in class PImage
public void filter(int kind, float param)
PImage
filter
in class PImage
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 PImage
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 PImage
PImage.blendColor(int,int,int)
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 PImage
PImage.blendColor(int,int,int)
public void save(java.lang.String filename)
PImage
As 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 0116, savePath() is not needed if this object has been created (as recommended) via createImage() or createGraphics() or one of its neighbors.
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 or .tif as the extension, or don't include an extension. When no extension is used, the extension .tif will be added to the file name.
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.
save
in class PImage
public 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 |