refactor
This commit is contained in:
@@ -13,6 +13,8 @@ import (
|
||||
"golang.org/x/image/font"
|
||||
"golang.org/x/image/font/gofont/gomono"
|
||||
"golang.org/x/image/math/fixed"
|
||||
|
||||
"git.nkpl.cc/twocookedfaggots/imageutils/pkg/mesh/wallpaper"
|
||||
// "github.com/droyo/styx"
|
||||
// "io/fs"
|
||||
)
|
||||
@@ -42,22 +44,22 @@ func render(img image.Image) draw.Image {
|
||||
}
|
||||
|
||||
func main() {
|
||||
// x := flag.Int("x", 2, "use to grid by x axis")
|
||||
// y := flag.Int("y", 2, "use to grid by y axis")
|
||||
// x := flag.Int("x", 2, "use to grid by x axis")
|
||||
// y := flag.Int("y", 2, "use to grid by y axis")
|
||||
flag.Parse() // now flags is ready to use
|
||||
|
||||
img, err := png.Decode(os.Stdin)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// Mesh{ // our image modifyer
|
||||
// Image: img,
|
||||
// X: *x,
|
||||
// Y: *y,
|
||||
// },
|
||||
// Mesh{ // our image modifyer
|
||||
// Image: img,
|
||||
// X: *x,
|
||||
// Y: *y,
|
||||
// },
|
||||
|
||||
dst := render(
|
||||
img,
|
||||
img,
|
||||
)
|
||||
|
||||
f, err := truetype.Parse(gomono.TTF)
|
||||
@@ -75,16 +77,16 @@ func main() {
|
||||
Src: image.NewUniform(color.Black),
|
||||
Face: face,
|
||||
Dot: fixed.Point26_6{fixed.Int26_6(img.Bounds().Dx() /
|
||||
9*64,
|
||||
9 * 64,
|
||||
),
|
||||
fixed.Int26_6(img.Bounds().Dy() /
|
||||
5*64,
|
||||
5 * 64,
|
||||
),
|
||||
},
|
||||
}
|
||||
d.DrawString(time.Now().Format(time.Kitchen))
|
||||
|
||||
err = png.Encode(os.Stdout, dst)
|
||||
err = wallpaper.Wallpaper(dst)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user