geometry

package
v0.0.0-...-2489e1b Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NearestObject

func NearestObject(objects Objects) int

NearestObject returns an index of the nearest Object in the selection.

Types

type Color

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

Color stores RGB color values and a thickness value.

func NewColor

func NewColor(r, g, b, t int) *Color

NewColor constructs a new Color.

func (*Color) T

func (c *Color) T() int

T returns thickness of the color line.

func (*Color) ToRGBA

func (c *Color) ToRGBA() color.RGBA

ToRGBA returns Color in color.RGBA.

type Object

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

Object is detectable by the observer.

func FromRect

func FromRect(rect image.Rectangle) *Object

FromRect constructs an Object from a rectangle.

func (*Object) Center

func (o *Object) Center() image.Point

Center calculates a center point of the Object.

func (*Object) Draw

func (o *Object) Draw(img *gocv.Mat, c color.RGBA, thickness int)

Draw draws an Object on the image matrices.

type Objects

type Objects []*Object

Objects represents multiple Objects.

func FromRects

func FromRects(rects []image.Rectangle) Objects

FromRects constructs a slice of Objects from the given slice of rectangles.

func (Objects) Draw

func (oo Objects) Draw(img *gocv.Mat, c color.RGBA, thickness int)

Draw draws Objects on the image matrices.

Jump to

Keyboard shortcuts

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