Documentation
¶
Overview ¶
Package gfx is an experimental retained 2D canvas for gowt: a tree of nodes holding recorded Pictures, a compositor that shows it from cached tiles, and the geometry under both.
The package is pure Go and builds on every OS. Rasterizers and layer hosts live in sub-packages: gfx/cg (macOS), gfx/cairo (Linux), gfx/d2d (Windows), gfx/view (the gowt widget), gfx/offscreen (PNG without a window), gfx/layout (auto-layout) and gfx/pen (.pen designs). Most programs need only gfx, gfx/view or gfx/offscreen. The API may change without notice; docs/gfx.md has a quick start and the overview.
- Path, Measure: curves, exact bounds, flattening, length, point and tangent by length, nearest point, split.
- Recorder and Picture: drawing commands in a compact byte stream, with bounds, gradients, clips, layers with alpha, shadows, images and text measured by the backend.
- Scene and Node: transforms relative to the parent, opacity, clips, order among siblings, a grid index, hit-testing that honors ancestor clips, and transactions (Scene.Update, applied by Scene.Commit) callable from any goroutine.
- Compositor: static tiles drawn by a bounded worker pool, an active layer for dragged nodes, an overlay of animated Sprites, all placed on whole device pixels on a Host.
- RenderSubtree, Picture.WriteSVG and WriteSubtreeSVG: output without a window.
Example ¶
A scene holds nodes; a node draws a Picture recorded in its own coordinates. Changes go through Update and take effect at Commit, which a window does every frame.
package main
import (
"fmt"
"github.com/haiodo/gowt/gfx"
)
func main() {
rec := gfx.NewRecorder()
rec.FillRRect(gfx.R(0, 0, 120, 60), 8, gfx.RGB(30, 120, 220))
rec.Text("Hello", 12, 36, gfx.Font{Size: 14}, gfx.White)
card := gfx.NewNode(1)
scene := gfx.NewScene()
scene.Update(func(tx *gfx.Tx) {
tx.Add(nil, card)
tx.SetPicture(card, rec.Finish())
tx.Move(card, 100, 50)
})
scene.Commit() // without a window nobody else does
fmt.Println(scene.HitTest(gfx.Point{X: 110, Y: 60}, 0).ID(), scene.HitTest(gfx.Point{X: 0, Y: 0}, 0) == nil)
fmt.Println(card.Bounds().Min, scene.Node(1) == card)
}
Output: 1 true {100 50} true
Index ¶
- Variables
- func Release(img Image)
- func WritePicturePDF(r PDFRenderer, w io.Writer, p *Picture, o PDFOptions) error
- func WriteSubtreePDF(r PDFRenderer, w io.Writer, s *Scene, root *Node, area Rect, o PDFOptions) error
- func WriteSubtreeSVG(out io.Writer, s *Scene, root *Node, area Rect, scale float64) error
- func WriteSubtreeSVGWith(out io.Writer, s *Scene, root *Node, area Rect, scale float64, opt SVGOptions) error
- type Affine
- type Camera
- type Cap
- type Clip
- type ClipKind
- type Color
- type Compositor
- func (c *Compositor) Camera() Camera
- func (c *Compositor) Close()
- func (c *Compositor) Frame(fi FrameInfo)
- func (c *Compositor) FrameTime() FrameInfo
- func (c *Compositor) HUD() *Scene
- func (c *Compositor) HUDHit(p Point, tol float64) *Node
- func (c *Compositor) Land(nodes ...*Node)
- func (c *Compositor) Lift(nodes ...*Node)
- func (c *Compositor) NeedsFrame() bool
- func (c *Compositor) NewSprite(pic *Picture, space Space, pos Point) *Sprite
- func (c *Compositor) OnFrame(f func(FrameInfo))
- func (c *Compositor) OnViewport(f func(w, h, dpr float64))
- func (c *Compositor) SceneAt(p Point) Point
- func (c *Compositor) SetCamera(cam Camera)
- func (c *Compositor) SetViewport(w, h, dpr float64)
- func (c *Compositor) Stats() Stats
- func (c *Compositor) ViewAt(p Point) Point
- func (c *Compositor) Viewport() (w, h, dpr float64)
- func (c *Compositor) Workers() int
- func (c *Compositor) ZoomAt(f float64, p Point)
- type Document
- type Easing
- type EstimateText
- type Font
- type FrameInfo
- type Gradient
- type GradientKind
- type Group
- type Hit
- type HitMode
- type Host
- type Image
- type Item
- type Items
- type Iter
- type Join
- type Layer
- type Measure
- type Node
- func (n *Node) Bounds() Rect
- func (n *Node) Children() []*Node
- func (n *Node) Hit() HitMode
- func (n *Node) ID() int
- func (n *Node) Lifted() bool
- func (n *Node) Opacity() float64
- func (n *Node) Parent() *Node
- func (n *Node) Picture() *Picture
- func (n *Node) Shape() *Path
- func (n *Node) SubtreeBounds() Rect
- func (n *Node) Transform() Affine
- func (n *Node) Version() (self, deep uint32)
- func (n *Node) World() Affine
- func (n *Node) Z() int
- type Op
- type OpKind
- type Options
- type PDFOptions
- type PDFRenderer
- type Page
- type PageLayout
- type Path
- func (p *Path) Arc(cx, cy, r, a0, a1 float64)
- func (p *Path) ArcTo(x1, y1, x2, y2, r float64)
- func (p *Path) Bounds() Rect
- func (p *Path) Clone() *Path
- func (p *Path) Close()
- func (p *Path) Contains(q Point, tol float64) bool
- func (p *Path) CubicTo(c1x, c1y, c2x, c2y, x, y float64)
- func (p *Path) Ellipse(cx, cy, rx, ry float64)
- func (p *Path) Empty() bool
- func (p *Path) Flatten(tol float64) []Polyline
- func (p *Path) LineTo(x, y float64)
- func (p *Path) Measure(tol float64) *Measure
- func (p *Path) MoveTo(x, y float64)
- func (p *Path) Nearest(q Point) (Hit, bool)
- func (p *Path) QuadTo(cx, cy, x, y float64)
- func (p *Path) Rect(x, y, w, h float64)
- func (p *Path) Reset()
- func (p *Path) RoundRect(x, y, w, h, r float64)
- func (p *Path) RoundRect4(x, y, w, h float64, r [4]float64)
- func (p *Path) SVG() string
- func (p *Path) Split(u float64) (a, b *Path)
- func (p *Path) Transform(m Affine) *Path
- type Picture
- type Point
- type Polyline
- type Raster
- func FromBGRA(pix []byte, w, h int) *Raster
- func NewRaster(w, h int) *Raster
- func RasterFrom(img image.Image) *Raster
- func RenderPicture(r Renderer, p *Picture, scale float64, bg Color) (*Raster, error)
- func RenderSubtree(r Renderer, s *Scene, root *Node, area Rect, scale float64, bg Color) (*Raster, error)
- type Recorder
- func (r *Recorder) BeginLayer(alpha float64)
- func (r *Recorder) ClipPath(p *Path)
- func (r *Recorder) ClipRRect(rc Rect, radius float64)
- func (r *Recorder) ClipRect(rc Rect)
- func (r *Recorder) DrawImage(img Image, x, y, w, h float64)
- func (r *Recorder) EndLayer()
- func (r *Recorder) FillEllipse(rc Rect, c Color)
- func (r *Recorder) FillGradient(p *Path, g *Gradient)
- func (r *Recorder) FillPath(p *Path, c Color)
- func (r *Recorder) FillRRect(rc Rect, radius float64, c Color)
- func (r *Recorder) FillRRect4(rc Rect, radii [4]float64, c Color)
- func (r *Recorder) FillRect(rc Rect, c Color)
- func (r *Recorder) FillShadowPath(p *Path, c Color, sh Shadow)
- func (r *Recorder) FillShadowRRect(x, y, w, h, radius float64, fill Color, sh Shadow)
- func (r *Recorder) Finish() *Picture
- func (r *Recorder) Restore()
- func (r *Recorder) Rotate(a float64)
- func (r *Recorder) Save()
- func (r *Recorder) Scale(x, y float64)
- func (r *Recorder) StrokeEllipse(rc Rect, st StrokeStyle, c Color)
- func (r *Recorder) StrokeGradient(p *Path, st StrokeStyle, g *Gradient)
- func (r *Recorder) StrokePath(p *Path, st StrokeStyle, c Color)
- func (r *Recorder) StrokeRRect(rc Rect, radius float64, st StrokeStyle, c Color)
- func (r *Recorder) StrokeRRect4(rc Rect, radii [4]float64, st StrokeStyle, c Color)
- func (r *Recorder) StrokeRect(rc Rect, st StrokeStyle, c Color)
- func (r *Recorder) StrokeShadowPath(p *Path, st StrokeStyle, c Color, sh Shadow)
- func (r *Recorder) Text(s string, x, y float64, f Font, c Color)
- func (r *Recorder) TextShadow(s string, x, y float64, f Font, c Color, sh Shadow)
- func (r *Recorder) Transform(m Affine)
- func (r *Recorder) Translate(x, y float64)
- type Rect
- func (r Rect) AddPoint(p Point) Rect
- func (r Rect) Center() Point
- func (r Rect) Contains(p Point) bool
- func (r Rect) Empty() bool
- func (r Rect) Expand(d float64) Rect
- func (r Rect) H() float64
- func (r Rect) Intersect(o Rect) Rect
- func (r Rect) Intersects(o Rect) bool
- func (r Rect) Translate(d Point) Rect
- func (r Rect) Union(o Rect) Rect
- func (r Rect) W() float64
- type Renderer
- type SVGOptions
- type Scene
- func (s *Scene) Collect(r Rect, b *Items)
- func (s *Scene) CollectSubtree(root *Node, r Rect, b *Items)
- func (s *Scene) Commit() []Rect
- func (s *Scene) HitTest(p Point, tol float64) *Node
- func (s *Scene) Len() int
- func (s *Scene) Node(id int) *Node
- func (s *Scene) Pending() bool
- func (s *Scene) Query(r Rect, dst []*Node) []*Node
- func (s *Scene) Read(f func())
- func (s *Scene) Root() *Node
- func (s *Scene) Update(f func(tx *Tx))
- type ScreenScaler
- type Shadow
- type Space
- type Sprite
- func (s *Sprite) FadeTo(a float64, d time.Duration, ease Easing, done func())
- func (s *Sprite) FlyAlong(path *Path, d time.Duration, ease Easing, orient bool, done func())
- func (s *Sprite) MoveTo(p Point, d time.Duration, ease Easing, done func())
- func (s *Sprite) Pos() Point
- func (s *Sprite) Remove()
- func (s *Sprite) RotateTo(rad float64, d time.Duration, ease Easing, done func())
- func (s *Sprite) ScaleTo(f float64, d time.Duration, ease Easing, done func())
- func (s *Sprite) SetOpacity(a float64)
- func (s *Sprite) SetPicture(p *Picture)
- func (s *Sprite) SetPos(p Point)
- func (s *Sprite) SetRotation(rad float64)
- func (s *Sprite) SetScale(f float64)
- type Stats
- type Stop
- type StrokeStyle
- type Target
- type TextMeasurer
- type TextMetrics
- type Tx
- func (tx *Tx) Add(parent, n *Node)
- func (tx *Tx) ClipPath(n *Node, p *Path)
- func (tx *Tx) ClipRRect(n *Node, r Rect, radius float64)
- func (tx *Tx) ClipRRect4(n *Node, r Rect, radii [4]float64)
- func (tx *Tx) ClipRect(n *Node, r Rect)
- func (tx *Tx) Move(n *Node, x, y float64)
- func (tx *Tx) NoClip(n *Node)
- func (tx *Tx) Remove(n *Node)
- func (tx *Tx) Reparent(n, parent *Node)
- func (tx *Tx) SetOpacity(n *Node, v float64)
- func (tx *Tx) SetPicture(n *Node, pic *Picture)
- func (tx *Tx) SetShape(n *Node, shape *Path, hit HitMode)
- func (tx *Tx) SetTransform(n *Node, m Affine)
- func (tx *Tx) SetZ(n *Node, z int)
- type Verb
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( Black = Color{A: 1} White = Color{R: 1, G: 1, B: 1, A: 1} )
Black and White are the opaque extremes.
Functions ¶
func Release ¶
func Release(img Image)
Release frees an Image a backend made, if it has anything to free.
func WritePicturePDF ¶
func WritePicturePDF(r PDFRenderer, w io.Writer, p *Picture, o PDFOptions) error
WritePicturePDF writes one picture, the whole of its bounds, as a one-page PDF.
func WriteSubtreePDF ¶
func WriteSubtreePDF(r PDFRenderer, w io.Writer, s *Scene, root *Node, area Rect, o PDFOptions) error
WriteSubtreePDF writes the subtree of root, as RenderSubtree draws it, as a one-page PDF; a nil root writes the whole scene. area is the scene rectangle to write, or the zero Rect for the subtree bounds. It commits the scene's pending changes first and needs no window.
func WriteSubtreeSVG ¶
WriteSubtreeSVG writes the subtree of root, as RenderSubtree draws it, as an SVG document; a nil root writes the whole scene. area is the scene rectangle to write, or the zero Rect for the subtree bounds.
func WriteSubtreeSVGWith ¶
func WriteSubtreeSVGWith(out io.Writer, s *Scene, root *Node, area Rect, scale float64, opt SVGOptions) error
WriteSubtreeSVGWith is WriteSubtreeSVG with opt.
Types ¶
type Affine ¶
type Affine [6]float64
Affine is [a b c d tx ty]: x' = a*x + c*y + tx, y' = b*x + d*y + ty.
func TranslateBy ¶
TranslateBy returns the transform that moves by (x, y).
func (Affine) SameLinear ¶
SameLinear reports whether m and n differ at most in translation.
type Camera ¶
Camera maps the scene to the view: Origin is the scene point at the view's top left, Zoom is view points per scene unit.
type Clip ¶
Clip is one clip of an Item: the shape in the coordinates of the transform M, which maps them to the target's scene space.
type Color ¶
type Color struct{ R, G, B, A float64 }
Color is non-premultiplied RGBA in 0..1.
type Compositor ¶
type Compositor struct {
// contains filtered or unexported fields
}
Compositor shows a Scene on a Host: static tiles drawn by a pool of workers, an active layer of lifted nodes (sprites that follow their node), and an overlay of free sprites. Everything but NeedsFrame and the Sprite methods is for the goroutine that runs Frame.
func NewCompositor ¶
func NewCompositor(s *Scene, r Renderer, h Host, o Options) *Compositor
NewCompositor returns a compositor that draws s with r onto h. Most apps get one from view.New.
func (*Compositor) Close ¶
func (c *Compositor) Close()
Close stops the workers and removes every layer.
func (*Compositor) Frame ¶
func (c *Compositor) Frame(fi FrameInfo)
Frame brings the host up to date for the frame described by fi. It runs on the UI goroutine.
func (*Compositor) FrameTime ¶
func (c *Compositor) FrameTime() FrameInfo
FrameTime is the clock of the Frame being or last run.
func (*Compositor) HUD ¶
func (c *Compositor) HUD() *Scene
HUD returns the heads-up scene, made on the first call: a scene in view points (y down, the origin at the top left of the view) that is drawn over everything, tiles, lifted nodes and sprites, and does not move or zoom with the camera. Use it for indicators at the canvas edge, rulers, a minimap and text overlays. It is an ordinary Scene: nodes, pictures, transforms, clips, opacity and Update from any goroutine.
The compositor draws the scene into one image that covers the bounds of its content inside the view, and draws it again only when the scene changes or the view size or backing scale does, so a HUD costs nothing in a frame that changes nothing in it. Do not give a node over the whole view a picture to catch the pointer: set the node's shape with HitNone or a real shape, since HitBounds takes the pointer wherever the node's bounds are, see HUDHit.
func (*Compositor) HUDHit ¶
func (c *Compositor) HUDHit(p Point, tol float64) *Node
HUDHit returns the topmost HUD node under the view point p, or nil. tol is the stroke tolerance and bounds slack in points. It sees the HUD as of the last Frame, and it comes before the scene in view.Pointer: when it returns a node the pointer is over the HUD.
func (*Compositor) Land ¶
func (c *Compositor) Land(nodes ...*Node)
Land returns the nodes to the static tiles. Their sprites stay until the tiles under them are redrawn.
func (*Compositor) Lift ¶
func (c *Compositor) Lift(nodes ...*Node)
Lift moves nodes, with their subtrees, from the static tiles to the active layer: each becomes a sprite that follows its node without redrawing tiles. Nodes whose picture changes every frame, such as connectors, are redrawn into their sprite on each Frame. Call Land when the drag ends.
func (*Compositor) NeedsFrame ¶
func (c *Compositor) NeedsFrame() bool
NeedsFrame reports whether a Frame would change anything: safe from any goroutine, cheap enough for a display-link callback to call on every tick.
func (*Compositor) NewSprite ¶
func (c *Compositor) NewSprite(pic *Picture, space Space, pos Point) *Sprite
NewSprite puts pic on the overlay at pos, above the sprites made before it.
func (*Compositor) OnFrame ¶
func (c *Compositor) OnFrame(f func(FrameInfo))
OnFrame sets f to run at the start of every Frame with the frame clock, before the scene's transactions are applied: the place to advance model animations. While f is set, NeedsFrame is true and the display link runs a frame on every tick; OnFrame(nil) lets an idle scene stop ticking.
func (*Compositor) OnViewport ¶
func (c *Compositor) OnViewport(f func(w, h, dpr float64))
OnViewport sets f to run on the Frame goroutine, at the start of the HUD step, with the view size in points and the backing scale: once at the first Frame after it is set and again whenever either changes. Place the HUD nodes there (an indicator on the right edge moves with the width); the changes it makes are drawn in the same frame.
func (*Compositor) SceneAt ¶
func (c *Compositor) SceneAt(p Point) Point
SceneAt maps a view point to a scene point.
func (*Compositor) SetCamera ¶
func (c *Compositor) SetCamera(cam Camera)
SetCamera moves and zooms the view; Zoom is view points per scene unit.
func (*Compositor) SetViewport ¶
func (c *Compositor) SetViewport(w, h, dpr float64)
SetViewport sets the view size in points and the device pixels per point.
func (*Compositor) Stats ¶
func (c *Compositor) Stats() Stats
Stats returns the counters of the last frame and the totals so far.
func (*Compositor) ViewAt ¶
func (c *Compositor) ViewAt(p Point) Point
ViewAt maps a scene point to a view point.
func (*Compositor) Viewport ¶
func (c *Compositor) Viewport() (w, h, dpr float64)
Viewport returns the view size in points and the device pixels per point, as of the last SetViewport.
func (*Compositor) Workers ¶
func (c *Compositor) Workers() int
Workers is the number of tile rasterizer goroutines.
func (*Compositor) ZoomAt ¶
func (c *Compositor) ZoomAt(f float64, p Point)
ZoomAt multiplies the zoom by f keeping the scene point under the view point p where it is.
type Document ¶
type Document interface {
// NewPage ends the page before it and starts one of wpt by hpt points (1/72 inch).
NewPage(wpt, hpt float64) Page
// Close ends the last page and finishes the output. The Document is not used afterwards.
Close() error
}
Document is a paged vector output, a PDF file. A PDFRenderer makes one.
type Easing ¶
Easing maps linear progress 0..1 to eased progress; it must give 0 at 0 and 1 at 1.
var ( Linear Easing = func(t float64) float64 { return t } EaseIn Easing = func(t float64) float64 { return t * t * t } EaseOut Easing = func(t float64) float64 { u := 1 - t; return 1 - u*u*u } EaseInOut Easing = func(t float64) float64 { if t < 0.5 { return 4 * t * t * t } u := -2*t + 2 return 1 - u*u*u/2 } )
The easings. Linear is constant speed; EaseIn starts slow, EaseOut ends slow, EaseInOut does both.
func CubicBezier ¶
CubicBezier is the CSS timing function cubic-bezier(x1, y1, x2, y2).
type EstimateText ¶
type EstimateText struct{}
EstimateText is the measurer used until a backend sets one: 0.6 em per rune, ascent 0.8 em, descent 0.25 em.
func (EstimateText) MeasureText ¶
func (EstimateText) MeasureText(s string, f Font) TextMetrics
MeasureText estimates the size of s from the number of runes; Spacing counts for each of them.
type Font ¶
Font is a face, a size in points and a tracking.
Name is an exact face name (a PostScript name such as "IBMPlexSans-SmBld", or a family); when it is set, Family, Weight and Italic are not read. Without a Name the backend picks the face of Family whose weight is closest to Weight (CSS scale 100..900, 0 means 400) and whose slant matches Italic, among installed fonts and those registered with RegisterFonts. An empty Family or one the backend does not have is the default sans face of the backend, at that weight and slant.
Spacing is added after every character, in points, in drawing and in measuring: the width of a line is its natural width plus Spacing for each rune, the last one included, as in CSS.
type FrameInfo ¶
type FrameInfo struct {
Time time.Duration
Interval time.Duration // the display's refresh period, 0 if unknown
Seq uint64
}
FrameInfo describes one display frame. Time is the frame clock, the time the frame will be shown, counted from an arbitrary start; only differences mean anything. Animations run on it.
type Gradient ¶
type Gradient struct {
Kind GradientKind
P0, P1 Point
R0, R1 float64
Stops []Stop
}
Gradient is linear from P0 to P1, or radial from the circle (P0, R0) to the circle (P1, R1). Its coordinates are in the space of the shape that uses it.
func NewLinearGradient ¶
NewLinearGradient returns a gradient along the line from p0 to p1.
type GradientKind ¶
type GradientKind uint8
GradientKind is linear or radial.
const ( LinearGradient GradientKind = iota RadialGradient )
The kinds of Gradient.
type Group ¶
type Group uint8
Group orders the layers a Host holds: tiles lie under the active layer, which lies under the overlay, which lies under the HUD.
type Hit ¶
Hit is the result of Nearest: the closest point, its position u (segment index + t, as in Split) and the distance to the query point.
type Host ¶
type Host interface {
NewLayer(g Group) Layer
// Begin and Commit bracket the layer changes of one frame, so that they appear together.
Begin()
Commit()
}
Host is the surface the compositor puts layers on: a layer-backed view. All calls come from one goroutine, the one that runs Frame.
type Image ¶
type Image interface{ Size() (w, h float64) }
Image is a raster a backend can draw. *Raster is the portable one; a backend may add its own.
type Items ¶
type Items struct {
List []Item
// contains filtered or unexported fields
}
Items is a reusable buffer for Collect.
type Iter ¶
type Iter struct {
// contains filtered or unexported fields
}
Iter decodes a Picture command by command. The zero Iter is ready after Reset; reusing one keeps replays free of allocations.
type Layer ¶
type Layer interface {
// SetImage replaces the contents. The Host keeps its own reference; the caller releases img after the call.
SetImage(img Image)
// Set places the untransformed frame, then applies m about the point anchor given in the frame's
// own coordinates.
Set(frame Rect, anchor Point, m Affine)
SetOpacity(a float64)
SetHidden(h bool)
Remove()
}
Layer is one retained picture a Host composites: a tile, a sprite. Within a group a layer made later lies above one made earlier. Coordinates are view points, y down.
type Measure ¶
type Measure struct {
// contains filtered or unexported fields
}
Measure is a path prepared for arc-length queries.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node is one element of the scene tree. Its picture is drawn in the node's own coordinates: the transform maps them into the parent's, and the parent's into the scene's. A clip applies to the node's picture and to the whole subtree. Children draw after their parent, ordered by Z and then by the order they were added; a higher Z draws later and is hit first.
A node changes only through Scene.Update; the getters read the state as of the last Commit and are safe on the goroutine that commits, or inside Scene.Read.
func NewNode ¶
NewNode returns a detached node. id is the key for Scene.Node; 0 leaves the node unnamed, and with a repeated id Scene.Node returns the last one added.
func (*Node) Bounds ¶
Bounds is the visible area of the node's own picture in scene coordinates, after the clips of the ancestors; empty when the node has no picture or is clipped away.
func (*Node) SubtreeBounds ¶
SubtreeBounds is the union of Bounds over the node and everything below it.
func (*Node) Version ¶
Version returns counters that change when the node, or something below it, changes; for caches.
type Op ¶
type Op struct {
Kind OpKind
A, B, C, D, E float64
M Affine
Color Color
Path *Path
Style *StrokeStyle
Grad *Gradient
Shadow Shadow
Text string
Font Font
Image Image
}
Op is one decoded command. Fields not named by the kind are stale; Path, Style and Grad point into the Iter and are valid until its next Next.
type OpKind ¶
type OpKind uint8
OpKind tells which drawing command an Op is.
const ( OpSave OpKind = iota OpRestore // OpTranslate // A, B OpScale // A, B OpRotate // A OpTransform // M OpFill // Path, Color OpFillGrad // Path, Grad OpStroke // Path, Style, Color OpStrokeGrad // Path, Style, Grad OpShadowBox // rounded rect A, B, C, D (x, y, w, h), E radius, Shadow, Color fill OpText // Text, Font, A, B baseline origin, Color OpImage // Image, A, B, C, D destination rect OpClipRect // A, B, C, D OpClipRRect // A, B, C, D, E radius OpClipPath // Path OpBeginLayer // A alpha: everything up to OpEndLayer is composited as one with this alpha OpEndLayer // OpFillShadow // Path, Color fill, Shadow: the shadow of the filled shape, then the shape OpStrokeShadow // Path, Style, Color, Shadow: the shadow of the stroked outline, then the stroke OpTextShadow // as OpText, plus Shadow under the glyphs )
The operands of each kind are in the fields of Op named after it.
type Options ¶
type Options struct {
TilePx int // tile side in device pixels; 512
Workers int // tile rasterizer goroutines; NumCPU-2, at most 6, at least 1
Margin int // tiles kept around the view; 1
Settle time.Duration // zoom stands still this long before tiles are redrawn at the new scale; 120 ms
// ExactZoom draws tiles at exactly the zoom after a gesture instead of the next power of two
// above it. Sharper at in-between zooms, but no tile is reused when the zoom comes back.
ExactZoom bool
}
Options tune a Compositor; the zero value gives the defaults noted on each field.
type PDFOptions ¶
type PDFOptions struct {
// PageW and PageH are the page size in points. Both zero: the page fits the area at Scale
// plus Margin on every side. Both set: the area is centred in the page inside Margin and
// scaled to the largest scale that fits, but not past Scale when that is set.
PageW, PageH float64
Margin float64
// Scale is points per scene unit, or the cap of the fitted scale on a fixed page.
Scale float64
// Background, when its A is above zero, is filled over the whole area behind the content.
Background Color
}
PDFOptions place an area of a scene on a page. The zero value makes a page of the size of the area at one point per scene unit.
func (PDFOptions) Layout ¶
func (o PDFOptions) Layout(area Rect) (PageLayout, error)
Layout computes the layout of area under o, or an error when nothing is left to draw into.
type PDFRenderer ¶
PDFRenderer is a Renderer that can also write PDF: CoreGraphics on macOS, cairo on Linux; on Windows the PDF writer of package gfx/pdf with Direct2D's text engine for font lookup.
type Page ¶
type Page interface {
// Draw paints the items in order, as Target.Draw does: scale is points per scene unit and origin
// the scene point at the top left corner of the page.
Draw(scale float64, origin Point, items []Item)
}
Page is drawn in points, y down, the origin at the top left corner. Text stays text and shapes stay vector: nothing is rasterized except what the picture holds (images, shadows on some backends).
type PageLayout ¶
type PageLayout struct {
W, H float64 // page size in points
Scale float64 // points per scene unit
Origin Point // scene point at the top left corner of the page
}
PageLayout says where an area of the scene lies on a page.
type Path ¶
type Path struct {
Verbs []Verb
Pts []Point
// EvenOdd selects the even-odd fill rule, for fills and clips; the default is non-zero winding.
EvenOdd bool
}
Path is a list of verbs over a flat point list: MoveTo and LineTo take one point, QuadTo two, CubicTo three, ClosePath none. Arcs and ellipses are stored as cubics.
func ParseSVGPath ¶
ParseSVGPath reads the d attribute of an SVG path into a Path.
func PolygonPath ¶
PolygonPath returns the closed path through pts, in order.
func RoundRectPath ¶
RoundRectPath returns RectPath with the corners rounded by radius.
func RoundRectPath4 ¶
RoundRectPath4 returns RectPath with each corner rounded by its own radius (top left, top right, bottom right, bottom left).
func (*Path) Arc ¶
Arc adds a circular arc from angle a0 to a1 (radians, y down: positive is clockwise on screen) as cubics of at most 90 degrees; it joins the current subpath with a line to the arc start.
func (*Path) ArcTo ¶
ArcTo adds the arc of radius r that is tangent to the line from the current point to (x1, y1) and to the line from (x1, y1) to (x2, y2), as the HTML canvas arcTo does: a straight segment to the first tangent point, then the arc to the second. A zero radius, a repeated point or three points on a line give a straight segment to (x1, y1); without a current point the path starts at (x1, y1).
func (*Path) Bounds ¶
Bounds is the tight bounding box of the drawn geometry: curve extrema come from the roots of the derivative, not from the control points. An empty path gives EmptyRect.
func (*Path) Contains ¶
Contains reports whether q is inside the filled path under the non-zero winding rule. Curves are flattened with tolerance tol; open subpaths are treated as closed.
func (*Path) Flatten ¶
Flatten converts the path to polylines whose distance to the curves is at most tol.
func (*Path) Measure ¶
Measure flattens the path for arc-length queries; the length is the polyline length, so it is slightly short on curves. Gaps between subpaths are not counted.
func (*Path) Nearest ¶
Nearest finds the point on the path closest to q. The second result is false for a path with no segments.
func (*Path) RoundRect ¶
RoundRect adds a rectangle with corner radius r (clamped to half the shorter side).
func (*Path) RoundRect4 ¶
RoundRect4 adds a rectangle with its own radius at each corner, in the order top left, top right, bottom right, bottom left. Each radius is clamped to half the shorter side.
type Picture ¶
type Picture struct {
Bounds Rect
// Lod, when set, replaces this picture where its larger side is under LodBelow device pixels.
// It should look like p at that size; a backend fades it out over the band above LodBelow.
Lod *Picture
LodBelow float64
// contains filtered or unexported fields
}
Picture is a recorded command list with its bounds in the coordinates it was recorded in. Commands live in one byte stream: a kind byte, then float32 coordinates, 8-bit colors and varint indices. It is immutable after Finish and safe to replay from several goroutines.
func (*Picture) Equal ¶
Equal reports whether q draws exactly what p draws, Lod included. Scene.SetPicture uses it to ignore a picture that did not change, so a node moved with its content is not redrawn.
type Point ¶
type Point struct{ X, Y float64 }
Point is a position or a vector in scene units, y down.
type Raster ¶
Raster is a portable image: non-premultiplied RGBA, 4 bytes per pixel, rows top to bottom. Backends convert it on first use and keep the converted copy by the *Raster until the Raster is collected, so a Raster must not change after it was drawn.
func FromBGRA ¶
FromBGRA converts premultiplied BGRA pixels, the layout of the CoreGraphics bitmaps, to a Raster.
func RenderPicture ¶
RenderPicture draws one picture at the given scale into a Raster of its bounds.
func RenderSubtree ¶
func RenderSubtree(r Renderer, s *Scene, root *Node, area Rect, scale float64, bg Color) (*Raster, error)
RenderSubtree draws the subtree of root, with the clips of its ancestors, into a Raster; a nil root draws the whole scene. area is the scene rectangle to draw, or the zero Rect for the bounds of the subtree; scale is device pixels per scene unit. bg is the background and is transparent when it is the zero Color; use White for an opaque page. It commits the scene's pending transactions first and needs no window.
Example ¶
RenderSubtree draws a node and its subtree into a Raster; offscreen.PNG does the same in one call.
package main
import (
"fmt"
"github.com/haiodo/gowt/gfx"
"github.com/haiodo/gowt/gfx/offscreen"
)
func main() {
rec := gfx.NewRecorder()
rec.FillRRect(gfx.R(0, 0, 160, 80), 10, gfx.RGB(30, 120, 220))
n := gfx.NewNode(1)
scene := gfx.NewScene()
scene.Update(func(tx *gfx.Tx) {
tx.Add(nil, n)
tx.SetPicture(n, rec.Finish())
})
r, err := offscreen.New(offscreen.Options{})
if err != nil {
fmt.Println(err)
return
}
// the zero Rect is the bounds of the subtree; 2 is device pixels per scene unit
raster, err := gfx.RenderSubtree(r, scene, n, gfx.Rect{}, 2, gfx.White)
if err != nil {
fmt.Println(err)
return
}
png, _ := raster.PNG()
fmt.Println(len(png) > 0)
}
Output:
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder builds a Picture and tracks its bounds through the transform and clip stack.
Example ¶
The Recorder has a helper for each common shape; Text takes the baseline origin.
package main
import (
"fmt"
"github.com/haiodo/gowt/gfx"
)
func main() {
rec := gfx.NewRecorder()
rec.FillRect(gfx.R(0, 0, 100, 40), gfx.RGB(240, 240, 245))
rec.StrokeRRect(gfx.R(0, 0, 100, 40), 6, gfx.StrokeStyle{Width: 2}, gfx.RGB(26, 128, 255))
rec.FillEllipse(gfx.R(80, 20, 30, 30), gfx.RGBA(230, 51, 51, 0.8))
pic := rec.Finish()
fmt.Println(pic.Bounds.W() > 100, pic.Bounds.H() > 40)
}
Output: true true
func NewRecorder ¶
func NewRecorder() *Recorder
NewRecorder returns a Recorder that measures text with DefaultMeasurer.
func NewRecorderWith ¶
func NewRecorderWith(m TextMeasurer) *Recorder
NewRecorderWith is NewRecorder with m measuring text bounds.
func (*Recorder) BeginLayer ¶
BeginLayer starts a group composited as one at the given alpha; end it with EndLayer.
func (*Recorder) DrawImage ¶
DrawImage draws img stretched into the rectangle at (x, y) of size w by h.
func (*Recorder) EndLayer ¶
func (r *Recorder) EndLayer()
EndLayer closes the group BeginLayer opened and draws it with its alpha.
func (*Recorder) FillEllipse ¶
FillEllipse fills the ellipse that fits in rc.
func (*Recorder) FillGradient ¶
FillGradient fills p with g.
func (*Recorder) FillRRect4 ¶
FillRRect4 fills rc with a radius per corner (top left, top right, bottom right, bottom left).
func (*Recorder) FillShadowPath ¶
FillShadowPath fills p with a blurred drop shadow of its shape under it. The offset of the shadow is in the coordinates of p, so it turns and mirrors with the transform.
func (*Recorder) FillShadowRRect ¶
FillShadowRRect fills a rounded rectangle with a blurred drop shadow under it.
func (*Recorder) StrokeEllipse ¶
func (r *Recorder) StrokeEllipse(rc Rect, st StrokeStyle, c Color)
StrokeEllipse strokes the outline of the ellipse that fits in rc.
func (*Recorder) StrokeGradient ¶
func (r *Recorder) StrokeGradient(p *Path, st StrokeStyle, g *Gradient)
StrokeGradient strokes p with st, painted by g.
func (*Recorder) StrokePath ¶
func (r *Recorder) StrokePath(p *Path, st StrokeStyle, c Color)
StrokePath strokes p with st in color c.
func (*Recorder) StrokeRRect ¶
func (r *Recorder) StrokeRRect(rc Rect, radius float64, st StrokeStyle, c Color)
StrokeRRect strokes the outline of rc with corners rounded by radius.
func (*Recorder) StrokeRRect4 ¶
func (r *Recorder) StrokeRRect4(rc Rect, radii [4]float64, st StrokeStyle, c Color)
StrokeRRect4 strokes the outline of rc with a radius per corner (top left, top right, bottom right, bottom left).
func (*Recorder) StrokeRect ¶
func (r *Recorder) StrokeRect(rc Rect, st StrokeStyle, c Color)
StrokeRect strokes the outline of rc, centred on its edge.
func (*Recorder) StrokeShadowPath ¶
func (r *Recorder) StrokeShadowPath(p *Path, st StrokeStyle, c Color, sh Shadow)
StrokeShadowPath strokes p with a blurred drop shadow of the stroke under it.
func (*Recorder) Text ¶
Text draws s with its baseline origin at (x, y); the bounds come from the recorder's measurer.
func (*Recorder) TextShadow ¶
TextShadow is Text with a blurred drop shadow of the glyphs under it.
type Rect ¶
type Rect struct{ Min, Max Point }
Rect is an axis-aligned rectangle. Use EmptyRect as the identity of Union.
func EmptyRect ¶
func EmptyRect() Rect
EmptyRect returns the rectangle that contains nothing: the identity of Union.
func (Rect) Intersects ¶
Intersects reports whether r and o overlap.
type Renderer ¶
type Renderer interface {
TextMeasurer
NewTarget(wpx, hpx int) Target
}
Renderer is a drawing backend: CoreGraphics on macOS. It is safe for concurrent use, its Targets are not shared.
type SVGOptions ¶
type SVGOptions struct {
// Background, when its A is above zero, is filled over the whole area behind the content.
Background Color
}
SVGOptions are the extras of WriteSubtreeSVGWith. The zero value is WriteSubtreeSVG.
type Scene ¶
type Scene struct {
// contains filtered or unexported fields
}
Scene is a tree of nodes with a uniform grid over the visible bounds of their pictures. Changes are made in transactions with Update and applied by Commit, which the frame loop calls; queries may run concurrently with each other and with Update.
func NewScene ¶
func NewScene() *Scene
NewScene returns an empty scene. It has no bounds: nodes may lie anywhere.
func (*Scene) Collect ¶
Collect fills b with what is drawn inside r, in paint order, leaving out lifted nodes. The items are valid until the next Collect into b, and need no lock to draw.
func (*Scene) CollectSubtree ¶
CollectSubtree is Collect for root and its descendants only, lifted or not.
func (*Scene) Commit ¶
Commit applies the queued transactions in order and returns the scene areas whose pixels changed: the old and the new bounds of every node that moved or changed, lifted nodes aside. A window's frame loop calls it. Without one (a test, a program that renders to PNG) call it after Update before reading nodes or hit-testing: until then HitTest, Query and the getters of Node still show the scene as it was. RenderSubtree and offscreen.PNG commit by themselves.
func (*Scene) HitTest ¶
HitTest returns the topmost node under the scene point p, or nil. tol is the stroke tolerance and the bounds slack in scene units (screen pixels divided by the zoom). Clips of the ancestors count. It sees the scene as of the last Commit.
func (*Scene) Read ¶
func (s *Scene) Read(f func())
Read runs f holding the read lock, so that the getters of nodes are safe on any goroutine.
type ScreenScaler ¶
type ScreenScaler interface{ SetScreenScale(devicePerPoint float64) }
ScreenScaler is implemented by the Targets of the backends that draw Shadow.Screen: it sets how many device pixels one screen point of such a shadow is. The Compositor sets the display's backing scale before every tile; a Target that was not told uses 1.
type Shadow ¶
Shadow is a blurred drop shadow offset by (DX, DY).
With Screen set, DX, DY and Blur are in screen points instead: the backend applies them at rasterization, in the axes of the screen and ignoring the node and camera scale, so a shadow keeps its size while the view zooms (CoreGraphics setShadow does the same). A screen point is the backing scale of the display (Compositor.SetViewport dpr), or one device pixel for a target that was not told (see ScreenScaler). The shadow does not turn with a rotated node.
type Space ¶
type Space uint8
Space says how a Sprite's position and picture relate to the camera.
const ( // SpaceScene: the picture is in scene units and zooms with the scene; Pos is a scene point. SpaceScene Space = iota // SpacePinned: Pos is a scene point, the picture is in points and keeps its size: handles, labels. SpacePinned // SpaceScreen: Pos is a view point, the picture is in points. SpaceScreen )
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
Sprite is a picture on the compositor's overlay, moved by the compositor alone: it is drawn once and then only placed, so a cursor flying over a busy scene costs no redrawing. The picture's origin (0, 0) lies at Pos. Its methods are safe from any goroutine; they take effect on the next Frame, and animations count their time from it.
func (*Sprite) FadeTo ¶
FadeTo animates the opacity to a over d. done, when not nil, runs on the frame that finishes it.
func (*Sprite) FlyAlong ¶
FlyAlong moves the sprite along path (in the coordinates of Pos) over d. Easing shapes the progress along the arc length. With orient, the sprite is rotated to the path direction.
Example ¶
Animations run on the frame clock of the compositor; set a goal once from any goroutine.
package main
import (
"time"
"github.com/haiodo/gowt/gfx"
)
func main() {
var comp *gfx.Compositor // from view.View.Compositor()
rec := gfx.NewRecorder()
rec.FillEllipse(gfx.R(0, 0, 10, 10), gfx.RGB(230, 51, 51))
cursor := comp.NewSprite(rec.Finish(), gfx.SpacePinned, gfx.Point{})
path := &gfx.Path{}
path.MoveTo(0, 0)
path.CubicTo(60, 0, 100, 80, 200, 120)
cursor.FlyAlong(path, 600*time.Millisecond, gfx.EaseInOut, false, nil)
}
Output:
func (*Sprite) MoveTo ¶
MoveTo glides to p over d along ease; done, if set, runs on the Frame goroutine when it arrives.
func (*Sprite) SetOpacity ¶
SetOpacity sets the opacity at once and stops a fade under way.
func (*Sprite) SetPicture ¶
SetPicture replaces what the sprite shows; it is drawn again once.
func (*Sprite) SetRotation ¶
SetRotation sets the angle in radians at once and stops a rotation under way.
type Stats ¶
type Stats struct {
FrameTime time.Duration // CPU time of the last Frame
TilesApplied int // tile images put on layers by the last Frame
TilesPending int // tiles queued or being drawn
Rastered uint64 // tiles drawn since the start
RasterTime time.Duration // total worker time spent drawing tiles
SpriteDraws int // sprites drawn by the last Frame on the calling goroutine
HUDDraws int // times the HUD image was drawn by the last Frame
}
Stats counts what the compositor did; Frame fills the per-frame fields.
type StrokeStyle ¶
type StrokeStyle struct {
Width float64
Cap Cap
Join Join
MiterLimit float64
Dash []float64
DashPhase float64
}
StrokeStyle describes a stroke. The zero value is a hairline with butt caps and miter joins; set Width.
type Target ¶
type Target interface {
// Begin clears the target to bg and maps the scene point origin to the top left pixel
// at scale device pixels per scene unit.
Begin(scale float64, origin Point, bg Color)
// Draw paints the items in order.
Draw(items []Item)
Size() (wpx, hpx int)
// Pixels is premultiplied BGRA, rows top to bottom; valid until Close.
Pixels() []byte
// Snapshot returns the current pixels as an Image of the given size in points, for a Host.
Snapshot(wpt, hpt float64) Image
Close()
}
Target is an offscreen bitmap a Renderer draws into. One Target is used by one goroutine at a time.
type TextMeasurer ¶
type TextMeasurer interface {
MeasureText(s string, f Font) TextMetrics
}
TextMeasurer reports the size of text as the backend draws it.
var DefaultMeasurer TextMeasurer = EstimateText{}
DefaultMeasurer is what NewRecorder uses. Importing a backend (gfx/cg, gfx/cairo, gfx/d2d, and so gfx/view and gfx/offscreen) replaces it with that backend's measurer, so text bounds match what is drawn whatever the order of recording and of creating a renderer. Without a backend it is EstimateText.
func LazyMeasurer ¶
func LazyMeasurer(open func() (TextMeasurer, error)) TextMeasurer
LazyMeasurer returns a TextMeasurer that calls open on its first use, once, and measures with the result; when open fails it estimates with EstimateText. Backends use it so that a renderer is made only if text is recorded.
type TextMetrics ¶
type TextMetrics struct{ Width, Ascent, Descent float64 }
TextMetrics are the extents of a laid-out line in points; Ascent and Descent are positive.
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx records changes to a scene. It is valid only inside the Update call that made it.
Example ¶
A node can move, fade and be clipped without touching its picture.
package main
import (
"fmt"
"github.com/haiodo/gowt/gfx"
)
func main() {
scene := gfx.NewScene()
frame, item := gfx.NewNode(1), gfx.NewNode(2)
rec := gfx.NewRecorder()
rec.FillRect(gfx.R(0, 0, 50, 50), gfx.Black)
scene.Update(func(tx *gfx.Tx) {
tx.Add(nil, frame)
tx.Add(frame, item) // children move with their parent
tx.SetPicture(item, rec.Finish())
tx.ClipRRect(frame, gfx.R(0, 0, 30, 30), 4) // clips the frame and its subtree
tx.Move(frame, 10, 10)
})
scene.Commit()
fmt.Println(item.Bounds())
}
Output: {{10 10} {40 40}}
func (*Tx) ClipRRect ¶
ClipRRect clips n and its subtree to a rounded rectangle in the coordinates of n.
func (*Tx) ClipRRect4 ¶
ClipRRect4 is ClipRRect with a radius per corner (top left, top right, bottom right, bottom left).
func (*Tx) SetOpacity ¶
SetOpacity sets the opacity of n, 0 to 1; it multiplies down the subtree.
func (*Tx) SetPicture ¶
SetPicture sets what n draws, in its own coordinates. A picture equal to the current one changes nothing.
func (*Tx) SetShape ¶
SetShape sets the geometry hit-testing uses (local coordinates, kept by reference) and how.
func (*Tx) SetTransform ¶
SetTransform sets the transform of n relative to its parent.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cairo replays gfx Pictures with cairo and Pango into image surfaces on Linux, without a window, a display or GTK: only libcairo, libpango, libpangocairo, libgobject and fontconfig are loaded, with purego.
|
Package cairo replays gfx Pictures with cairo and Pango into image surfaces on Linux, without a window, a display or GTK: only libcairo, libpango, libpangocairo, libgobject and fontconfig are loaded, with purego. |
|
Package cg replays gfx Pictures with CoreGraphics and CoreText into CGBitmapContext surfaces on macOS, without creating any window.
|
Package cg replays gfx Pictures with CoreGraphics and CoreText into CGBitmapContext surfaces on macOS, without creating any window. |
|
Package d2d replays gfx Pictures with Direct2D 1.1 and DirectWrite on Windows, with no window: the device is a D3D11 WARP device, so no GPU is needed and a service, CI or an SSH session in session 0 can render.
|
Package d2d replays gfx Pictures with Direct2D 1.1 and DirectWrite on Windows, with no window: the device is a D3D11 WARP device, so no GPU is needed and a service, CI or an SSH session in session 0 can render. |
|
internal
|
|
|
cache
Package cache holds the caches the gfx backends keep per Renderer, bounded so that a scene which keeps making new strings, shadows or Rasters does not grow them without end.
|
Package cache holds the caches the gfx backends keep per Renderer, bounded so that a scene which keeps making new strings, shadows or Rasters does not grow them without end. |
|
fonttest
Package fonttest holds the font checks every gfx backend must pass, so that cg, cairo and d2d are held to the same behavior.
|
Package fonttest holds the font checks every gfx backend must pass, so that cg, cairo and d2d are held to the same behavior. |
|
pdftest
Package pdftest holds the PDF checks every gfx backend must pass, so that cg, cairo and the Windows writer are held to the same behavior.
|
Package pdftest holds the PDF checks every gfx backend must pass, so that cg, cairo and the Windows writer are held to the same behavior. |
|
Package layout is a flexbox-like auto-layout for editors and design tools: rows and columns with gap, padding, alignment, justification, wrapping, min and max sizes, absolute children, and fixed, hug and fill sizes.
|
Package layout is a flexbox-like auto-layout for editors and design tools: rows and columns with gap, padding, alignment, justification, wrapping, min and max sizes, absolute children, and fixed, hug and fill sizes. |
|
Package offscreen renders a gfx scene to an image without a window, a display or a build tag: it picks the headless gfx.Renderer of the running OS (CoreGraphics on macOS, cairo and Pango on Linux, Direct2D on Windows).
|
Package offscreen renders a gfx scene to an image without a window, a display or a build tag: it picks the headless gfx.Renderer of the running OS (CoreGraphics on macOS, cairo and Pango on Linux, Direct2D on Windows). |
|
Package pdf writes gfx pictures as PDF without any system library: paths, strokes, gradients, clips, images, group opacity and text.
|
Package pdf writes gfx pictures as PDF without any system library: paths, strokes, gradients, clips, images, group opacity and text. |
|
Package pen loads pen.dev design files (.pen, JSON) into gfx scene subtrees.
|
Package pen loads pen.dev design files (.pen, JSON) into gfx scene subtrees. |
|
Package printing draws gfx pictures and scenes onto the pages of a gowt.PrintJob.
|
Package printing draws gfx pictures and scenes onto the pages of a gowt.PrintJob. |
|
Package synth builds a synthetic UI-mockup / diagram document for gfx benchmarks: rounded boxes with border, shadow and two text lines, joined by cubic connectors with arrowheads, every third one dashed.
|
Package synth builds a synthetic UI-mockup / diagram document for gfx benchmarks: rounded boxes with border, shadow and two text lines, joined by cubic connectors with arrowheads, every third one dashed. |
|
Package view puts a gfx scene into a gowt window as a widget.
|
Package view puts a gfx scene into a gowt window as a widget. |