Class IldaRenderer
- All Implemented Interfaces:
Cloneable,processing.core.PConstants
You can use this class in the same way as you would use another PGraphics. For example you can use most graphic calls on an instance of this class. Usage: as opposed to most PGraphic subclasses, you may use the constructor to create an instance of IldaRenderer. You must call beginDraw() and endDraw() around any graphic calls.
Example: r = new IldaRenderer(ilda);
r.beginDraw();
r.stroke(255,0,0);
r.line(50,
100,25,60); //draws a
red line
r.endDraw();
It is ill advised to create a new IldaRenderer instance in draw(). Multiple frames can be created sequentially using the same instance of IldaRenderer.
-
Nested Class Summary
Nested classes/interfaces inherited from class processing.core.PGraphics
processing.core.PGraphics.AsyncImageSaver -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intprotected IldaFrameprotected floatprotected floatprotected Fileprotected IldaPointprotected floatprotected floatprotected floatprotected booleanFields inherited from class processing.core.PGraphics
A, AB, AG, ambientB, ambientColor, ambientG, ambientR, AR, asyncImageSaver, autoNormal, B, backgroundA, backgroundAi, backgroundAlpha, backgroundB, backgroundBi, backgroundColor, backgroundG, backgroundGi, backgroundR, backgroundRi, BEEN_LIT, bezierBasisInverse, bezierBasisMatrix, bezierDetail, bezierDrawMatrix, bezierInited, blendMode, cacheMap, calcA, calcAi, calcAlpha, calcB, calcBi, calcColor, calcG, calcGi, calcR, calcRi, colorMode, colorModeA, colorModeX, colorModeY, colorModeZ, cosLUT, curveBasisMatrix, curveDetail, curveDrawMatrix, curveInited, curveTightness, curveToBezierMatrix, curveVertexCount, curveVertices, DA, DB, DEFAULT_STROKE_CAP, DEFAULT_STROKE_JOIN, DEFAULT_STROKE_WEIGHT, DEFAULT_VERTICES, defaultFontName, DG, DR, EB, edge, EDGE, EG, ellipseMode, emissiveB, emissiveColor, emissiveG, emissiveR, ER, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, fill, fillA, fillAi, fillAlpha, fillB, fillBi, fillColor, fillG, fillGi, fillR, fillRi, G, HAS_NORMAL, hints, image, imageMode, NORMAL_MODE_AUTO, NORMAL_MODE_SHAPE, NORMAL_MODE_VERTEX, normalMode, normalX, normalY, normalZ, NX, NY, NZ, path, pixelCount, primaryGraphics, R, raw, reapplySettings, rectMode, SA, SB, setAmbient, settingsInited, SG, shape, shapeMode, SHINE, shininess, SINCOS_LENGTH, SINCOS_PRECISION, sinLUT, smooth, SPB, specularB, specularColor, specularG, specularR, SPG, sphereDetailU, sphereDetailV, sphereX, sphereY, sphereZ, SPR, SR, stroke, strokeA, strokeAi, strokeAlpha, strokeB, strokeBi, strokeCap, strokeColor, strokeG, strokeGi, strokeJoin, strokeR, strokeRi, strokeWeight, surface, SW, textAlign, textAlignY, textBreakCount, textBreakStart, textBreakStop, textBuffer, textFont, textLeading, textMode, textSize, textureImage, textureMode, textureU, textureV, textWidthBuffer, tint, tintA, tintAi, tintAlpha, tintB, tintBi, tintColor, tintG, tintGi, tintR, tintRi, TX, TY, TZ, U, V, VERTEX_FIELD_COUNT, vertexCount, vertices, VW, VX, VY, VZ, warningsFields inherited from class processing.core.PImage
ALPHA_MASK, BLUE_MASK, format, GREEN_MASK, height, loaded, modified, mx1, mx2, my1, my2, parent, pixelDensity, pixelHeight, pixels, pixelWidth, RED_MASK, widthFields inherited from interface processing.core.PConstants
ADD, ALPHA, ALT, AMBIENT, ARC, ARGB, ARROW, BACKSPACE, BASELINE, BEVEL, BEZIER_VERTEX, BLEND, BLUR, BOTTOM, BOX, BREAK, BURN, CENTER, CHATTER, CHORD, CLAMP, CLOSE, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CURVE_VERTEX, CUSTOM, DARKEST, DEG_TO_RAD, DELETE, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ASYNC_SAVEFRAME, DISABLE_BUFFER_READING, DISABLE_DEPTH_MASK, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_KEY_REPEAT, DISABLE_NATIVE_FONTS, DISABLE_OPENGL_ERRORS, DISABLE_OPTIMIZED_STROKE, DISABLE_STROKE_PERSPECTIVE, DISABLE_STROKE_PURE, DISABLE_TEXTURE_MIPMAPS, DODGE, DOWN, DXF, ELLIPSE, ENABLE_ASYNC_SAVEFRAME, ENABLE_BUFFER_READING, ENABLE_DEPTH_MASK, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_KEY_REPEAT, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_ERRORS, ENABLE_OPTIMIZED_STROKE, ENABLE_STROKE_PERSPECTIVE, ENABLE_STROKE_PURE, ENABLE_TEXTURE_MIPMAPS, ENTER, EPSILON, ERODE, ESC, EXCLUSION, FX2D, GIF, GRAY, GROUP, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LANDSCAPE, LEFT, LIGHTEST, LINE, LINE_LOOP, LINE_STRIP, LINES, LINUX, MACOS, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MODELVIEW, MOVE, MULTIPLY, NORMAL, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, PIE, platformNames, POINT, POINTS, POLYGON, PORTRAIT, POSTERIZE, PROBLEM, PROJECT, PROJECTION, QUAD, QUAD_BEZIER_VERTEX, QUAD_STRIP, QUADRATIC_VERTEX, QUADS, QUARTER_PI, RAD_TO_DEG, RADIUS, RECT, REPEAT, REPLACE, RETURN, RGB, RIGHT, ROUND, SCREEN, SHAPE, SHIFT, SOFT_LIGHT, SPAN, SPHERE, SPOT, SQUARE, SUBTRACT, SVG, TAB, TARGA, TAU, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, UP, VERTEX, WAIT, WHITESPACE, WINDOWS, X, Y, Z -
Constructor Summary
ConstructorsConstructorDescriptionIldaRenderer(@NotNull processing.core.PApplet parent) IldaRenderer(@Nullable processing.core.PApplet parent, int width, int height) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyMatrix(float n00, float n01, float n02, float n10, float n11, float n12) voidapplyMatrix(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33) protected voidapplyMatrixImpl(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33) NOT interested in debugging this if it's even bugged maybe it magically works idk idcvoidvoidvoidAlways call this before drawing!voidbeginShape(int kind) voidvoidClears the frame.protected voiddefaultFontOrDeath(String method, float size) voiddispose()voiddrawIldaFrame(IldaFrame frame) voiddrawIldaFrame(IldaFrame frame, int x, int y) voiddrawIldaFrame(IldaFrame frame, int x, int y, int w, int h) Draw an existing ilda frame inside the rendererprotected voidellipseImpl(float x, float y, float w, float h) voidvoidendDraw()Always call this after drawing!voidendShape()voidendShape(int kind) Get the current frame that's being drawn onGet all frames stored in the rendererintHow many frames are there?doubleprocessing.core.PVectorGet the current translation vectorbooleanis2D()booleanis3D()booleanReturns the overwrite setting, whether the renderer keeps drawing on the same frame or if it creates a new frame each time beginDraw() is called.voidvoidvoidvoidresize(int newWidth, int newHeight) voidrotate(float angle) voidrotate(float angle, float v0, float v1, float v2) voidrotateX(float angle) voidrotateY(float angle) voidrotateZ(float angle) voidscale(float x, float y, float z) voidsetEllipseCorrection(int correction) Sets the amount of points the ellipse should overshoot or continue drawing, to avoid a gap .voidsetEllipseDetail(float detail) Number reflecting the amount of points in an ellipse.voidsetOptimisationSettings(OptimisationSettings settings) voidsetOptimise(boolean shouldOptimise) Should the frame be optimised for rendering?voidsetOverwrite(boolean overwrite) If set to true, no new frame will be added to the frame list when calling EndDraw().voidCurrently saving is not implemented in the renderer, use writeFile() in the main ilda class instead.voidsetTextDetail(double textDetail) Defines a minimal distance, in terms of fraction of the size of the font, in which no points are generated.protected voidsetTranslation(float x, float y, float z) protected voidtextCharImpl(char ch, float x, float y) Well wouldn't it be boss if this "just worked"!!!voidtranslate(float x, float y) voidtranslate(float x, float y, float z) voidvertex(float x, float y) voidvertex(float x, float y, float z) Methods inherited from class processing.core.PGraphics
alpha, ambient, ambient, ambient, ambientFromCalc, ambientLight, ambientLight, applyMatrix, applyMatrix, applyMatrix, arc, arc, arcImpl, attrib, attrib, attrib, attribColor, attribNormal, attribPosition, awaitAsyncSaveCompletion, background, background, background, background, background, background, background, backgroundFromCalc, backgroundImpl, backgroundImpl, beginCamera, beginPGL, beginRaw, beginShape, bezier, bezier, bezierDetail, bezierInit, bezierInitCheck, bezierPoint, bezierTangent, bezierVertex, bezierVertex, bezierVertexCheck, bezierVertexCheck, blendMode, blendModeImpl, blue, box, box, brightness, camera, camera, checkSettings, circle, clear, clip, clipImpl, color, color, color, color, color, color, color, color, color, colorCalc, colorCalc, colorCalc, colorCalc, colorCalc, colorCalc, colorCalcARGB, colorMode, colorMode, colorMode, colorMode, createDefaultFont, createFont, createShape, createShape, createShape, createShapeFamily, createShapePrimitive, createSurface, curve, curve, curveDetail, curveInit, curveInitCheck, curvePoint, curveTangent, curveTightness, curveVertex, curveVertex, curveVertexCheck, curveVertexCheck, curveVertexSegment, curveVertexSegment, defaultFontOrDeath, defaultSettings, directionalLight, displayable, edge, ellipse, ellipseMode, emissive, emissive, emissive, emissiveFromCalc, endCamera, endPGL, endRaw, fill, fill, fill, fill, fill, fill, fillFromCalc, filter, flush, frustum, getCache, getMatrix, getMatrix, getMatrix, getRaw, getStyle, getStyle, green, handleTextSize, haveRaw, hint, hue, image, image, image, imageImpl, imageMode, is2X, isGL, lerpColor, lerpColor, lightFalloff, lights, lightSpecular, line, line, loadShader, loadShader, loadShape, loadShape, modelX, modelY, modelZ, noClip, noFill, noLights, normal, noSmooth, noStroke, noTexture, noTint, ortho, ortho, ortho, perspective, perspective, point, point, pointLight, pop, popStyle, printCamera, printMatrix, printProjection, processImageBeforeAsyncSave, push, pushStyle, quad, quadraticVertex, quadraticVertex, reapplySettings, rect, rect, rect, rectImpl, rectImpl, rectMode, red, removeCache, resetShader, resetShader, saturation, save, scale, scale, screenX, screenX, screenY, screenY, screenZ, setCache, setMatrix, setMatrix, setMatrix, setParent, setPrimary, setSize, shader, shader, shape, shape, shape, shape, shape, shapeMode, shearX, shearY, shininess, showDepthWarning, showDepthWarningXYZ, showException, showMethodWarning, showMissingWarning, showVariationWarning, showWarning, showWarning, smooth, smooth, specular, specular, specular, specularFromCalc, sphere, sphereDetail, sphereDetail, splineForward, spotLight, square, stroke, stroke, stroke, stroke, stroke, stroke, strokeCap, strokeFromCalc, strokeJoin, strokeWeight, style, text, text, text, text, text, text, text, text, text, text, text, textAlign, textAlign, textAscent, textCharModelImpl, textDescent, textFont, textFont, textFontImpl, textLeading, textLineAlignImpl, textLineImpl, textMode, textModeCheck, textSentence, textSentenceBreak, textSize, textSizeImpl, texture, textureMode, textureWrap, textWidth, textWidth, textWidth, textWidthImpl, tint, tint, tint, tint, tint, tint, tintFromCalc, triangle, vertex, vertex, vertex, vertexCheck, vertexTextureMethods inherited from class processing.core.PImage
blend, blend, blendColor, blurAlpha, blurARGB, blurRGB, buildBlurKernel, checkAlpha, clone, copy, copy, copy, dilate, erode, filter, filter, get, get, get, getImage, getImpl, getModifiedX1, getModifiedX2, getModifiedY1, getModifiedY2, getNative, init, init, isLoaded, isModified, loadPixels, loadTGA, mask, mask, saveImpl, saveTGA, set, set, setImpl, setLoaded, setLoaded, setModified, setModified, updatePixels, updatePixels
-
Field Details
-
file
-
currentFrame
-
count
protected int count -
theFrames
-
invWidth
protected float invWidth -
invHeight
protected float invHeight -
shouldBlank
protected boolean shouldBlank -
closedShape
protected boolean closedShape -
firstPoint
-
depth
protected float depth -
ellipseDetail
protected float ellipseDetail -
invDepth
protected float invDepth
-
-
Constructor Details
-
IldaRenderer
public IldaRenderer(@NotNull @NotNull processing.core.PApplet parent) -
IldaRenderer
public IldaRenderer(@Nullable @Nullable processing.core.PApplet parent, int width, int height)
-
-
Method Details
-
isOverwrite
public boolean isOverwrite()Returns the overwrite setting, whether the renderer keeps drawing on the same frame or if it creates a new frame each time beginDraw() is called.- Returns:
- boolean - is false if a new IldaFrame is created upon each draw.
-
setOverwrite
public void setOverwrite(boolean overwrite) If set to true, no new frame will be added to the frame list when calling EndDraw(). Instead, the renderer will keep writing on the same frame. This is useful for drawing applications where you want to keep adding content to the same frame instead of making an animation. False by default.- Parameters:
overwrite- boolean - should the renderer keep writing on the same frame?
-
setPath
Currently saving is not implemented in the renderer, use writeFile() in the main ilda class instead.- Overrides:
setPathin classprocessing.core.PGraphics- Parameters:
path- should be a path leading to a file
-
resize
public void resize(int newWidth, int newHeight) - Overrides:
resizein classprocessing.core.PImage
-
beginDraw
public void beginDraw()Always call this before drawing!- Overrides:
beginDrawin classprocessing.core.PGraphics
-
endDraw
public void endDraw()Always call this after drawing!- Overrides:
endDrawin classprocessing.core.PGraphics
-
translate
public void translate(float x, float y) - Overrides:
translatein classprocessing.core.PGraphics
-
translate
public void translate(float x, float y, float z) - Overrides:
translatein classprocessing.core.PGraphics
-
resetMatrix
public void resetMatrix()- Overrides:
resetMatrixin classprocessing.core.PGraphics
-
rotate
public void rotate(float angle) - Overrides:
rotatein classprocessing.core.PGraphics
-
rotateX
public void rotateX(float angle) - Overrides:
rotateXin classprocessing.core.PGraphics
-
rotateY
public void rotateY(float angle) - Overrides:
rotateYin classprocessing.core.PGraphics
-
rotateZ
public void rotateZ(float angle) - Overrides:
rotateZin classprocessing.core.PGraphics
-
rotate
public void rotate(float angle, float v0, float v1, float v2) - Overrides:
rotatein classprocessing.core.PGraphics
-
scale
public void scale(float x, float y, float z) - Overrides:
scalein classprocessing.core.PGraphics
-
pushMatrix
public void pushMatrix()- Overrides:
pushMatrixin classprocessing.core.PGraphics
-
popMatrix
public void popMatrix()- Overrides:
popMatrixin classprocessing.core.PGraphics
-
getTranslation
public processing.core.PVector getTranslation()Get the current translation vector- Returns:
- the center of the origin relative to the sketch' origin
-
setTranslation
protected void setTranslation(float x, float y, float z) -
beginShape
public void beginShape(int kind) - Overrides:
beginShapein classprocessing.core.PGraphics
-
beginContour
public void beginContour()- Overrides:
beginContourin classprocessing.core.PGraphics
-
vertex
public void vertex(float x, float y) - Overrides:
vertexin classprocessing.core.PGraphics
-
vertex
public void vertex(float x, float y, float z) - Overrides:
vertexin classprocessing.core.PGraphics
-
endContour
public void endContour()- Overrides:
endContourin classprocessing.core.PGraphics
-
endShape
public void endShape()- Overrides:
endShapein classprocessing.core.PGraphics
-
endShape
public void endShape(int kind) - Overrides:
endShapein classprocessing.core.PGraphics
-
ellipseImpl
protected void ellipseImpl(float x, float y, float w, float h) - Overrides:
ellipseImplin classprocessing.core.PGraphics
-
textCharImpl
protected void textCharImpl(char ch, float x, float y) Well wouldn't it be boss if this "just worked"!!! Should be automatically called by the several text() implementations of the parent PGraphics class- Overrides:
textCharImplin classprocessing.core.PGraphics- Parameters:
ch- the characterx- position xy- position y
-
applyMatrix
public void applyMatrix(float n00, float n01, float n02, float n10, float n11, float n12) - Overrides:
applyMatrixin classprocessing.core.PGraphics
-
applyMatrix
public void applyMatrix(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33) - Overrides:
applyMatrixin classprocessing.core.PGraphics
-
applyMatrixImpl
protected void applyMatrixImpl(float n00, float n01, float n02, float n03, float n10, float n11, float n12, float n13, float n20, float n21, float n22, float n23, float n30, float n31, float n32, float n33) NOT interested in debugging this if it's even bugged maybe it magically works idk idc -
setEllipseDetail
public void setEllipseDetail(float detail) Number reflecting the amount of points in an ellipse. The lower, the fewer points there are. The higher, the more. The default value is 1. Finding a good value is a bit arbitrary. This value is multiplied by the sum of the third and fourth arguments of the ellipse method (the width and height).- Parameters:
detail- gets multiplied with (width+height) of the ellipse arguments to get the total points
-
setEllipseCorrection
public void setEllipseCorrection(int correction) Sets the amount of points the ellipse should overshoot or continue drawing, to avoid a gap . Can be negative to leave a gap. Default is 0.- Parameters:
correction- for how many extra points the ellipse continues
-
defaultFontOrDeath
- Overrides:
defaultFontOrDeathin classprocessing.core.PGraphics
-
drawIldaFrame
Draw an existing ilda frame inside the renderer- Parameters:
frame- frame to be drawnx- x position offsety- y position offsetw- width (rescaling)h- height (rescaling)
-
drawIldaFrame
-
drawIldaFrame
-
dispose
public void dispose()- Overrides:
disposein classprocessing.core.PGraphics
-
is2D
public boolean is2D()- Overrides:
is2Din classprocessing.core.PGraphics
-
is3D
public boolean is3D()- Overrides:
is3Din classprocessing.core.PGraphics
-
getFrames
Get all frames stored in the renderer- Returns:
- all frames in the renderer
-
getCurrentFrame
Get the current frame that's being drawn on- Returns:
- current frame
-
getFramesAmount
public int getFramesAmount()How many frames are there?- Returns:
- how many frames are currently in the renderer
-
clearFrame
public void clearFrame()Clears the frame. -
clearAllFrames
public void clearAllFrames() -
background
public void background() -
setOptimise
public void setOptimise(boolean shouldOptimise) Should the frame be optimised for rendering? If set to false, as little points as possible are used to represent the art. If set to true, the frame will be optimised for display using this renderer's OptimisationSettings.- Parameters:
shouldOptimise- should the frame be optimised?
-
getOptimisationSettings
-
setOptimisationSettings
-
getTextDetail
public double getTextDetail() -
setTextDetail
public void setTextDetail(double textDetail) Defines a minimal distance, in terms of fraction of the size of the font, in which no points are generated. Necessary to reduce point count in curved letters.- Parameters:
textDetail- minimal distance between two points in text characters
-