sharedmat

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sharedmat gives ability to share gocv.Mats using reference counts with proper ref/clone/cleanup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filled added in v1.6.0

func Filled(mat *gocv.Mat) bool

Filled is a helper to check gocv.Mat not empty

func Valid

func Valid(mat *gocv.Mat) bool

Valid is a helper to check gocv.Mat not nil

Types

type SharedMat

type SharedMat struct {
	Mat gocv.Mat

	Guard sync.RWMutex
	// contains filtered or unexported fields
}

SharedMat is a share-able gocv.Mat

func NewSharedMat

func NewSharedMat(mat gocv.Mat) *SharedMat

NewSharedMat creates a new SharedMat

func (*SharedMat) Cleanup

func (s *SharedMat) Cleanup() (filled bool, closed bool)

Cleanup will decrement refs and attempt to cleanup the SharedMat

func (*SharedMat) Clone

func (s *SharedMat) Clone() *SharedMat

Clone will clone the SharedMat and attempt to clone the gocv.Mat

func (*SharedMat) NumRefs

func (s *SharedMat) NumRefs() int

NumRefs returns the number of references

func (*SharedMat) Ref

func (s *SharedMat) Ref() *SharedMat

Ref returns a SharedMat pointer and increments refs

Jump to

Keyboard shortcuts

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