texttable

package
v0.0.0-...-ebdd804 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoundingBox

type BoundingBox struct {
	XMin float64 `json:"xMin" xml:"xMin,attr"`
	YMin float64 `json:"yMin" xml:"yMin,attr"`
	XMax float64 `json:"xMax" xml:"xMax,attr"`
	YMax float64 `json:"yMax" xml:"yMax,attr"`
}

BoundingBox is a rectangular bounding box

func (BoundingBox) Center

func (bb BoundingBox) Center() (x, y float64)

Center returns the x/y coordinates of the box center

func (BoundingBox) Contains

func (bb BoundingBox) Contains(x, y float64) bool

Contains returns if the point x/y is contained within the box

func (BoundingBox) Height

func (bb BoundingBox) Height() float64

Height returns YMax - YMin

func (*BoundingBox) Include

func (bb *BoundingBox) Include(other BoundingBox)

Include modifies bb to include other. If the size of bb is zero, then all values from other will be assigned.

func (BoundingBox) IsZero

func (bb BoundingBox) IsZero() bool

IsZero returns if all values are zero

func (BoundingBox) Size

func (bb BoundingBox) Size() (width, height float64)

Size returns the width and height of the BoundingBox

func (BoundingBox) SizeIsZero

func (bb BoundingBox) SizeIsZero() bool

SizeIsZero returns if the area of the box is zero

func (BoundingBox) String

func (bb BoundingBox) String() string

func (BoundingBox) Validate

func (bb BoundingBox) Validate() error

func (BoundingBox) Width

func (bb BoundingBox) Width() float64

Width returns XMax - XMin

type StringsTable

type StringsTable [][]string

StringsTable implements Table for a 2D slice of strings.

func (StringsTable) CellBoundingBox

func (t StringsTable) CellBoundingBox(row, col int) *BoundingBox

func (StringsTable) CellExists

func (t StringsTable) CellExists(row, col int) bool

func (StringsTable) CellText

func (t StringsTable) CellText(row, col int) string

func (StringsTable) HasCellBoundingBoxes

func (t StringsTable) HasCellBoundingBoxes() bool

func (StringsTable) NumRowCells

func (t StringsTable) NumRowCells(row int) int

func (StringsTable) NumRows

func (t StringsTable) NumRows() int

type Table

type Table interface {
	NumRows() int

	// NumRowCells returns the number of cells in a row.
	// Rows may have less cells than the whole table has columns.
	// Returns zero for a non existing row.
	NumRowCells(row int) int

	// CellExists returns if there is a cell available at the given row and column position.
	CellExists(row, col int) bool

	// CellText returns the text of a cell
	// or an empty string if the cell does not exist.
	CellText(row, col int) string

	// HasCellBoundingBoxes returns if cell bounding boxes are available.
	// See CellBoundingBox
	HasCellBoundingBoxes() bool

	// CellBoundingBox returns the bounding box of a cell
	// or nil if the cell does not exist or has no bounding box information.
	// See HasCellBoundingBoxes
	CellBoundingBox(row, col int) *BoundingBox
}

Jump to

Keyboard shortcuts

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