wordcloud

package
v0.0.0-...-fb5a763 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IS_NOT_FIT = 1
	IS_FIT     = 2
	OUT_INDEX  = 3
	DEGREE_360 = 360
	DEGREE_180 = 180
	IS_EMPTY   = 0
	XUNIT      = 2
	YUNIT      = 2
)

Variables

This section is empty.

Functions

func Angle2Pi

func Angle2Pi(angle float64) float64

func CeilT

func CeilT(value float64) float64

func Clear

func Clear(dc *gg.Context)

*先设置清空颜色,再进行清空

func CosT

func CosT(angle float64) float64

func DrawText

func DrawText(dc *gg.Context, text string, xpos, ypos, rotation float64)

func GetTextBound

func GetTextBound(measureDc *gg.Context, text string) (w, h, xdiff, ydiff float64)

func Rotate

func Rotate(grid *Grid, angle float64, centerX, centerY int)

func SinT

func SinT(angle float64) float64

Types

type CheckResult

type CheckResult struct {
	Angle          int
	Xpos           int
	Ypos           int
	LastCheckAngle int
}

type Grid

type Grid struct {
	Width  int
	Height int

	XScale int
	YScale int
	// contains filtered or unexported fields
}

func (*Grid) Fill

func (g *Grid) Fill(gridIntArrayWidth, gridIntArrayHeight int, gridIntArray []int)

func (*Grid) IsFit

func (g *Grid) IsFit(xIncrement, yIncrement, width, height int, gridIntArray []int) int

func (*Grid) SetCollisionMap

func (g *Grid) SetCollisionMap(collisionMap []int, width, height int)

type Position

type Position struct {
	Xpos   int
	Ypos   int
	Value  int
	XLeiji int
	YLeiji int
}

func NewPosition

func NewPosition(xpos, ypos, value, xleiji, yleiji int) *Position

func TwoByBlock

func TwoByBlock(width, height int) ([]*Position, int, int)

type WordCloudRender

type WordCloudRender struct {
	MaxFontSize    float64
	MinFontSize    float64
	FontPath       string
	OutlineImgPath string
	MeasureDc      *gg.Context
	DrawDc         *gg.Context
	TextList       []string
	Angles         []int
	Colors         []*color.RGBA
	OutImgPath     string
	// contains filtered or unexported fields
}

func NewWordCloudRender

func NewWordCloudRender(maxFontSize, minFontSize float64, fontPath string,
	imgPath string, textList []string,
	angles []int, colors []*color.RGBA,
	outImgPath string) *WordCloudRender

func (*WordCloudRender) Render

func (w *WordCloudRender) Render()

func (*WordCloudRender) ResetMeasureDc

func (w *WordCloudRender) ResetMeasureDc(fontSize float64)

func (*WordCloudRender) UpdateFontSize

func (w *WordCloudRender) UpdateFontSize(fontSize float64)

type WorldMap

type WorldMap struct {
	Width           int
	Height          int
	CollisionMap    []int
	RealImageWidth  int
	RealImageHeight int
}

func TwoByBitmap

func TwoByBitmap(imgpath string) *WorldMap

func (*WorldMap) PrintMap

func (w *WorldMap) PrintMap()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL