Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/tdewolff/canvas
/ functions
Functions
1,447 in github.com/tdewolff/canvas
⨍
Functions
1,447
◇
Types & classes
214
↓ 7 callers
Method
Coords
Coords returns the list of coordinates of the polyline.
polyline.go:53
↓ 7 callers
Method
Fit
Fit shrinks the canvas' size that so all elements fit with a given margin in millimeters.
canvas.go:837
↓ 7 callers
Method
GetArray
(val any)
cmd/pdftext/reader.go:355
↓ 7 callers
Method
IsDashed
IsDashed returns true if the style has dashes
canvas.go:189
↓ 7 callers
Method
IsTranslation
IsTranslation is true if the matrix consists of only translational components, i.e. no rotation, scaling, or skew transformations.
util.go:808
↓ 7 callers
Function
PNG
PNG returns a PNG writer and accepts the following options: canvas.Resolution, canvas.Colorspace, image/png.Encoder
renderers/renderers.go:69
↓ 7 callers
Method
PPEM
PPEM returns the pixels-per-EM for a given resolution of the font face.
font.go:685
↓ 7 callers
Function
ParseSVG
(r io.Reader)
svg.go:1109
↓ 7 callers
Method
Pos
()
cmd/pdftext/reader.go:890
↓ 7 callers
Function
PrimitiveCell
PrimitiveCell is a (primitive) cell used for tiling.
path_tiling.go:10
↓ 7 callers
Function
ScaleDash
(scale float64, offset float64, d []float64)
canvas.go:158
↓ 7 callers
Method
SetStrokeCapper
SetStrokeCapper sets the line cap function to be used for stroke end points. The default stroke capper is a butt cap.
canvas.go:463
↓ 7 callers
Method
String
()
svg.go:1367
↓ 7 callers
Method
Top
()
path_intersection.go:452
↓ 7 callers
Method
Translate
Translate translates the rect.
util.go:429
↓ 7 callers
Function
cubicBezierDeriv
(p0, p1, p2, p3 Point, t float64)
path_util.go:557
↓ 7 callers
Function
ellipseCurvatureRadius
(rx, ry float64, sweep bool, theta float64)
path_util.go:35
↓ 7 callers
Method
parseNumber
(v string)
svg.go:134
↓ 6 callers
Method
CoordSystemView
()
canvas.go:289
↓ 6 callers
Function
DrawPreview
DrawPreview draws the canvas's preview to a Context.
preview.go:24
↓ 6 callers
Method
Heights
Heights returns the maximum top, ascent, descent, and bottom heights of the line, where top and bottom are equal to ascent and descent respectively wi
text.go:137
↓ 6 callers
Method
IsRigid
IsRigid is true if the matrix is orthogonal and consists of only isometric transformations: translation, rotation, and reflection.
util.go:833
↓ 6 callers
Method
LoadFont
LoadFont loads a font from memory.
font.go:465
↓ 6 callers
Method
NewPage
NewPage starts adds a new page where further rendering will be written to.
renderers/pdf/pdf.go:70
↓ 6 callers
Method
Next
()
cmd/pdftext/reader.go:894
↓ 6 callers
Method
Or
Or returns the boolean path operation of path p OR q, i.e. the union of both. It It removes all self-intersections and overlapping areas, orients all
path_intersection.go:164
↓ 6 callers
Method
OverlapsLine
(a, b Point)
util.go:553
↓ 6 callers
Method
Push
(item *SweepPoint)
path_intersection.go:447
↓ 6 callers
Method
Render
(_ io.Writer, src []byte, n ast.Node)
markdown.go:181
↓ 6 callers
Method
ReplaceArcs
ReplaceArcs replaces ArcTo commands by CubeTo commands and returns a new path.
path.go:1462
↓ 6 callers
Method
SetColorSpace
(ColorSpace)
colors.go:80
↓ 6 callers
Method
SetFace
SetFace sets the font face.
text.go:491
↓ 6 callers
Method
SetView
SetView sets the current affine transformation matrix through which all operations will be transformed. See `Matrix` for how transformations work.
canvas.go:328
↓ 6 callers
Method
Settle
Settle returns the "settled"/flattened path, a visually identical version of the original. It removes all self-intersections and overlapping areas, or
path_intersection.go:130
↓ 6 callers
Method
Smoothen
Smoothen returns a new path that smoothens out a path using cubic Béziers between all the path points. It makes sure that the curvature is smooth alon
polyline.go:141
↓ 6 callers
Method
Stroke
Stroke strokes the current path and resets the path.
canvas.go:547
↓ 6 callers
Method
Text
Text draws a text blob.
renderers/gochart.go:187
↓ 6 callers
Method
ToScanxScanner
ToScanxScanner rasterizes the path to *scanx.Scanner using the given rasterizer, height, and resolution.
path.go:2526
↓ 6 callers
Method
Translate
Translate moves the view.
canvas.go:343
↓ 6 callers
Method
Xor
Xor returns the boolean path operation of path p XOR q, i.e. the symmetric difference of both. It removes all self-intersections and overlapping areas
path_intersection.go:181
↓ 6 callers
Function
cubicBezierNormal
return the normal at the right-side of the curve (when increasing t)
path_util.go:593
↓ 6 callers
Function
cubicBezierPos
(p0, p1, p2, p3 Point, t float64)
path_util.go:549
↓ 6 callers
Function
draw
(ctx *canvas.Context, y float64, title string, p, q *canvas.Path)
resources/docs/relation/main.go:49
↓ 6 callers
Function
ellipseSplit
ellipseSplit returns the new mid point, the two large parameters and the ok bool, the rest stays the same
path_util.go:149
↓ 6 callers
Function
flattenSmoothCubicBezier
split the curve and replace it by lines as long as (maximum deviation <= tolerance) is maintained
path_util.go:779
↓ 6 callers
Method
parseColorComponent
(v string)
svg.go:207
↓ 6 callers
Function
parseTextString
(b []byte)
cmd/pdftext/util.go:70
↓ 6 callers
Function
quadraticBezierDeriv
(p0, p1, p2 Point, t float64)
path_util.go:440
↓ 6 callers
Function
quadraticBezierSplit
(p0, p1, p2 Point, t float64)
path_util.go:509
↓ 6 callers
Function
quadraticToCubicBezier
Béziers /////////////////////////////////////////////////////
path_util.go:391
↓ 6 callers
Method
readInt32N
(n int)
latex_dvi.go:337
↓ 6 callers
Method
readUint32N
(n int)
latex_dvi.go:320
↓ 6 callers
Function
strokeCubicBezier
see Flat, precise flattening of cubic Bézier path and offset curves, by T.F. Hain et al., 2005, https://www.sciencedirect.com/science/article/pii/S00
path_util.go:885
↓ 6 callers
Method
writeBytes
(b []byte)
cmd/pdftext/writer.go:65
↓ 6 callers
Method
writeVal
(i interface{})
renderers/pdf/writer.go:173
↓ 5 callers
Method
CompareV
(b *SweepPoint)
path_intersection.go:1109
↓ 5 callers
Method
ContainsPoint
ContainsPoint returns true if the rectangle contains or touches an edge.
util.go:478
↓ 5 callers
Method
Coords
Coords returns all the coordinates of the segment start/end points. It omits zero-length CloseCmds.
path.go:386
↓ 5 callers
Method
Eigen
Eigen returns the matrix eigenvalues and eigenvectors. The first eigenvalue is related to the first eigenvector, and so for the second pair. Eigenvect
util.go:747
↓ 5 callers
Method
GetName
(val any)
cmd/pdftext/reader.go:319
↓ 5 callers
Method
Image
()
image/image.go:35
↓ 5 callers
Method
InterpolateY
(x float64)
path_intersection.go:295
↓ 5 callers
Method
Join
Join joins path q to p and returns the extended path p (or q if p is empty). It's like executing the commands in q to p in sequence, where if the firs
path.go:313
↓ 5 callers
Method
LineTo
LineTo both starts a shape and draws a line to a given point from the previous point.
renderers/gochart.go:106
↓ 5 callers
Function
New
New returns a portable document format (PDF) renderer.
renderers/pdf/pdf.go:33
↓ 5 callers
Method
PixOffset
PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).
image/image.go:229
↓ 5 callers
Method
PixOffset
PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).
image/image.go:332
↓ 5 callers
Method
ReflectYAbout
ReflectYAbout adds a vertical reflection transformation about y.
util.go:714
↓ 5 callers
Method
RenderImage
(img image.Image, m Matrix)
canvas.go:210
↓ 5 callers
Method
RenderViewTo
RenderViewTo transforms and renders the accumulated canvas drawing operations to another renderer.
canvas.go:852
↓ 5 callers
Method
Reset
Reset clears the path but retains the same memory. This can be used in loops where you append and process paths every iteration, and avoid new memory
path.go:142
↓ 5 callers
Method
RotateAbout
RotateAbout adds a rotation transformation about (x,y) with rot in degrees counter clockwise.
util.go:666
↓ 5 callers
Method
Scale
Scale adds a scaling transformation in sx and sy. When scale is negative it will flip those axes.
util.go:672
↓ 5 callers
Method
SetColor
SetColor sets the current drawing color. Note that fill color and stroke color are the same, so if you want different fill and stroke colors then you
renderers/gonumplot.go:69
↓ 5 callers
Method
SetStroke
SetStroke sets the stroking paint.
renderers/pdf/writer.go:995
↓ 5 callers
Method
SetZIndex
SetZIndex sets the z-index.
canvas.go:780
↓ 5 callers
Method
String
String returns the content of the text box.
text.go:1061
↓ 5 callers
Method
ToPath
ToPath converts the polyline to a path. If the last coordinate equals the first one, we close the path.
polyline.go:58
↓ 5 callers
Method
ToUnicode
([]byte)
cmd/pdftext/encoding.go:109
↓ 5 callers
Method
Translate
Translate adds a translation in x and y.
util.go:648
↓ 5 callers
Method
Weight
Weight returns the font weight (FontRegular, FontBold, ...)
font.go:39
↓ 5 callers
Method
Within
Within is the same as Contains but with the shapes swapped.
path_intersection.go:2475
↓ 5 callers
Method
computeSweepFields
type eventSliceH []*SweepPoint func (a eventSliceH) Len() int { return len(a) } func (a eventSliceH) Less(i, j int) bool { return a[i].LessH(a[j])
path_intersection.go:1641
↓ 5 callers
Method
direction
direction returns the direction of the path at the given index into Path.d and t in [0.0,1.0]. Path must not contain subpaths, and will return the pat
path.go:674
↓ 5 callers
Function
drawPath
(c *canvas.Context, x, y float64, path string, moveto bool)
resources/docs/paths/main.go:36
↓ 5 callers
Function
drawText
(c *canvas.Context, x, y float64, text string)
resources/docs/paths/main.go:53
↓ 5 callers
Function
ellipseNormal
ellipseNormal returns the normal to the right at angle theta of the ellipse, given rotation phi.
path_util.go:48
↓ 5 callers
Function
intersectionRayCircle
https://mathworld.wolfram.com/Circle-LineIntersection.html
path_intersection_util.go:799
↓ 5 callers
Function
invSpeedPolynomialChebyshevApprox
polynomialApprox returns a function y(x) that maps the parameter x [xmin,xmax] to the integral of fp. For a circle tmin and tmax would be 0 and 2PI re
util.go:1245
↓ 5 callers
Function
isWhiteSpace
(b byte)
cmd/pdftext/util.go:16
↓ 5 callers
Method
parseColor
(v string)
svg.go:232
↓ 5 callers
Function
parseFloat
(v any)
cmd/pdftext/main.go:345
↓ 5 callers
Method
parseUrlID
(val string)
svg.go:878
↓ 5 callers
Function
pdfReadVal
(r *pdfReader, ref pdfRef, b []byte)
cmd/pdftext/reader.go:607
↓ 5 callers
Method
pop
()
svg.go:123
↓ 5 callers
Function
quadraticBezierPos
see http://www.caffeineowl.com/graphics/2d/vectorial/cubic2quad01.html func cubicToQuadraticBeziers(p0, p1, p2, p3 Point, tolerance float64) [][3]Poin
path_util.go:433
↓ 5 callers
Function
relate
relate uses the Bentley-Ottmann algorithm to classify geometry intersections using DE-9IM.
path_intersection.go:2713
↓ 5 callers
Method
swapChild
(a, b *SweepNode)
path_intersection.go:632
↓ 5 callers
Method
updateHeight
()
path_intersection.go:621
↓ 5 callers
Method
writeClasses
(w io.Writer)
renderers/svg/svg.go:126
← previous
next →
201–300 of 1,447, ranked by callers