MemoizationCanvas
Memoization Canvas
Constructors
new MemoizationCanvas()
new MemoizationCanvas():
MemoizationCanvas
Returns
Source
graphics/memoization-canvas.ts:293
Properties
alpha
alpha:
number
Source
graphics/memoization-canvas.ts:290
canvas
canvas:
Canvas
Source
graphics/memoization-canvas.ts:279
do
do:
DO
[]
Source
graphics/memoization-canvas.ts:281
fillColor
fillColor:
string
Source
graphics/memoization-canvas.ts:286
fillStyle
fillStyle:
string
Source
graphics/memoization-canvas.ts:287
font
font:
string
Source
graphics/memoization-canvas.ts:289
fontColor
fontColor:
string
Source
graphics/memoization-canvas.ts:288
generator
generator:
RoughGenerator
Source
graphics/memoization-canvas.ts:282
roughness
roughness:
number
Source
graphics/memoization-canvas.ts:291
stateStack
stateStack:
CanvasState
[]
Source
graphics/memoization-canvas.ts:280
strokeColor
strokeColor:
string
Source
graphics/memoization-canvas.ts:283
strokePattern
strokePattern:
number
[]
Source
graphics/memoization-canvas.ts:285
strokeWidth
strokeWidth:
number
Source
graphics/memoization-canvas.ts:284
Methods
arc()
arc(
x
,y
,r
,startAngle
,endAngle
,seed
):MemoizationCanvas
Draw an arc
Parameters
• x: number
• y: number
• r: number
• startAngle: number
• endAngle: number
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:1012
clear()
clear():
void
Returns
void
Source
graphics/memoization-canvas.ts:344
curve()
curve(
path
,seed
):MemoizationCanvas
Draw a curve
Parameters
• path: number
[][]
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:850
draw()
draw(
canvas
):void
Draw memoized drawing objects
Parameters
• canvas: Canvas
Returns
void
Source
graphics/memoization-canvas.ts:1187
drawImage()
drawImage(
image
,x
,y
,width
,height
,radius
):MemoizationCanvas
Draw Image
Parameters
• image: HTMLImageElement
• x: number
• y: number
• width: number
• height: number
• radius: number
| number
[]
Returns
Source
graphics/memoization-canvas.ts:1152
ellipse()
ellipse(
x1
,y1
,x2
,y2
,seed
):MemoizationCanvas
Draw an ellipse
Parameters
• x1: number
• y1: number
• x2: number
• y2: number
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:754
fillArc()
fillArc(
x
,y
,r
,startAngle
,endAngle
,seed
):MemoizationCanvas
Draw filled arc. angles are started from 12’clock in degree.
Parameters
• x: number
• y: number
• r: number
• startAngle: number
• endAngle: number
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:971
fillCurve()
fillCurve(
path
,seed
):MemoizationCanvas
Draw filled curved lines
Parameters
• path: number
[][]
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:822
fillEllipse()
fillEllipse(
x1
,y1
,x2
,y2
,seed
):MemoizationCanvas
Draw a filled ellipse
Parameters
• x1: number
• y1: number
• x2: number
• y2: number
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:711
fillPath()
fillPath(
path
,seed
):MemoizationCanvas
Draw filled path
Parameters
• path: SVGPath
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:1059
fillPolygon()
fillPolygon(
path
,seed
):MemoizationCanvas
Draw filled polygon
Parameters
• path: number
[][]
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:889
fillRect()
fillRect(
x1
,y1
,x2
,y2
,seed
):MemoizationCanvas
Draw a filled rect
Parameters
• x1: number
• y1: number
• x2: number
• y2: number
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:494
fillRoundRect()
fillRoundRect(
x1
,y1
,x2
,y2
,radius
,seed
):MemoizationCanvas
Draw a filled round rect
Parameters
• x1: number
• y1: number
• x2: number
• y2: number
• radius: number
| number
[]
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:595
fillText()
fillText(
x
,y
,text
):MemoizationCanvas
Fill a text
Parameters
• x: number
• y: number
text baseline (metric.ascent - not the top of text)
• text: string
Returns
Source
graphics/memoization-canvas.ts:1136
line()
line(
x1
,y1
,x2
,y2
,seed
):MemoizationCanvas
Draw a line
Parameters
• x1: number
• y1: number
• x2: number
• y2: number
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:427
path()
path(
path
,seed
):MemoizationCanvas
Draw a path
Parameters
• path: SVGPath
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:1089
polygon()
polygon(
path
,seed
):MemoizationCanvas
Draw a polygon
Parameters
• path: number
[][]
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:918
polyline()
polyline(
path
,seed
):MemoizationCanvas
Draw polyline
Parameters
• path: number
[][]
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:763
rect()
rect(
x1
,y1
,x2
,y2
,seed
):MemoizationCanvas
Draw a rect
Parameters
• x1: number
• y1: number
• x2: number
• y2: number
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:529
restoreState()
restoreState():
void
Restore the canvas states from a stack
Returns
void
Source
graphics/memoization-canvas.ts:329
roundRect()
roundRect(
x1
,y1
,x2
,y2
,radius
,seed
):MemoizationCanvas
Draw a round rect
Parameters
• x1: number
• y1: number
• x2: number
• y2: number
• radius: number
| number
[]
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:651
setAlpha()
setAlpha(
alpha
):MemoizationCanvas
Set alpha
Parameters
• alpha: number
Returns
Source
graphics/memoization-canvas.ts:411
setCanvas()
setCanvas(
canvas
):void
Parameters
• canvas: Canvas
Returns
void
Source
graphics/memoization-canvas.ts:348
setFillColor()
setFillColor(
color
):MemoizationCanvas
Set fill color
Parameters
• color: string
Returns
Source
graphics/memoization-canvas.ts:379
setFillStyle()
setFillStyle(
style
):MemoizationCanvas
Set fill style
Parameters
• style: string
Returns
Source
graphics/memoization-canvas.ts:387
setFont()
setFont(
font
):MemoizationCanvas
Set font
Parameters
• font: string
Returns
Source
graphics/memoization-canvas.ts:403
setFontColor()
setFontColor(
color
):MemoizationCanvas
Set font color
Parameters
• color: string
Returns
Source
graphics/memoization-canvas.ts:395
setRoughness()
setRoughness(
roughness
):MemoizationCanvas
Set roughness
Parameters
• roughness: number
Returns
Source
graphics/memoization-canvas.ts:419
setStrokeColor()
setStrokeColor(
color
):MemoizationCanvas
Set stroke color
Parameters
• color: string
Returns
Source
graphics/memoization-canvas.ts:355
setStrokePattern()
setStrokePattern(
pattern
):MemoizationCanvas
Set stroke pattern
Parameters
• pattern: number
[]
Returns
Source
graphics/memoization-canvas.ts:371
setStrokeWidth()
setStrokeWidth(
width
):MemoizationCanvas
Set stroke width
Parameters
• width: number
Returns
Source
graphics/memoization-canvas.ts:363
storeState()
storeState():
void
Store current canvas state into a stack
Returns
void
Source
graphics/memoization-canvas.ts:311
strokeArc()
strokeArc(
x
,y
,r
,startAngle
,endAngle
,seed
):MemoizationCanvas
Draw an arc. angles are started from 3’clock in degree (0~360).
Parameters
• x: number
• y: number
• r: number
• startAngle: number
• endAngle: number
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:927
strokeCurve()
strokeCurve(
path
,seed
):MemoizationCanvas
Draw curved lines
Parameters
• path: number
[][]
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:793
strokeEllipse()
strokeEllipse(
x1
,y1
,x2
,y2
,seed
):MemoizationCanvas
Draw an ellipse
Parameters
• x1: number
• y1: number
• x2: number
• y2: number
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:667
strokeFreehand()
strokeFreehand(
path
,thinning
,tailTaper
,headTaper
):MemoizationCanvas
Draw a freehand stroke
Parameters
• path: number
[][]
• thinning: number
= 0
Thinning of the path
• tailTaper: number
= 0
Taper at the start of the path. value must be 0~1
• headTaper: number
= 0
Taper at the end of the path value must be 0~1
Returns
Source
graphics/memoization-canvas.ts:1103
strokePath()
strokePath(
path
,seed
):MemoizationCanvas
Draw a path
Parameters
• path: SVGPath
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:1028
strokePolygon()
strokePolygon(
path
,seed
):MemoizationCanvas
Draw polygon
Parameters
• path: number
[][]
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:859
strokeRect()
strokeRect(
x1
,y1
,x2
,y2
,seed
):MemoizationCanvas
Draw a rect lines
Parameters
• x1: number
• y1: number
• x2: number
• y2: number
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:458
strokeRoundRect()
strokeRoundRect(
x1
,y1
,x2
,y2
,radius
,seed
):MemoizationCanvas
Draw a round rect lines
Parameters
• x1: number
• y1: number
• x2: number
• y2: number
• radius: number
| number
[]
• seed: number
= 1
Returns
Source
graphics/memoization-canvas.ts:538
textMetric()
textMetric(
text
):CanvasTextMetric
Get Text Metric
Parameters
• text: string