Svg.brush.sample: def of gralha-svg-render@0.1.0.1 Import: import gralha-svg-render@0.1.0.1/svg.bend as Svg Lines 2376-2395 of gralha-svg-render@0.1.0.1/svg.bend: https://jend.leeeet.dev/read.txt?path=gralha-svg-render@0.1.0.1/svg.bend&start_line=2376&end_line=2395 import Base import gralha-text-scan@0.1.0.1/scan.bend as U import gralha-image@0.1.0.1/image.bend as Img def brush.sample(brush: Brush, +p: Point, +paintPoint: Point, next: List<&2, Scene> -> Point -> Point -> Img.Color) -> Img.Color: match brush: case Solid{c, source}: c case Bitmap{raster, inv, nearest}: +mat = inv bitmap.sample(raster, matrix.point(mat, p), matrix.point(mat, paintPoint), nearest) case PendingContext{stroke, opacity}: Img.clear() case ContextPaint{source, matrix, opacity}: +mat = matrix color.fade(brush.sample(source, matrix.point(mat, p), matrix.point(mat, paintPoint), next), opacity) case Pattern{inv, w, h, opacity, nodes}: +matrix = inv pattern.at(matrix.point(matrix, p), matrix.point(matrix, paintPoint), w, h, opacity, nodes, next) case Tile{raster, inv, w, h, opacity, u, v, grid}: tile.sample(raster, matrix.point(inv, p), w, h, opacity, u, v, grid) case Gradient{inv, radial, start, end, radius, fr, stops, spread, opacity, linear}: +q = matrix.point(inv, paintPoint) +a = start +b = end gradient.at(U.choose(Parameter, radial, radial.parameter(q, a, b, radius, fr), linear.parameter(q, a, b)), stops, spread, opacity, linear) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=gralha-image@0.1.0.1/image.bend&name=Color https://jend.leeeet.dev/definition.txt?path=gralha-image@0.1.0.1/image.bend&name=clear https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=Brush https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=Parameter https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=Point https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=Scene https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=bitmap.sample https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=color.fade https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=gradient.at https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=linear.parameter https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=matrix.point https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=pattern.at https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=radial.parameter https://jend.leeeet.dev/definition.txt?path=gralha-svg-render@0.1.0.1/svg.bend&name=tile.sample https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose