package gg

This commit is contained in:
Michael Fogleman 2016-02-19 09:43:37 -05:00
parent 99bd03b051
commit 80f52004a0
7 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,4 @@
package dd package gg
import ( import (
"image" "image"

View File

@ -1,9 +1,9 @@
package main package main
import "github.com/fogleman/dd" import "github.com/fogleman/gg"
func main() { func main() {
dc := dd.NewContext(1000, 1000) dc := gg.NewContext(1000, 1000)
dc.SetSourceRGB(1, 1, 1) dc.SetSourceRGB(1, 1, 1)
dc.Paint() dc.Paint()
dc.DrawCircle(500, 500, 400) dc.DrawCircle(500, 500, 400)

View File

@ -1,9 +1,9 @@
package main package main
import "github.com/fogleman/dd" import "github.com/fogleman/gg"
func main() { func main() {
dc := dd.NewContext(256, 256) dc := gg.NewContext(256, 256)
dc.SetSourceRGBA(1, 0, 0, 0.3) dc.SetSourceRGBA(1, 0, 0, 0.3)
dc.Paint() dc.Paint()
dc.MoveTo(20, 20) dc.MoveTo(20, 20)

View File

@ -3,13 +3,13 @@ package main
import ( import (
"math/rand" "math/rand"
"github.com/fogleman/dd" "github.com/fogleman/gg"
) )
func main() { func main() {
const W = 1024 const W = 1024
const H = 1024 const H = 1024
dc := dd.NewContext(W, H) dc := gg.NewContext(W, H)
dc.SetSourceRGB(0, 0, 0) dc.SetSourceRGB(0, 0, 0)
dc.Paint() dc.Paint()
for i := 0; i < 1000; i++ { for i := 0; i < 1000; i++ {

View File

@ -3,7 +3,7 @@ package main
import ( import (
"math" "math"
"github.com/fogleman/dd" "github.com/fogleman/gg"
) )
type Point struct { type Point struct {
@ -22,7 +22,7 @@ func Polygon(n int, x, y, r float64) []Point {
func main() { func main() {
n := 5 n := 5
points := Polygon(n, 512, 512, 400) points := Polygon(n, 512, 512, 400)
dc := dd.NewContext(1024, 1024) dc := gg.NewContext(1024, 1024)
dc.SetSourceRGB(1, 1, 1) dc.SetSourceRGB(1, 1, 1)
dc.Paint() dc.Paint()
for i := 0; i < n+1; i++ { for i := 0; i < n+1; i++ {
@ -31,7 +31,7 @@ func main() {
dc.LineTo(p.X, p.Y) dc.LineTo(p.X, p.Y)
} }
dc.SetSourceRGBA(0, 0.5, 0, 1) dc.SetSourceRGBA(0, 0.5, 0, 1)
dc.SetFillRule(dd.FillRuleEvenOdd) dc.SetFillRule(gg.FillRuleEvenOdd)
dc.FillPreserve() dc.FillPreserve()
dc.SetSourceRGBA(0, 1, 0, 0.5) dc.SetSourceRGBA(0, 1, 0, 0.5)
dc.SetLineWidth(16) dc.SetLineWidth(16)

View File

@ -1,9 +1,9 @@
package main package main
import "github.com/fogleman/dd" import "github.com/fogleman/gg"
func main() { func main() {
dc := dd.NewContext(1000, 1000) dc := gg.NewContext(1000, 1000)
dc.SetSourceRGB(1, 1, 1) dc.SetSourceRGB(1, 1, 1)
dc.Paint() dc.Paint()
dc.SetSourceRGB(0, 0, 0) dc.SetSourceRGB(0, 0, 0)

View File

@ -1,4 +1,4 @@
package dd package gg
import ( import (
"image" "image"