Vector Nodes¶
-
class
libavg.avg.CircleNode([r=1, texcoord1=0, texcoord2=1])¶ Bases:
libavg.avg.FilledVectorNodeA circle. The reference point for a circle is its center.
-
r¶ The radius of the circle in pixels.
-
texcoord1¶
-
texcoord2¶ floats used as u texture coordinates for the circle border. The coordinates wrap around the circle once.
-
-
class
libavg.avg.CurveNode([pos1, pos2, pos3, pos4, texcoord1, texcoord2])¶ Bases:
libavg.avg.VectorNodeA cubic bezier curve (http://en.wikipedia.org/wiki/Bezier_curve).
pos1andpos4are the two endpoints of the curve.pos2andpos3are control points.-
getPtOnCurve(t) → pos¶ Returns a point on the curve. Which point is determined by the value of t. If
t=0, returnspos1.t=1returnspos4, and values in between return the points in between.
-
length¶ Returns an approximation of the length of the curve (ro).
-
pos1¶
-
pos2¶
-
pos3¶
-
pos4¶
-
texcoord1¶
-
texcoord2¶ floats that signify the u axis texture coordinates.
-
-
class
libavg.avg.FilledVectorNode([filltexhref, fillopacity=0, fillcolor="FFFFFF", filltexcoord1=Point2D(0, 0), filltexcoord2=Point2D(1, 1)])¶ Bases:
libavg.avg.VectorNodeBase class for vector nodes which have a filled area and a border. The area can be filled either with a solid color (
fillcolor) or with a texture loaded from a file (filltexhref), or taken from a bitmap object (setFillBitmap()).-
fillcolor¶
-
fillopacity¶
-
filltexcoord1¶
-
filltexcoord2¶
-
filltexhref¶ An image file to use as a texture for the area of the node.
-
setFillBitmap(bitmap)¶ Sets a bitmap to use as a fill texture. Sets
filltexhrefto an empty string.
-
-
class
libavg.avg.LineNode([pos1, pos2, texcoord1, texcoord2])¶ Bases:
libavg.avg.VectorNodeA line.
pos1andpos2are the two endpoints of the line.-
pos1¶
-
pos2¶
-
texcoord1¶
-
texcoord2¶ floats that signify the u axis texture coordinates.
-
-
class
libavg.avg.MeshNode([vertexcoords, texcoords, triangles])¶ Bases:
libavg.avg.VectorNodeThis is a generalized mesh of textured triangles. See https://www.libavg.de/wiki/ProgrammersGuide/MeshNode for an example.
-
texcoords¶
-
triangles¶
-
vertexcoords¶
-
-
class
libavg.avg.PolygonNode([linejoin="bevel", pos, texcoords])¶ Bases:
libavg.avg.FilledVectorNodeA closed figure bounded by a number of line segments, optionally filled. Filled polygons may not be self-intersecting.
-
linejoin¶ The method by which line segments are joined together. Valid values are
bevelandmiter.
-
pos¶ A sequence (
listortuple) of pixel positions.
-
texcoords¶ A sequence of float texture coordinates along the u axis of the texture, used for the polygon border. It can contain either one coordinate per entry in pos (plus an additional one to close the polygon) or two coordinates that are interpolated to wrap around the
PolygonNodeonce.
-
-
class
libavg.avg.PolyLineNode([linejoin="bevel", pos, texcoords])¶ Bases:
libavg.avg.VectorNodeA figure similar to a
PolygonNode, but not closed and never filled.-
linejoin¶ The method by which line segments are joined together. Valid values are
bevelandmiter.
-
pos¶ A sequence (
listortuple) of pixel positions.
-
texcoords¶ A sequence of float texture coordinates along the u axis of the texture. It can contain either one coordinate per entry in pos or two coordinates, one for either end of the
PolyLine.
-
-
class
libavg.avg.RectNode([pos, size, angle])¶ Bases:
libavg.avg.FilledVectorNodeA rectangle that can be filled.
-
angle¶ The angle that the rectangle is rotated to in radians. 0 is unchanged, 3.14 is upside-down. The rectangle is rotated around its center.
-
pos¶ The position of the top left corner of the rectangle.
-
size¶
-
texcoords¶ A sequence of
5texture coordinates for the border of the rectangle, which wrap around the node.
-
-
class
libavg.avg.VectorNode([color="FFFFFF", strokewidth=1, texhref, blendmode="blend"])¶ Bases:
libavg.avg.NodeBase class for all nodes that draw geometrical primitives. All vector nodes support configurable stroke width. Strokes can be filled either with a solid color (
color) or with a texture loaded from a file (texhref) or taken from a bitmap object (setBitmap()).When using textured
VectorNodes, texture coordinates can be set. Generally, texture bitmaps are mapped to coordinates(u,v) = (0,0)-(1,1), and the texture is repeated for coordinates outside this range. Theutexture coordinate increases along the stroke, while thevcoordinate increases perpendicular to it.-
blendmode¶ The method of compositing the node with the nodes under it. Valid values are
blend,add,minandmax. Forminandmaxblend modes, opacity is ignored.
-
strokewidth¶ The width of the strokes in the vector. For lines, this is the line width. For rectangles, it is the width of the outline, etc.
-
texhref¶ An image file to use as a texture for the node.
-
-
class
libavg.geom.Arc(radius, startangle, endangle[, pos=(0, 0)])¶ Bases:
libavg.avg.PolyLineNodeAn unfilled arc (incomplete circle) from
startangletoendangle.posis the center of the circle.-
endangle¶
-
pos¶
-
radius¶
-
startangle¶
-
-
class
libavg.geom.PieSlice(radius, startangle, endangle[, pos=(0, 0)])¶ Bases:
libavg.avg.PolygonNodeAn arc (incomplete circle) from
startangletoendangleconnected to the center of the circle.posis the center of the circle. APieSlicecan be filled.-
endangle¶
-
pos¶
-
radius¶
-
startangle¶
-