MCPcopy Index your code

hub / github.com/tdewolff/canvas / functions

Functions1,447 in github.com/tdewolff/canvas

↓ 15 callersMethodQuadTo
QuadTo adds a quadratic Bézier path with control point (cpx,cpy) and end point (x,y).
path.go:453
↓ 15 callersMethodShear
Shear adds a shear transformation with sx the horizontal shear and sy the vertical shear.
util.go:686
↓ 15 callersMethodToPath
ToPath converts the rectangle to a path.
util.go:606
↓ 15 callersFunctionWrite
Write renders the canvas and writes to a file. A renderer is chosen based on the filename extension. The options will be passed to the respective rend
renderers/renderers.go:28
↓ 15 callersFunctionerrorWriter
(err error)
renderers/renderers.go:62
↓ 15 callersMethodlen
()
latex_dvi.go:295
↓ 15 callersMethodreadUint32
()
latex_dvi.go:310
↓ 14 callersMethodDraw
(canvasFont.Pather, float64, float64, uint32)
latex_dvi.go:36
↓ 14 callersMethodGetDict
(val any)
cmd/pdftext/reader.go:367
↓ 14 callersMethodIsGradient
IsGradient returns true when paint is a gradient.
canvas.go:135
↓ 14 callersMethodRot
Rot rotates the line OP by phi radians CCW.
util.go:290
↓ 14 callersFunctionToOpacity
(col color.Color, a float64)
colors.go:29
↓ 14 callersFunctionellipseDeriv
(rx, ry, phi float64, sweep bool, theta float64)
path_util.go:16
↓ 14 callersMethodreadByte
()
latex_dvi.go:299
↓ 13 callersMethodAngleBetween
AngleBetween returns the angle in radians [-PI,PI] from OP to OQ.
util.go:332
↓ 13 callersMethodBounds
Fit shrinks the canvas' size that so all elements fit with a given margin in millimeters.
canvas.go:801
↓ 13 callersMethodHas
(rune)
cmd/pdftext/encoding.go:17
↓ 13 callersMethodIsColor
IsColor returns true when paint is a uniform color.
canvas.go:130
↓ 13 callersMethodIsSimilarity
IsSimilarity is true if the matrix consists of only translation, rotation, reflection, and uniform scaling transformations. Uniform scaling means that
util.go:842
↓ 13 callersMethodLen
Len returns the number of segments.
path.go:287
↓ 13 callersMethodName
Name returns the name of the font.
font.go:313
↓ 13 callersMethodSetStrokeWidth
SetStrokeWidth sets the width in millimeters for stroking operations. The default stroke width is 1.0.
canvas.go:458
↓ 12 callersMethodContains
Contains returns true if r contains q.
util.go:564
↓ 12 callersMethodDecode
([]byte)
cmd/pdftext/encoding.go:19
↓ 12 callersMethodEquals
(o Intersection)
path_intersection_util.go:105
↓ 12 callersMethodFlatten
Flatten flattens all Bézier and arc curves into linear segments and returns a new path. It uses tolerance as the maximum deviation.
path.go:1448
↓ 12 callersFunctionNewRichText
NewRichText returns a new rich text with the given default font face.
text.go:444
↓ 12 callersMethodOffset
Offset offsets the path by w and returns a new path. A positive w will offset the path to the right-hand side, that is, it expands CCW oriented contou
path_stroke.go:634
↓ 12 callersFunctionParseSVGPath
ParseSVGPath parses an SVG path data string.
path.go:2084
↓ 12 callersFunctionPenalty
Penalty returns a penalty item (explicit or possible newline, hyphen) with a given penalization factor. For hyphen insertion, width is the hyphen widt
text/linebreak.go:182
↓ 12 callersMethodReverseScanner
ReverseScanner returns a path scanner in reverse order.
path_scanner.go:11
↓ 12 callersMethodRot90CW
Rot90CW rotates the line OP by 90 degrees CW.
util.go:280
↓ 12 callersMethodToSVG
ToSVG returns a string that represents the path in the SVG path data format with minification.
path.go:2291
↓ 12 callersFunctionangleEqual
angleEqual returns true if both angles are equal.
util.go:64
↓ 12 callersFunctioncohenSutherlandOutcode
(rect Rect, p Point, eps float64)
util.go:887
↓ 12 callersMethodget
(val any)
cmd/pdftext/reader.go:305
↓ 12 callersMethodwriteObject
(val interface{})
renderers/pdf/writer.go:280
↓ 11 callersMethodArc
Arc adds an elliptical arc with radii rx and ry, with rot the counter clockwise rotation in degrees, and theta0 and theta1 the angles in degrees of th
path.go:535
↓ 11 callersMethodBounds
Bounds returns the exact bounding box rectangle of the path.
path.go:1108
↓ 11 callersMethodClose
()
cmd/pdftext/writer.go:99
↓ 11 callersMethodClose
()
renderers/ps/ps.go:80
↓ 11 callersMethodClosed
Closed returns true if the last subpath of p is a closed path.
path.go:247
↓ 11 callersMethodIsPattern
IsPattern returns true when paint is a pattern.
canvas.go:140
↓ 11 callersMethodPos
Pos returns the current position of the path, which is the end point of the last command.
path.go:366
↓ 11 callersMethodTile
P1 wallpaper group var P1 = []Matrix{Identity} Pm wallpaper group var Pm = []Matrix{ Identity, Identity.ReflectYAbout(0.5), } Pg wallpaper group v
path_tiling.go:293
↓ 11 callersFunctionaddCubicBezierLine
(p *Path, p0, p1, p2, p3 Point, t, d float64)
path_util.go:678
↓ 11 callersFunctiondraw
(ctx *canvas.Context, y float64, p, q *canvas.Path)
resources/boolean/main.go:94
↓ 11 callersFunctionpdfWriteVal
(w io.Writer, r *pdfReader, ref pdfRef, i any)
cmd/pdftext/writer.go:191
↓ 10 callersMethodCopy
()
text.go:463
↓ 10 callersMethodDiv
Div divides x and y by f.
util.go:275
↓ 10 callersMethodFastBounds
FastBounds returns the maximum bounding box rectangle of the path. It is quicker than Bounds.
path.go:1056
↓ 10 callersFunctionIntervalExclusive
IntervalExclusive returns true if f is in open interval [lower+Epsilon,upper-Epsilon] where lower and upper can be interchanged.
util.go:56
↓ 10 callersFunctionRoundedRectangle
RoundedRectangle returns a rectangle of width w and height h with rounded corners of radius r. A negative radius will cast the corners inwards (i.e. c
shapes.go:45
↓ 10 callersMethodString
()
renderers/pdf/util.go:31
↓ 10 callersMethodStroke
Stroke converts a path into a stroke of width w and returns a new path. It uses cr to cap the start and end of the path, and jr to join all path eleme
path_stroke.go:658
↓ 10 callersMethodTouches
Touches returns true if both rectangles touch (or overlap).
util.go:581
↓ 10 callersMethodTransform
Transform transforms the path by the given transformation matrix. It modifies the path in-place.
path.go:1267
↓ 10 callersFunctiondrawPos
(c *canvas.Context, x, y float64)
resources/docs/paths/main.go:24
↓ 10 callersFunctiondrawStrokedPath
(c *canvas.Context, x, y float64, path string, cr canvas.Capper, jr canvas.Joiner)
resources/docs/stroke/main.go:28
↓ 10 callersFunctiondrawText
(c *canvas.Context, x, y float64, text string)
resources/docs/stroke/main.go:43
↓ 10 callersFunctionfontDecorate
(face *FontFace, width float64)
font_test.go:57
↓ 10 callersFunctionpdfReadContentVal
(b []byte)
cmd/pdftext/reader.go:548
↓ 10 callersMethodpoint
(p canvas.Point)
renderers/gio/gio.go:84
↓ 10 callersMethodwrite
(s string, v ...any)
cmd/pdftext/writer.go:74
↓ 9 callersMethodCSS
CSS returns the CSS boldness value for the font face.
font.go:44
↓ 9 callersMethodDash
Dash returns a new path that consists of dashes. The elements in d specify the width of the dashes and gaps. It will alternate between dashes and gaps
path.go:1856
↓ 9 callersMethodDet
Det returns the matrix determinant.
util.go:725
↓ 9 callersMethodGetInt
(val any)
cmd/pdftext/reader.go:331
↓ 9 callersMethodGetString
(val any)
cmd/pdftext/reader.go:343
↓ 9 callersMethodIntersects
Intersects returns true if both shapes have at least one point in common, ie. they may touch/overlap/contain/equal.
path_intersection.go:2452
↓ 9 callersMethodMerge
()
path.go:115
↓ 9 callersMethodPrev
()
path_intersection.go:539
↓ 9 callersFunctionRegularPolygon
RegularPolygon returns a regular polygon with radius r. It uses n vertices/edges, so when n approaches infinity this will return a path that approxima
shapes.go:123
↓ 9 callersMethodRot90CCW
Rot90CCW rotates the line OP by 90 degrees CCW.
util.go:285
↓ 9 callersMethodScale
Scale applies a scaling transform to the context
renderers/gonumplot.go:92
↓ 9 callersMethodSetStrokeJoiner
SetStrokeJoiner sets the line join function to be used for stroke mid points. The default stroke joiner is a miter join with a limit of 4.0 for a beve
canvas.go:468
↓ 9 callersMethodStroke
Stroke strokes the path.
renderers/gochart.go:139
↓ 9 callersFunctionaddIntersections
type SweepPointPair [2]*SweepPoint func (pair SweepPointPair) Swapped() SweepPointPair { return SweepPointPair{pair[1], pair[0]} }
path_intersection.go:1137
↓ 9 callersFunctionangleBetween
angleBetween is true when theta is in range [lower,upper] including the end points. Angles can be outside the [0,2PI) range.
util.go:101
↓ 9 callersFunctionangleTime
angleTime returns the time [0.0,1.0] of theta between [lower,upper]. When outside of [lower,upper], the result will also be outside of [0.0,1.0].
util.go:78
↓ 9 callersFunctiondraw
(ctx *canvas.Context, i, j int, text string, hatch *canvas.HatchPattern)
resources/docs/hatches/main.go:37
↓ 9 callersFunctionrgbaColor
(col color.Color)
util.go:193
↓ 8 callersMethodAnd
And returns the rectangle that is the overlap of both.
util.go:593
↓ 8 callersMethodCP1
CP1 returns the first control point for quadratic and cubic Béziers.
path.go:1983
↓ 8 callersFunctionDraw
TODO: add ASM optimized version for NRGBA images, since those are much faster to write as PNG Draw draws the canvas on a new image with given resoluti
renderers/rasterizer/rasterizer.go:20
↓ 8 callersMethodEnd
End returns the current path segment end position.
path_scanner.go:159
↓ 8 callersMethodGetStream
(val any)
cmd/pdftext/reader.go:379
↓ 8 callersMethodInv
Inv returns the matrix inverse.
util.go:730
↓ 8 callersMethodIsText
IsText returns true if the text span is text and not objects (such as images or paths).
text.go:202
↓ 8 callersMethodItalic
Italic returns true if italic.
font.go:34
↓ 8 callersFunctionNewRadialGradient
NewRadialGradient returns a new radial gradient pattern.
colors.go:221
↓ 8 callersFunctionNewTextBox
NewTextBox is an advanced text formatter that will format text placement based on the settings. It takes a single font face, a string, the width or he
text.go:414
↓ 8 callersMethodRelate
Relate returns the spatial relation as defined by DE-9IM between the two paths as well as the intersections between both. It is faster if you need to
path_intersection.go:227
↓ 8 callersMethodRotate
Rotate applies a rotation transform to the context. The parameter is specified in radians.
renderers/gonumplot.go:80
↓ 8 callersMethodSetDashes
SetDashes sets the dash phase and array.
renderers/pdf/writer.go:1071
↓ 8 callersMethodSetFill
SetFill sets the filling paint.
renderers/pdf/writer.go:974
↓ 8 callersFunctionStarPolygon
StarPolygon returns a star polygon of n points with alternating radius R and r. The up boolean defines whether the first point will be point upwards o
shapes.go:154
↓ 8 callersMethodTextWidth
TextWidth returns the width of a given string in millimeters.
font.go:705
↓ 8 callersFunctiondrawText
(ctx *canvas.Context, x, y float64, halign, valign canvas.TextAlign)
resources/docs/text/main.go:108
↓ 8 callersMethodpush
(tag string, attrs map[string]string)
svg.go:117
← previousnext →101–200 of 1,447, ranked by callers