Documentation ¶
Index ¶
- Constants
- func BeginColumn(theArgs ...interface{})
- func BeginRow(theArgs ...interface{})
- func Button(theArgs ...interface{}) (bool, error)
- func Checkbox(theArgs ...interface{}) bool
- func Image(theArgs ...interface{})
- func Imshow(theWindowName string, theFrame gocv.Mat)
- func Init(theArgs ...interface{})
- func Sparkline(theArgs ...interface{})
- func Text(theArgs ...interface{})
- func Update(theArgs ...interface{})
- func Watch(theWindowName string, theCreateNamedWindow bool)
- type Block
- type Context
- type Internal
- func (in *Internal) Begin(theType int, theWhere *gocv.Mat, theX, theY, theWidth, theHeight int, ...)
- func (in *Internal) BitsetHas(theBitset int, theValue int) bool
- func (in *Internal) BlockStackEmpty() bool
- func (in *Internal) Button(theBlock *Block, theX, theY int, theLabel string) bool
- func (in *Internal) ButtonI(theBlock *Block, theX, theY int, theIdle, theOver, theDown *gocv.Mat, ...) bool
- func (in *Internal) ButtonWH(theBlock *Block, theX, theY, theWidth, theHeight int, theLabel string, ...) bool
- func (in *Internal) Checkbox(theBlock *Block, theX, theY int, theLabel string, theState []bool, ...) bool
- func (in *Internal) Clamp01(theValue float64) float64
- func (in *Internal) Counter(theBlock *Block, theX, theY int, theValue []int, theStep int, theFormat string) int
- func (in *Internal) CreateLabel(theLabel string) Label
- func (in *Internal) End(theType int)
- func (in *Internal) Error(theId int, theMessage string)
- func (in *Internal) FindMinMax(theValues []float64) (float64, float64)
- func (in *Internal) GetContext(theWindowName string) Context
- func (in *Internal) HexToScalar(theColor uint32) color.RGBA
- func (in *Internal) IArea(theX, theY, theWidth, theHeight int) int
- func (in *Internal) Image(theBlock *Block, theX, theY int, theImage *gocv.Mat)
- func (in *Internal) Init(theWindowName string, theDelayWaitKey int)
- func (in *Internal) IsMouseButton(theButton *MouseButton, theQuery int) bool
- func (in *Internal) IsString(theObj interface{}) bool
- func (in *Internal) MouseQ(theQuery int) bool
- func (in *Internal) MouseW(theWindowName string) Point
- func (in *Internal) MouseWBQ(theWindowName string, theButton int, theQuery int) bool
- func (in *Internal) MouseWQ(theWindowName string, theQuery int) bool
- func (in *Internal) PopBlock() Block
- func (in *Internal) PushBlock() Block
- func (in *Internal) Sparkline(theBlock *Block, theValues []float64, theX, theY, theWidth, theHeight int, ...)
- func (in *Internal) Text(theBlock *Block, theX, theY int, theText string, theFontScale float64, ...)
- func (in *Internal) TopBlock() *Block
- func (in *Internal) TrackbarForceValuesAsMultiplesOfSmallStep(theParams TrackbarParams, theValue []float64)
- func (in *Internal) TrackbarValueToXPixel(theParams TrackbarParams, theBounding Rect, theValue float64) int
- func (in *Internal) TrackbarXPixelToValue(theParams TrackbarParams, theBounding Rect, thePixelX int) float64
- func (in *Internal) UpdateLayoutFlow(theBlock *Block, theSize Size)
- type Label
- type Mouse
- type MouseButton
- type Point
- type Rect
- type Render
- func (r *Render) Button(theBlock *Block, theState int, theShape Rect, theLabel string)
- func (r *Render) ButtonLabel(theBlock *Block, theState int, theRect Rect, theLabel string, theTextSize Rect)
- func (r *Render) Checkbox(theBlock *Block, theState int, theShape Rect)
- func (r *Render) CheckboxCheck(theBlock *Block, theShape Rect)
- func (r *Render) CheckboxLabel(theBlock *Block, theRect Rect, theLabel string, theTextSize Rect, ...)
- func (r *Render) Counter(theBlock *Block, theShape Rect, theValue string)
- func (r *Render) Image(theBlock *Block, theRect Rect, theImage *gocv.Mat)
- func (r *Render) PutText(theBlock *Block, theState int, theColor color.RGBA, theText string, ...) int
- func (r *Render) Rectangle(theWhere *gocv.Mat, theShape Rect, theColor color.RGBA, theThickness int)
- func (r *Render) Sparkline(theBlock *Block, theValues []float64, theRect Rect, theMin, theMax float64, ...)
- func (r *Render) Text(theBlock *Block, theText string, thePos Point, theFontScale float64, ...)
- func (r *Render) Window(theBlock *Block, theTitleBar Rect, theContent Rect, theTitle string)
- type Size
- type TrackbarParams
- type Window
Constants ¶
const CLICK int = 3
const COLUMN int = 1
const CVUI_ANTIALISED int = int(gocv.LineAA) // cv2.LINE_AA
Internal things
const CVUI_FILLED int = -1
const DOWN int = 2
const EVENT_FLAG_ALTKEY int = 32 //!< indicates that ALT Key is pressed.
const EVENT_FLAG_CTRLKEY int = 8 //!< indicates that CTRL Key is pressed.
const EVENT_FLAG_LBUTTON int = 1 //!< indicates that the left mouse button is down.
! Mouse Event Flags see cv::MouseCallback
const EVENT_FLAG_MBUTTON int = 4 //!< indicates that the middle mouse button is down.
const EVENT_FLAG_RBUTTON int = 2 //!< indicates that the right mouse button is down.
const EVENT_FLAG_SHIFTKEY int = 16 //!< indicates that SHIFT Key is pressed.
const EVENT_LBUTTONDBLCLK int = 7 //!< indicates that left mouse button is double clicked.
const EVENT_LBUTTONDOWN int = 1 //!< indicates that the left mouse button is pressed.
const EVENT_LBUTTONUP int = 4 //!< indicates that left mouse button is released.
const EVENT_MBUTTONDBLCLK int = 9 //!< indicates that middle mouse button is double clicked.
const EVENT_MBUTTONDOWN int = 3 //!< indicates that the middle mouse button is pressed.
const EVENT_MBUTTONUP int = 6 //!< indicates that middle mouse button is released.
const EVENT_MOUSEHWHEEL int = 11 //!< positive and negative values mean right and left scrolling, respectively.
const EVENT_MOUSEMOVE int = 0 //!< indicates that the mouse pointer has moved over the window.
! Mouse Events see cv::MouseCallback MouseEventTypes
const EVENT_MOUSEWHEEL int = 10 //!< positive and negative values mean forward and backward scrolling, respectively.
const EVENT_RBUTTONDBLCLK int = 8 //!< indicates that right mouse button is double clicked.
const EVENT_RBUTTONDOWN int = 2 //!< indicates that the right mouse button is pressed.
const EVENT_RBUTTONUP int = 5 //!< indicates that right mouse button is released.
const IS_DOWN int = 7
const LEFT_BUTTON int = 0
Constants regarding mouse buttons
const MIDDLE_BUTTON int = 1
const OUT int = 5
const OVER int = 4
const RIGHT_BUTTON int = 2
const ROW int = 0
Constants regarding component interactions
const TRACKBAR_DISCRETE int = 4
const TRACKBAR_HIDE_LABELS int = 32
const TRACKBAR_HIDE_MIN_MAX_LABELS int = 8
const TRACKBAR_HIDE_SEGMENT_LABELS int = 1
Constants regarding components
const TRACKBAR_HIDE_STEP_SCALE int = 2
const TRACKBAR_HIDE_VALUE_LABEL int = 16
const UP int = 6
const VERSION string = "2.7"
Lib version
Variables ¶
This section is empty.
Functions ¶
func BeginColumn ¶
func BeginColumn(theArgs ...interface{})
Types ¶
type Internal ¶
type Internal struct { DefaultContext string CurrentContext string Contexts map[string]Context // indexed by the window name. Buffer []interface{} LastKeyPressed int // TODO: collect it per window DelayWaitKey int Screen Block Stack []Block // TODO: make it dynamic StackCount int TrackbarMarginX int // contains filtered or unexported fields }
This class contains all stuff that gocvui uses internally to render and control interaction with components.
func NewInternal ¶
func NewInternal() Internal
func (*Internal) BlockStackEmpty ¶
func (*Internal) CreateLabel ¶
func (*Internal) FindMinMax ¶
Find the min and max values of a vector
func (*Internal) GetContext ¶
func (*Internal) IsMouseButton ¶
func (in *Internal) IsMouseButton(theButton *MouseButton, theQuery int) bool
func (*Internal) MouseQ ¶
Mouse(const cv::String&) Mouse(const cv::String&, int) Mouse(const cv::String&, int, int) Mouse(int, int)
func (*Internal) MouseW ¶
Return the last position of the mouse. param theWindowName name of the window whose mouse cursor will be used. If nothing is informed (default), the function will return the position of the mouse cursor for the default window (the one informed in `gocvui::Init()`). return a point containing the position of the mouse cursor in the speficied window.
func (*Internal) MouseWBQ ¶
\param theWindowName name of the window that will be queried. \param theButton an integer describing the mouse button to be queried. Possible values are `gocvui::LEFT_BUTTON`, `gocvui::MIDDLE_BUTTON` and `gocvui::LEFT_BUTTON`. \param theQuery an integer describing the intended mouse query. Available queries are `gocvui::DOWN`, `gocvui::UP`, `gocvui::CLICK`, and `gocvui::IS_DOWN`.
func (*Internal) MouseWQ ¶
Mouse(const cv::String&) Mouse(const cv::String&, int, int) Mouse(int, int) Mouse(int)
func (*Internal) TrackbarForceValuesAsMultiplesOfSmallStep ¶
func (in *Internal) TrackbarForceValuesAsMultiplesOfSmallStep(theParams TrackbarParams, theValue []float64)
func (*Internal) TrackbarValueToXPixel ¶
func (in *Internal) TrackbarValueToXPixel(theParams TrackbarParams, theBounding Rect, theValue float64) int
func (*Internal) TrackbarXPixelToValue ¶
func (in *Internal) TrackbarXPixelToValue(theParams TrackbarParams, theBounding Rect, thePixelX int) float64
func (*Internal) UpdateLayoutFlow ¶
type Label ¶
type Label struct { HasShortcut bool Shortcut byte TextBeforeShortcut string TextAfterShortcut string }
Describe a component label, including info about a shortcut. If a label contains "Re&start", then: - hasShortcut will be true - shortcut will be "s" - textBeforeShortcut will be "Re" - textAfterShortcut will be "tart"
type Mouse ¶
type Mouse struct { Buttons map[int]*MouseButton AnyButton *MouseButton Position Point }
Describe the information of the mouse cursor
type MouseButton ¶
Describe a mouse button
func NewMouseButton ¶
func NewMouseButton() *MouseButton
func (*MouseButton) Reset ¶
func (b *MouseButton) Reset()
type Render ¶
type Render struct {
// contains filtered or unexported fields
}
Class that contains all rendering methods.
func (*Render) ButtonLabel ¶
func (*Render) CheckboxCheck ¶
func (*Render) CheckboxLabel ¶
func (r *Render) CheckboxLabel(theBlock *Block, theRect Rect, theLabel string, theTextSize Rect, theColor uint32)
// Inside theShape.x += 1 theShape.y += 1 theShape.width -= 2 theShape.height -= 2 in.rectangle(theBlock.where, theShape, (0x29, 0x29, 0x29), CVUI_FILLED)
type Size ¶
Represent the size of something, i.e. width and height. It is essentially a simplified version of Rect where x and y are zero.
type TrackbarParams ¶
type TrackbarParams struct { Min float64 Max float64 Step float64 Segments int Options int LabelFormat string }
Describe the inner parts of the trackbar component.
func NewTrackbarParams ¶
func NewTrackbarParams(theMin, theMax, theStep float64, theSegments int, theLabelFormat string, theOptions int) TrackbarParams