graph

package
v0.0.0-...-525291a Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	COLOR_WHITE = color.RGBA{255, 255, 255, 255}
	COLOR_BLACK = color.RGBA{0, 0, 0, 255}

	COLOR_RED     = color.RGBA{255, 0, 0, 255}
	COLOR_LIME    = color.RGBA{0, 255, 0, 255}
	COLOR_BLUE    = color.RGBA{0, 0, 255, 255}
	COLOR_YELLOW  = color.RGBA{255, 255, 0, 255}
	COLOR_CYAN    = color.RGBA{0, 255, 255, 255}
	COLOR_MAGENTA = color.RGBA{255, 0, 255, 255}

	COLOR_SILVER = color.RGBA{192, 192, 192, 255}
	COLOR_GRAY   = color.RGBA{128, 128, 128, 255}
	COLOR_MAROON = color.RGBA{128, 0, 0, 255}
	COLOR_OLIVE  = color.RGBA{128, 128, 0, 255}

	COLOR_GREEN  = color.RGBA{0, 128, 0, 255}
	COLOR_PURPLE = color.RGBA{128, 0, 128, 255}
	COLOR_TEAL   = color.RGBA{0, 128, 128, 255}
	COLOR_NAVY   = color.RGBA{0, 0, 128, 255}

	COLOR_DARKBLUE   = color.RGBA{0, 0, 139, 255}
	COLOR_DARKGREEN  = color.RGBA{1, 50, 32, 255}
	COLOR_DARKYELLOW = color.RGBA{0x9B, 0x87, 0x0c, 255}
	COLOR_DARKGRAY   = color.RGBA{169, 169, 169, 255}
	COLOR_DIMGRAY    = color.RGBA{105, 105, 105, 255}
)

Functions

func CopyStride

func CopyStride(dst_buf []uint8, dst_stride int, src_buf []uint8, src_stride int, nBytePerLine int, nLines int)

func DrawCircle

func DrawCircle(dst draw.Image, x, y, r int, color color.Color)

func DrawLine

func DrawLine(dst draw.Image, x1, y1, x2, y2 int, color color.Color)

func DrawRectangle

func DrawRectangle(dst draw.Image, x1, y1, x2, y2 int, color color.Color)

func DrawTriangle

func DrawTriangle(dst draw.Image, triangle Triangle2D, color color.Color)

func FillCircle

func FillCircle(dst draw.Image, x, y, r int, color color.Color)

func FillRect

func FillRect(dst draw.Image, r image.Rectangle, c color.Color)

func FillRectangle

func FillRectangle(dst draw.Image, x1, y1, x2, y2 int, color color.Color)

* Draws a filled rectangle whose top left corner is (x1, y1)

  • and bottom right corner is (x2,y2), using the current color.

func FillTriangle

func FillTriangle(dst draw.Image, triangle Triangle2D, color color.Color)

Types

type Point2D

type Point2D struct {
	// contains filtered or unexported fields
}

type Triangle2D

type Triangle2D struct {
	// contains filtered or unexported fields
}

func NewTriangle

func NewTriangle(x1, y1, x2, y2, x3, y3 int) Triangle2D

func (*Triangle2D) GetVert

func (self *Triangle2D) GetVert(i int) Point2D

func (*Triangle2D) SetVert

func (self *Triangle2D) SetVert(i int, x, y int)

func (*Triangle2D) SortByY

func (self *Triangle2D) SortByY()

Jump to

Keyboard shortcuts

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