annotation

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2018 License: MIT Imports: 4 Imported by: 0

README

Annotation: Linker Annotation Tools

GitHub license
GoDoc
Build Status

codecov

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyPointAnnotation

func AnyPointAnnotation(annots []Annotation) bool

func AnyPolygonAnnotation added in v1.1.0

func AnyPolygonAnnotation(annots []Annotation) bool

func AnyRectAnnotation

func AnyRectAnnotation(annots []Annotation) bool

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

Types

type Annotation

type Annotation struct {
	Id        int    `bson:"id" json:"id"`
	Type      string `bson:"type" json:"type"`
	Label     string `bson:"label" json:"label"`
	CreatedBy string `bson:"createdBy,omitempty" json:"createdBy,omitempty"`
	Color     string `bson:"color,omitempty" json:"color,omitempty"`
	Hotkey    string `bson:"hotkey,omitempty" json:"hotkey,omitempty"`
	// Exclusive fields
	Rect    *RectAnnotation    `bson:"rect,omitempty" json:"rect,omitempty"`
	Point   *PointAnnotation   `bson:"point,omitempty" json:"point,omitempty"`
	Polygon *PolygonAnnotation `bson:"polygon,omitempty" json:"polygon,omitempty"`
}

func PointToAnnotation

func PointToAnnotation(points []pts.Point) []Annotation

type AnnotationCollection

type AnnotationCollection []Annotation

func (AnnotationCollection) PointAnnotations

func (ac AnnotationCollection) PointAnnotations() []PointAnnotation

func (AnnotationCollection) PolygonAnnotations added in v1.2.1

func (ac AnnotationCollection) PolygonAnnotations() []PolygonAnnotation

func (AnnotationCollection) RectAnnotations

func (ac AnnotationCollection) RectAnnotations() []RectAnnotation

type Point added in v1.1.0

type Point int

type PointAnnotation

type PointAnnotation struct {
	Label string `bson:"label" json:"label"`
	X     int    `bson:"x" json:"x"`
	Y     int    `bson:"y" json:"y"`
}

type PolygonAnnotation added in v1.1.1

type PolygonAnnotation struct {
	Label  string  `bson:"label" json:"label"`
	Points []Point `bson:"points" json:"points"`
}

type RectAnnotation

type RectAnnotation struct {
	Label  string `bson:"label" json:"label"`
	X      int    `bson:"x" json:"x"`
	Y      int    `bson:"y" json:"y"`
	Width  int    `bson:"width" json:"width"`
	Height int    `bson:"height" json:"height"`
}

func FindPointAnnotationRect

func FindPointAnnotationRect(label string, annots AnnotationCollection, padding int, image image.Image) RectAnnotation

func (RectAnnotation) Canon

func (ra RectAnnotation) Canon() RectAnnotation

func (RectAnnotation) FixBounds

func (ra RectAnnotation) FixBounds(size image.Point) RectAnnotation

FixBounds returns a new fixed rectangle annotation

func (RectAnnotation) Rectangle

func (ra RectAnnotation) Rectangle() image.Rectangle

Directories

Path Synopsis
parser
pts
tools

Jump to

Keyboard shortcuts

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